CN110825472A - Chart color drawing method and device, readable storage medium and electronic equipment - Google Patents

Chart color drawing method and device, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN110825472A
CN110825472A CN201910975118.9A CN201910975118A CN110825472A CN 110825472 A CN110825472 A CN 110825472A CN 201910975118 A CN201910975118 A CN 201910975118A CN 110825472 A CN110825472 A CN 110825472A
Authority
CN
China
Prior art keywords
chart
color
target
type
color model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910975118.9A
Other languages
Chinese (zh)
Other versions
CN110825472B (en
Inventor
朱俊海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Corp
Original Assignee
Neusoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neusoft Corp filed Critical Neusoft Corp
Priority to CN201910975118.9A priority Critical patent/CN110825472B/en
Publication of CN110825472A publication Critical patent/CN110825472A/en
Application granted granted Critical
Publication of CN110825472B publication Critical patent/CN110825472B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The disclosure relates to a chart color drawing method, a device, a readable storage medium and an electronic device, wherein the method comprises the following steps: acquiring a first chart color type of a target chart to be drawn; determining whether a target color model matched with the target graph exists in a pre-generated color model according to the first graph color type, wherein the target color model is used for indicating the color of at least one data item corresponding to an effective field in the target graph, the effective field is a field to be subjected to color display in the target graph, and the data item comprises the attribute of at least one effective field; and if the target color model is determined to exist, drawing the target graph according to the target color model. Therefore, when the target diagram is drawn, the target diagram can be drawn according to the target color model matched with the target diagram, the consistency of color display of the attribute corresponding to the effective field in the target diagram can be effectively guaranteed, the use requirement of a user is met, and the use experience of the user is improved.

Description

Chart color drawing method and device, readable storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of data visualization, and in particular, to a method and an apparatus for drawing a chart color, a readable storage medium, and an electronic device.
Background
In the field of data visualization, charting is generally performed based on fields, so that a visualized data presentation can be provided for a user. In the prior art, when a chart is drawn according to data, the displayed color is generally allocated to each field according to the sequence of each attribute, so when the chart is drawn for the same data table, the color display of the same attribute in the chart is inconsistent due to the change of the number of the field attributes or the sequence of the attributes. When the charts of different chart types are drawn, the problem that corresponding colors of the same attribute in the charts of different types are displayed inconsistently occurs due to different data analysis angles, for example, the data size comparison condition is checked by using a bar chart, the data percentage ratio condition is checked by using a pie chart, and the like, so that misdirection is easily caused to a user, and the user is inconvenient to use.
Disclosure of Invention
In order to solve the above problems, it is an object of the present disclosure to provide a method and apparatus for drawing a chart color with uniform color display, a readable storage medium, and an electronic device.
In order to achieve the above object, according to a first aspect of the present disclosure, there is provided a chart color drawing method including:
acquiring a first chart color type of a target chart to be drawn;
determining whether a target color model matched with the target graph exists in a pre-generated color model according to the first graph color type, wherein the target color model is used for indicating the color of at least one data item corresponding to an effective field in the target graph, the effective field is a field to be subjected to color display in the target graph, and the data item comprises the attribute of at least one effective field;
and if the target color model is determined to exist, drawing the target graph according to the target color model.
Optionally, the color model is generated by:
determining a valid field of the label chart;
determining the color of at least one data item corresponding to the effective field in the marking chart;
and generating a color model corresponding to the second chart color type according to the corresponding relation among the second chart color type of the labeled chart, the effective field in the labeled chart and the color of at least one data item corresponding to the effective field in the labeled chart.
Optionally, the determining, according to the first chart color type, whether a target color model matching the target chart exists in the pre-generated color models includes:
and when the first chart color type is a category color or a series color, if a color model with the corresponding effective field consistent with the effective field of the target chart exists in the color models which are generated in advance and correspond to the first chart color type, determining the color model as the target color model.
Optionally, the valid fields corresponding to the color model are consistent with the valid fields of the target chart, including:
the number of the effective fields of the target chart and the effective fields corresponding to the color model are the same as the field expression.
Optionally, the determining, according to the first chart color type, whether a target color model matching the target chart exists in the pre-generated color models includes:
and when the first chart color type is a sequential color, if the type of the effective field of the target chart is measurement, determining one of the color models which are generated in advance and correspond to the first chart color type as the target color model.
Optionally, after the step of drawing the target chart according to the target color model, the method further comprises:
when the chart type of the target chart is changed, if the third chart color type of the changed target chart is consistent with the first chart color type, drawing the changed target chart according to the target color model.
According to a second aspect of the present disclosure, there is provided a chart color drawing apparatus, the apparatus comprising:
the acquisition module is used for acquiring a first chart color type of a target chart to be drawn;
a determining module, configured to determine, according to the first chart color type, whether a target color model matching the target chart exists in a pre-generated color model, where the target color model is used to indicate a color of at least one data item corresponding to an effective field in the target chart, the effective field is a field to be color-displayed in the target chart, and the data item includes an attribute of the at least one effective field;
and the first drawing module is used for drawing the target chart according to the target color model if the target color model is determined to exist.
Optionally, the color model is generated by:
determining a valid field of the label chart;
determining the color of at least one data item corresponding to the effective field in the marking chart;
and generating a color model corresponding to the second chart color type according to the corresponding relation among the second chart color type of the labeled chart, the effective field in the labeled chart and the color of at least one data item corresponding to the effective field in the labeled chart.
Optionally, the determining module includes:
the first determining submodule is configured to, when the first chart color type is a category color or a series color, determine the color model as the target color model if there is a color model whose corresponding valid field is consistent with the valid field of the target chart in a color model corresponding to the first chart color type generated in advance.
Optionally, the first determining sub-module is configured to:
the number of the effective fields of the target chart and the effective fields corresponding to the color model are the same as the field expression.
Optionally, the determining module includes:
and the second determining submodule is used for determining one color model which is generated in advance and corresponds to the color type of the first chart as the target color model if the type of the effective field of the target chart is measurement when the color type of the first chart is sequential color.
Optionally, the apparatus further comprises:
and the second drawing module is used for drawing the modified target diagram according to the target color model if the third diagram color type of the modified target diagram is consistent with the first diagram color type after the first drawing module draws the target diagram according to the target color model and the diagram type of the target diagram is modified.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods of the first aspect described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of any of the above first aspects.
In the above technical solution, by obtaining the chart color type of the target chart and determining whether a target color model matching the target chart exists in the pre-generated color models, if the target color model exists, the target chart can be drawn according to the target color model. Therefore, by the technical scheme, the target graph can be drawn according to the target color model matched with the target graph when the target graph is drawn, on one hand, the change of the number of the attributes and the attribute sequence in the data table cannot cause the change of the effective field, so that the target data model cannot be changed, and the problem of inconsistent attribute color display caused by the change of the number of the attributes and the attribute sequence can be effectively avoided. On the other hand, under the condition that the target color models corresponding to the graphs at different data analysis angles are the same, the colors of the graphs of different graph types can be kept consistent, the phenomenon that the color display of the same attribute in the graphs of different graph types is inconsistent due to different data analysis angles is avoided, the consistency of the color display of the attribute corresponding to the effective field in the target graph can be effectively guaranteed, uniform and visual graph display is provided, the practicability of data visualization is improved, meanwhile, the use requirement of a user is met, and the use experience of the user is improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIGS. 1 a-1 c are exemplary diagrams;
FIG. 2 is a flow chart diagram of a method of chart color rendering provided in accordance with one embodiment of the present disclosure;
3 a-3 c are exemplary graphs;
FIG. 4 is a block diagram of a chart color rendering apparatus provided in accordance with one embodiment of the present disclosure;
FIG. 5 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
In order to make the technical solutions provided by the embodiments of the present invention easier to understand by those skilled in the art, first, related technologies and application scenarios are briefly described below.
As described in the background, a data table may be displayed in the form of a graph in order to facilitate a user to intuitively analyze data. Each chart has its corresponding chart type indicating the shape of the chart display, e.g., the chart type may be a bar chart, a line chart, a pie chart, etc. A field is displayed in the diagram, and the attribute of the field refers to the value of the field, for example, when the field is "region", the attribute may include "china", "south" and "northeast". In addition, when a field takes a value as a numeric value, the type of the field is a measure, for example, the field takes a value of 1000 or 2000, the type of the field takes a value of 1000 or 2000, and the type of the field takes a value of "sales", that is, a measure, and when a field takes a value other than a numeric value, the type of the field takes a dimension, such as the "region" field described above.
The inventor discovers through analysis of the prior art that in the prior art, when a chart corresponding to the same data table is drawn, the same attribute is displayed in different colors due to the fact that the number or sequence of the field attributes is changed or the data analysis angle is different, and intuitive analysis by a user is not facilitated.
The following description will be given by taking the attribute order change as an example. Illustratively, as shown below, tables 1 and 2 are different presentations for the same data table:
region of land Sales volume
Northeast
5000
East China 17000
Huazhong 3000
North China 23000
South China 4000
Northwest of China 3200
Southwest 6000
TABLE 1
Figure BDA0002233356040000061
TABLE 2
As shown above, the storage order of the attributes "chinese" and "east" in table 1 and table 2 is opposite, where when the pie chart is drawn according to table 1, the drawn chart is shown in fig. 1a, and when the pie chart is drawn according to table 2, the drawn chart is shown in fig. 1b (for comparison, the colors corresponding to "chinese" and "east" are respectively filled by the patterns, and other attributes do not change). Therefore, after the sequence of the fields in the data table is changed, the color display of the same attribute of the drawn chart is inconsistent, as can be clearly seen from fig. 1a and 1b, the colors displayed in "huazhong" in fig. 1a and "huazhong" in fig. 1b are different, in this case, confusion is easily caused to the user, and the user experience is poor.
Based on this, the present disclosure provides a chart color drawing method in view of the above problems found by the inventors. Fig. 2 is a flowchart of a method for drawing a color of a chart according to an embodiment of the present disclosure, and as shown in fig. 2, the method includes:
in S21, a first chart color type of the target chart to be drawn is acquired.
In the present disclosure, an attribute of a chart color type for indicating a color display manner of the chart may be set for the chart, and for example, the chart color type may be a category color, a series color, or a sequence color. The category colors are displayed in the chart according to categories, and each category can display different colors, or a plurality of categories can display the same color, as shown in fig. 3a, wherein "huazhong" and "huabei" are different categories; the series color representation is formed by a plurality of classifications in the chart, and is displayed according to each group of colors, as shown in fig. 3b, wherein a plurality of classifications of books, household kitchenware, furniture and the like are formed into a group and are displayed according to each group of colors, and exemplarily, the corresponding display of "china" is a group of colors; the sequential color indicates that the colors in the chart are displayed as gradation colors.
One chart type may correspond to a plurality of chart color types, as shown in fig. 3a and 3b, the corresponding chart types are bar charts, the chart color model of the chart shown in fig. 3a is a category color, and the chart color type of the chart shown in fig. 3b is a series color. Thus, when setting a chart color type of a chart, a plurality of chart color types supportable by the chart type of the chart may be set first, and then the chart color types may be set for different chart display modes belonging to the same chart type. When the chart color type that can be supported by the chart type is one, the chart color type can be directly set as the chart color type corresponding to the different chart display modes belonging to the chart type. Therefore, when the target chart to be drawn is determined, the chart color type of the target chart can be directly determined.
In S22, it is determined whether a target color model matching a target chart exists in the pre-generated color models according to the first chart color type, the target color model being used to indicate a color of at least one data item corresponding to a valid field in the target chart, the valid field being a field to be color-displayed in the target chart, the data item including an attribute of the at least one valid field.
Wherein the color model may be generated in advance. For a data table, a plurality of fields may be included, and when a chart is drawn, a part of the fields may be selected for drawing the chart, and the selected part of the fields is valid fields. The data item may be an attribute of one valid field, for example, an attribute "huazhong" of the valid field "region" may be one data item, and the data item may also be a combination of attributes of a plurality of valid fields, for example, an attribute "distributor" of the valid field "customer type" and a valid field "sales amount" may be one data item (i.e., a "distributor-sales amount" may be used as a data item). When the valid field is the metric, the valid field can be directly used as the corresponding attribute thereof and combined with other valid fields to be used as the data item.
In S23, if it is determined that the target color model exists, the target chart is drawn based on the target color model.
For example, when the target diagram is drawn according to the target color model, the drawing may be performed according to the color of the data item corresponding to the valid field of the target diagram in the target diagram. Illustratively, the valid field of the target chart is "region", and the color of the attribute corresponding to the valid field is indicated in the target color model. For example, the attribute "huazhong" indicating the valid field "region" in the target color model has a color of a1, the attribute "huadong" has a color of a2, and the attribute "northeast" has a color of A3. When the chart target chart is drawn, if the attributes included in the valid fields are "northeast", "east", "china", "north", "south", "north-west", the attribute "china" drawing color a1, the attribute "east-west" drawing color a2, and the attribute "northeast" drawing color A3 may be displayed.
For another example, when the valid fields of the target chart are "customer type" and "shipping quantity", the color of the data item corresponding to the valid field is indicated in the target color model. For example, the color of the data item "number of distributed customers-shipments" corresponding to the valid field indicated in the target color model is B1, the color of the data item "number of direct marketing customers-shipments" corresponding to the valid field is B2, the color of the data item "number of strategic customers-shipments" corresponding to the valid field is B3, and the color of the data item "number of partner-shipments" corresponding to the valid field is B4. The chart drawn according to the target color model is shown in fig. 3c, in which only the colors corresponding to the Chinese are used for identification.
For the data items of the target color model that do not indicate a color, the data items may be drawn according to a default color, or may be drawn by selecting any other color than the color corresponding to the target color model, which is not limited in this disclosure.
For example, the target graph drawn from table 1 according to the method provided in the present disclosure may be as shown in fig. 1a, and when the table 2 is drawn according to the method provided in the present disclosure, the target graph is as shown in fig. 1c, where in fig. 1c and fig. 1a, the display color corresponding to the attribute "huazhong" is the same, and the display color corresponding to the attribute "huadong" is also the same, so that data can be conveniently and intuitively displayed.
In another embodiment, when the histogram is drawn according to table 1, the matched target color model may be determined according to the valid field and the chart color type thereof, and in this embodiment, the determined target color model corresponding to the histogram is the same as the target color model corresponding to the pie chart, so that the histogram may be drawn according to the target color model, so that the same color is displayed in the same attribute in the histogram and the pie chart. The manner of matching the target color model and drawing the chart according to the target color model is described in detail above, and is not described herein again.
In the above technical solution, by obtaining the chart color type of the target chart and determining whether a target color model matching the target chart exists in the pre-generated color models, if the target color model exists, the target chart can be drawn according to the target color model. Therefore, by the technical scheme, the target graph can be drawn according to the target color model matched with the target graph when the target graph is drawn, on one hand, the change of the number of the attributes and the attribute sequence in the data table cannot cause the change of the effective field, so that the target data model cannot be changed, and the problem of inconsistent attribute color display caused by the change of the number of the attributes and the attribute sequence can be effectively avoided. On the other hand, under the condition that the target color models corresponding to the graphs at different data analysis angles are the same, the colors of the graphs of different graph types can be kept consistent, the phenomenon that the colors of the same attribute are displayed in the graphs of different types in an inconsistent manner due to different data analysis angles is avoided, the consistency of color display of the attribute corresponding to the effective field in the target graph can be effectively guaranteed, uniform and visual graph display is provided, the practicability of data visualization is improved, meanwhile, the use requirements of users are met, and the use experience of the users is improved.
In order to make the technical solutions provided by the embodiments of the present invention easier to understand by those skilled in the art, the following first describes each step in the above-mentioned methods in detail.
Alternatively, the color model may be generated by:
the valid fields of the labeled chart are determined.
The labeled chart may be a frame structure corresponding to the color model, that is, there is no actual data in the labeled chart. During initialization, the valid field of the label chart is empty, and the valid field can be specified by a user. When the valid field is determined according to the operation of the user, the valid field can be written into the label chart, so that the valid field of the label chart is determined.
Determining a color of at least one data item corresponding to a valid field in the label chart. When the valid field in the label chart is determined, the valid field may correspond to a plurality of attributes, each attribute may serve as a data item, and a plurality of valid fields may be combined to serve as a data item. When determining the color corresponding to the data item, the color of the data item corresponding to the valid field may be determined in response to an indication of a user, and the determined color of the data item corresponding to the valid field may be written into the mark chart. Optionally, the valid fields in the color model of category color generally select one or two fields with type as dimension, the valid fields in the color model of series color generally consist of fields with type as dimension or jointly consist of fields with type as dimension and type as measure, and the valid fields in the color model of sequence color generally select one field with type as measure.
The color may be specified for each data item corresponding to the valid field, or may also be specified for a part of data items corresponding to the valid field, which may be set according to an actual usage scenario, and this disclosure does not limit this.
And generating a color model corresponding to the second chart color type according to the corresponding relation among the second chart color type of the labeled chart, the effective field in the labeled chart and the color of at least one data item corresponding to the effective field in the labeled chart.
The chart color type of the label chart can be preset, and the chart color type is described above and is not described herein again. Therefore, the corresponding relation among the effective field written in the mark chart, the color of the data item corresponding to the effective field and the chart color type of the mark chart can be determined. For example, a color model may be generated according to the correspondence relationship, and the label chart may also be used as the color model.
Therefore, by the technical scheme, the color model can be subjected to unified and standardized structure description, so that the application range of the color model is improved, and data support is provided for ensuring the color display consistency of the chart.
Optionally, in S22, according to the first chart color type, an exemplary implementation manner of determining whether there is a target color model matching the target chart in the pre-generated color models is as follows:
and when the first chart color type is a category color or a series color, if a color model with the corresponding effective field consistent with the effective field of the target chart exists in the color models which are generated in advance and correspond to the first chart color type, determining the color model as the target color model.
When the color type of the first chart is a category color or a series color, the displayed color is related to the content corresponding to each valid field, so that whether the valid field of the target chart is consistent with the valid field corresponding to the color model needs to be further determined, and the target chart can be drawn according to the color model when the valid fields of the target chart are consistent.
Illustratively, the valid fields corresponding to the color model are consistent with the valid fields of the target chart, including:
the number of the effective fields of the target chart and the effective fields corresponding to the color model are the same as the field expression.
Wherein, in one embodiment, a field can be uniquely represented by a field expression. For example, the field expression may be a field identifier, and when the names of the valid fields are different, but the field identifiers are the same, and the number of valid fields is the same, it may be determined that the valid fields of the target chart are consistent with the valid fields corresponding to the color model. In another embodiment, the field expression may be represented by a concat () function. Here, the concat () function is an existing algorithm, and is not described herein again. Therefore, when the name of the effective field is changed according to the actual use scene, but the field identifier of the effective field is not changed, the matching accuracy of the target chart and the color model can be effectively ensured, and meanwhile, the requirement of the user for personalized customization can be met.
Optionally, in S22, according to the first chart color type, another exemplary implementation manner of determining whether there is a target color model matching the target chart in the pre-generated color models is as follows, including:
and when the first chart color type is a sequential color, if the type of the effective field of the target chart is measurement, determining one of the color models which are generated in advance and correspond to the first chart color type as the target color model.
And the type of the effective field corresponding to the color model with the chart color type being the sequential color is the measurement. The color model of the chart color type of the sequential color is used for characterizing the magnitude relation between numerical values, so that the valid fields of which the types are measurement can be applied to the color model of the sequential color.
Thus, when the first chart color type is sequential color, the target chart can be drawn based on the color model of the sequential color when the type of the valid field of the target chart is measurement. For example, if there are a plurality of color models of sequential colors, one of the color models may be randomly or by default selected as the target color model, or one of the color models may be designated as the target color model by the user, which is not limited in this disclosure. When the target color model is determined, if the color of the minimum value of the effective field is indicated in the target color model, the color may be gradually deepened or lightened according to the increase of the attribute value of the effective field, so as to achieve the gradual change effect. If the colors of the minimum value and the maximum value of the valid field are indicated in the target color model, the color corresponding to the intermediate value can be uniformly and gradually changed based on the colors of the maximum value and the minimum value. The implementation manner of the color gradient is the prior art, and is not described herein again.
Therefore, according to the technical scheme, when the first chart color type is the sequential color, the target color model matched with the target chart is determined by verifying the type of the effective field of the target chart, so that the application range of the color model can be effectively improved, and the use experience of a user is ensured.
In addition, according to different use scenes, after the target diagram is drawn, the diagram type of the target diagram may need to be changed. However, in the prior art, when the chart type is changed, the color of the chart is readjusted after the pie chart shown in fig. 1a is converted into a bar chart, which is shown in fig. 3a, and the color display of the bar chart is inconsistent with that of fig. 1 a. Moreover, during the switching process between the bar chart and the pie chart, the user may be required to set the line-column conversion to obtain the chart meeting the requirement of the user.
In view of the above problems, the present disclosure also provides the following embodiments. Optionally, after the step 23 of drawing the target chart according to the target color model, the method further comprises:
when the chart type of the target chart is changed, if the third chart color type of the changed target chart is consistent with the first chart color type, drawing the changed target chart according to the target color model.
Illustratively, the chart type of the drawn target chart is a pie chart. When the pie chart is changed into a bar chart for displaying, whether a third chart color type corresponding to the bar chart is consistent with a first chart color type of the pie chart can be determined, and if the first chart color type is a category color and the third chart color type is a category color, the bar chart can be directly drawn according to a target color model. If the first chart color type is a category color and the third chart color type is a series color, the first chart color type and the third chart color type are not consistent, and at this time, whether a target color model matched with the modified target chart exists in the pre-generated color model or not can be determined again, so that the modified target chart is drawn.
Through the technical scheme, when the chart type of the drawn target chart is changed, if the corresponding chart color type is not changed, the changed target chart can be directly drawn according to the target color model, so that the attribute corresponding to the effective field in the chart can be displayed as the same color when the chart type is changed, the consistency of chart color display is ensured, the use requirement of a user is met, and the use experience of the user is improved.
The present disclosure also provides a chart color drawing apparatus, as shown in fig. 4, the apparatus 10 including:
an obtaining module 100, configured to obtain a first chart color type of a target chart to be drawn;
a determining module 200, configured to determine, according to the first chart color type, whether a target color model matching the target chart exists in a pre-generated color model, where the target color model is used to indicate a color of at least one data item corresponding to an effective field in the target chart, the effective field is a field to be color-displayed in the target chart, and the data item includes an attribute of the at least one effective field;
a first drawing module 300, configured to draw the target graph according to the target color model if it is determined that the target color model exists.
Optionally, the color model is generated by:
determining a valid field of the label chart;
determining the color of at least one data item corresponding to the effective field in the marking chart;
and generating a color model corresponding to the second chart color type according to the corresponding relation among the second chart color type of the labeled chart, the effective field in the labeled chart and the color of at least one data item corresponding to the effective field in the labeled chart.
Optionally, the determining module 200 includes:
the first determining submodule is configured to, when the first chart color type is a category color or a series color, determine the color model as the target color model if there is a color model whose corresponding valid field is consistent with the valid field of the target chart in a color model corresponding to the first chart color type generated in advance.
Optionally, the first determining sub-module is configured to:
the number of the effective fields of the target chart and the effective fields corresponding to the color model are the same as the field expression.
Optionally, the determining module 200 includes:
and the second determining submodule is used for determining one color model which is generated in advance and corresponds to the color type of the first chart as the target color model if the type of the effective field of the target chart is measurement when the color type of the first chart is sequential color.
Optionally, the apparatus 10 further comprises:
a second drawing module, configured to, after the first drawing module 300 draws the target graph according to the target color model, when the graph type of the target graph is changed, draw the changed target graph according to the target color model if a third graph color type of the changed target graph is consistent with the first graph color type.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating an electronic device 700 according to an example embodiment. As shown in fig. 5, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the chart color drawing method. The memory 702 is used to store various types of data to support operation at the electronic device 700, such as instructions for any application or method operating on the electronic device 700 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The Memory 702 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components 703 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 702 or transmitted through the communication component 705. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 707 can therefore include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the chart color drawing method described above.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the chart color drawing method described above. For example, the computer readable storage medium may be the memory 702 described above including program instructions executable by the processor 701 of the electronic device 700 to perform the chart color drawing method described above.
Fig. 6 is a block diagram illustrating an electronic device 1900 according to an example embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 6, an electronic device 1900 includes a processor 1922, which may be one or more in number, and a memory 1932 for storing computer programs executable by the processor 1922. The computer program stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processor 1922 may be configured to execute the computer program to perform the chart color drawing method described above.
Additionally, electronic device 1900 may also include a power component 1926 and a communication component 1950, the power component 1926 may be configured to perform power management of the electronic device 1900, and the communication component 1950 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 1900. In addition, the electronic device 1900 may also include input/output (I/O) interfaces 1958. The electronic device 1900 may operate based on an operating system, such as Windows Server, Mac OS XTM, UnixTM, Linux, etc., stored in memory 1932.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the chart color drawing method described above. For example, the computer readable storage medium may be the memory 1932 described above that includes program instructions executable by the processor 1922 of the electronic device 1900 to perform the chart color drawing method described above.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A method for drawing chart colors, the method comprising:
acquiring a first chart color type of a target chart to be drawn;
determining whether a target color model matched with the target graph exists in a pre-generated color model according to the first graph color type, wherein the target color model is used for indicating the color of at least one data item corresponding to an effective field in the target graph, the effective field is a field to be subjected to color display in the target graph, and the data item comprises the attribute of at least one effective field;
and if the target color model is determined to exist, drawing the target graph according to the target color model.
2. The method of claim 1, wherein the color model is generated by:
determining a valid field of the label chart;
determining the color of at least one data item corresponding to the effective field in the marking chart;
and generating a color model corresponding to the second chart color type according to the corresponding relation among the second chart color type of the labeled chart, the effective field in the labeled chart and the color of at least one data item corresponding to the effective field in the labeled chart.
3. The method of claim 1, wherein determining whether a target color model matching the target chart exists in the pre-generated color models according to the first chart color type comprises:
and when the first chart color type is a category color or a series color, if a color model with the corresponding effective field consistent with the effective field of the target chart exists in the color models which are generated in advance and correspond to the first chart color type, determining the color model as the target color model.
4. The method of claim 3, wherein the valid fields corresponding to the color model are consistent with the valid fields of the target chart, comprising:
the number of the effective fields of the target chart and the effective fields corresponding to the color model are the same as the field expression.
5. The method of claim 1, wherein determining whether a target color model matching the target chart exists in the pre-generated color models according to the first chart color type comprises:
and when the first chart color type is a sequential color, if the type of the effective field of the target chart is measurement, determining one of the color models which are generated in advance and correspond to the first chart color type as the target color model.
6. The method according to any of claims 1-5, wherein after the step of drawing the target chart according to the target color model, the method further comprises:
when the chart type of the target chart is changed, if the third chart color type of the changed target chart is consistent with the first chart color type, drawing the changed target chart according to the target color model.
7. A chart color drawing apparatus, the apparatus comprising:
the acquisition module is used for acquiring a first chart color type of a target chart to be drawn;
a determining module, configured to determine whether a target color model matching the target chart exists in a pre-generated color model according to the first chart color type, where the target color model is used to indicate a color of at least one data item corresponding to an effective field in the target chart, the effective field is a field to be color-displayed in the target chart, and the data item includes an attribute of the at least one effective field;
and the first drawing module is used for drawing the target chart according to the target color model if the target color model is determined to exist.
8. The apparatus of claim 7, wherein the color model is generated by:
determining a valid field of the label chart;
determining the color of at least one data item corresponding to the effective field in the marking chart;
and generating a color model corresponding to the second chart color type according to the corresponding relation among the second chart color type of the labeled chart, the effective field in the labeled chart and the color of at least one data item corresponding to the effective field in the labeled chart.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 6.
CN201910975118.9A 2019-10-14 2019-10-14 Chart color drawing method, device, readable storage medium and electronic equipment Active CN110825472B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910975118.9A CN110825472B (en) 2019-10-14 2019-10-14 Chart color drawing method, device, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910975118.9A CN110825472B (en) 2019-10-14 2019-10-14 Chart color drawing method, device, readable storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110825472A true CN110825472A (en) 2020-02-21
CN110825472B CN110825472B (en) 2023-12-29

Family

ID=69549113

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910975118.9A Active CN110825472B (en) 2019-10-14 2019-10-14 Chart color drawing method, device, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110825472B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463954A (en) * 2020-11-11 2021-03-09 远光软件股份有限公司 Visual multidimensional data display system and method based on semantic recognition
CN114913268A (en) * 2022-05-24 2022-08-16 盐城金堤科技有限公司 Method, device and storage medium for regional color display of chart

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0546773A2 (en) * 1991-12-11 1993-06-16 Xerox Corporation Graphical user interface for editing a palette of colours
US6353452B1 (en) * 1997-10-20 2002-03-05 International Business Machines Corporation Data item display method and device, and recording medium storing a program for controlling display of data item
CN104598436A (en) * 2013-10-31 2015-05-06 北京东方艾迪普科技发展有限公司 Method and device for dynamically generating three-dimensional chart
CN104657452A (en) * 2015-02-06 2015-05-27 重庆师范大学 Spatial switching system for pre-pregnancy eugenic archive data
CN105843788A (en) * 2016-03-31 2016-08-10 浪潮通信信息系统有限公司 Report generation method and device
US20180089866A1 (en) * 2016-09-28 2018-03-29 International Business Machines Corporation Graphical evaluation of a cognitive analysis using a 3d swivel bar chart
CN109543162A (en) * 2018-10-17 2019-03-29 金蝶软件(中国)有限公司 More diagrammatic representation method, apparatus, computer equipment and the storage medium of data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0546773A2 (en) * 1991-12-11 1993-06-16 Xerox Corporation Graphical user interface for editing a palette of colours
US6353452B1 (en) * 1997-10-20 2002-03-05 International Business Machines Corporation Data item display method and device, and recording medium storing a program for controlling display of data item
CN104598436A (en) * 2013-10-31 2015-05-06 北京东方艾迪普科技发展有限公司 Method and device for dynamically generating three-dimensional chart
CN104657452A (en) * 2015-02-06 2015-05-27 重庆师范大学 Spatial switching system for pre-pregnancy eugenic archive data
CN105843788A (en) * 2016-03-31 2016-08-10 浪潮通信信息系统有限公司 Report generation method and device
US20180089866A1 (en) * 2016-09-28 2018-03-29 International Business Machines Corporation Graphical evaluation of a cognitive analysis using a 3d swivel bar chart
CN109543162A (en) * 2018-10-17 2019-03-29 金蝶软件(中国)有限公司 More diagrammatic representation method, apparatus, computer equipment and the storage medium of data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
施丽军 等: "基于模板的钻孔柱状图自动成图的实现", 地质找矿论丛, vol. 28, no. 04, pages 576 - 581 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463954A (en) * 2020-11-11 2021-03-09 远光软件股份有限公司 Visual multidimensional data display system and method based on semantic recognition
CN112463954B (en) * 2020-11-11 2024-01-02 远光软件股份有限公司 Visual multidimensional data display system and method based on semantic recognition
CN114913268A (en) * 2022-05-24 2022-08-16 盐城金堤科技有限公司 Method, device and storage medium for regional color display of chart

Also Published As

Publication number Publication date
CN110825472B (en) 2023-12-29

Similar Documents

Publication Publication Date Title
CN108228169B (en) Chart making method, device, equipment and medium based on eCharts tool
CN106933889B (en) Configuration method, display method and client for screened rules
CN107451109B (en) Report generation method and system
CN111611036A (en) Application menu configuration method and device, electronic equipment and storage medium
US11238632B2 (en) Interface to index and display geospatial data
US20140331179A1 (en) Automated Presentation of Visualized Data
EP3328041A1 (en) Clothes matching recommendation method and smart terminal
CN110825472A (en) Chart color drawing method and device, readable storage medium and electronic equipment
US20190005156A1 (en) Data flow visualization system
US9015591B2 (en) Dynamic visualization generation and implementation
JP2017526058A (en) Information search method and information search apparatus
WO2019052115A1 (en) Application control style customization method and apparatus, and computer-readable storage medium
CN102622233A (en) System and method for automatically generating user interface applicable to certain interactive terminal equipment
JP6872047B2 (en) Methods, devices, devices, and storage media that provide a visual representation of an object set.
CN111198908B (en) Display method and device of power grid asset graph, storage medium and terminal
JP2018106556A5 (en)
US10430987B1 (en) Annotating an image with a texture fill
US9239669B2 (en) Common user interface view grouping and sharing framework in online applications
CN108804437B (en) Data display method and device, computer readable storage medium and electronic equipment
CN107404427A (en) One kind chat background display method and device
KR101422180B1 (en) Method of measuring application usability, server performing the same and storage media storing the same
CN110888787A (en) Data monitoring method, device and system
US20160085517A1 (en) Program information generating system, program information generating method, and computer program product
CN115794245B (en) Data loading method and device, electronic equipment and storage medium
CN115687288A (en) Information display method and corresponding equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant