A method, device and electronic device for generating a chart

By presetting models of multiple analysis dimensions and matching them with the fields of the data source, the graph is generated, and it solves the problem that users find it difficult to determine the data analysis dimensions and chart forms, and efficient chart generation and analysis solution selection is achieved.

CN113807066BActive Publication Date: 2025-02-11NEUSOFT CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111087111.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2025-02-11
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

In the prior art, the production of charts usually depends on the user's business needs, making it difficult for users to determine the data analysis dimensions and chart forms, which in turn increases the difficulty and inefficiency of chart generation.

Method used

By presetting multiple models, each model represents an analysis dimension, the fields of the read data source match the preset model. If there is an association relationship between the matching fields, a chart is generated based on the data and model configuration information of these fields.

Benefits of technology

It realizes automated chart generation, provides charts with multiple analysis dimensions for users to choose, shortens the chart generation cycle, improves efficiency, and helps users quickly select appropriate analysis solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113807066B_ABST
    Figure CN113807066B_ABST
Patent Text Reader

Abstract

The present invention discloses a chart generation method, device and electronic device, the method comprising: presetting a plurality of different models, each preset model representing an analysis dimension, matching the first field of the data source with the preset model by reading the first field in the data source; when a plurality of first target fields matching the target model are detected, and the plurality of first target fields are associated, generating a chart based on the configuration information of the model and the data of the first target field. Thus, the fields in the data source can be automatically matched with the model, and a chart can be generated, thereby providing a valuable reference for users to select a suitable chart analysis solution, so that customers can quickly select a suitable chart, thereby shortening the chart generation cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a chart generating method, device and electronic equipment. Background Art

[0002] In the existing data analysis system, the analysis results are presented in a variety of charts, which can accurately display the qualitative and quantitative analysis results of the data. Through the display of charts, the past data situation, the current data situation, and the prediction of future development trends can be intuitively displayed, which helps the decision-makers better understand the current situation and make predictions and decisions for the future.

[0003] However, in the prior art, the production of charts is usually determined according to business needs. Users select the chart format according to business needs and produce charts based on the data provided by the users. However, in most cases, users are not sure what kind of analysis to perform on the data or what form of chart to use to present it. This makes data analysis and chart production very difficult, and it is difficult to meet user needs. In order to meet user needs, the generated charts may be constantly adjusted, which is not only labor-intensive but also extremely inefficient. Summary of the invention

[0004] In view of this, the embodiments of the present invention disclose a chart generation method, device and electronic device, which can automatically provide users with charts of multiple analysis dimensions for users to choose from, so that customers can quickly select a suitable analysis solution, thereby shortening the chart generation cycle and improving efficiency.

[0005] The embodiment of the present invention discloses a method for generating a chart, comprising:

[0006] Read the first field of the data source;

[0007] Detecting whether there are multiple first target fields matching the target model; each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields;

[0008] If there are multiple first target fields matching the target model in the first field, and there is an association relationship between the multiple first target fields, a chart is generated based on the data of the multiple first target fields and the configuration information of the target model.

[0009] Optionally, the detecting whether there are multiple first target fields matching the target model includes:

[0010] Get a second field group for each model; the second field group includes multiple second fields;

[0011] Traverse the first field of the data source and detect whether there are multiple first fields that match the second field group of any model;

[0012] If it is detected that the plurality of first target fields match the second field group of the target model, it means that the plurality of first target fields match the target model.

[0013] Optionally, generating a chart based on the data of the plurality of first target fields and the configuration information of the target model includes:

[0014] Based on the matching relationship between the first target field and the second target field of the target model, establishing a corresponding relationship between the data of the first target field and the second target field;

[0015] Retrieve data of the first target field;

[0016] A chart is generated based on the data of the first target field, the corresponding relationship between the data of the first target field and the second target field, and the configuration information of the target model.

[0017] Optionally, also include:

[0018] In response to the chart adjustment instruction, parsing the adjustment instruction to obtain adjustment information;

[0019] The chart is adjusted according to the adjustment information.

[0020] Optionally, also include:

[0021] Obtain label information of models corresponding to a plurality of target charts; the target chart is any one of the charts;

[0022] Group charts with the same label information into one atlas.

[0023] The embodiment of the present invention discloses a chart generating device, comprising:

[0024] A reading unit, used for reading a first field of a data source;

[0025] A matching unit, used to detect whether there are multiple first target fields matching the target model; each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields;

[0026] A chart generating unit is used to generate a chart based on data of the multiple first target fields and configuration information of the target model if there are multiple first target fields matching the target model in the first field and there is an association relationship between the multiple first target fields.

[0027] Optionally, the matching unit includes:

[0028] An acquisition subunit, used for acquiring a second field group of each model; the second field group includes a plurality of second fields;

[0029] A detection subunit, used for traversing the first fields of the data source and detecting whether there are multiple first fields matching the second field group of any model;

[0030] The matching subunit is used for, if it is detected that the plurality of first target fields match the second field group of the target model, indicating that the plurality of first target fields match the target model.

[0031] Optionally, the chart generating unit includes:

[0032] a relationship establishing subunit, configured to establish a corresponding relationship between the data of the first target field and the second target field based on a matching relationship between the first target field and the second target field of the target model;

[0033] A calling subunit, used for calling data of the first target field;

[0034] The chart generating subunit is used to generate a chart based on the data of the first target field, the corresponding relationship between the data of the first target field and the second target field, and the configuration information of the target model.

[0035] Optionally, also include:

[0036] The chart adjustment subunit is used to:

[0037] In response to the chart adjustment instruction, parsing the adjustment instruction to obtain adjustment information;

[0038] Adjust the chart according to the adjustment information

[0039] An embodiment of the present invention discloses an electronic device, including:

[0040] Memory and processor;

[0041] The memory is used to store programs, and the processor is used to execute the above-mentioned chart generation method when executing the programs in the memory.

[0042] The embodiment of the present invention discloses a chart generation method, device and electronic device, the method comprising: presetting a plurality of different models, each preset model representing an analysis dimension, matching the first field of the data source with the preset model by reading the first field in the data source; when a plurality of first target fields matching the target model are detected, and the plurality of first target fields are associated, generating a chart based on the configuration information of the model and the data of the first target field. Thus, the fields in the data source can be automatically matched with the model, and a chart can be generated, thereby providing a valuable reference for users to select a suitable chart analysis solution, so that customers can quickly select a suitable chart, thereby shortening the chart generation cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0044] Figure 1 A schematic diagram showing a flow chart of a method for generating a chart provided in Embodiment 1 of the present invention is shown;

[0045] Figure 2 A schematic diagram showing a flow chart of a method for generating a chart provided in Embodiment 2 of the present invention is shown;

[0046] Figure 3 Another schematic diagram of a flow chart generation method provided by Embodiment 3 of the present invention is shown;

[0047] Figure 4 A schematic diagram of the structure of a chart generating device provided by an embodiment of the present invention is shown;

[0048] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Currently, users need to select the chart format according to business needs and create charts based on the data provided by the users. However, in most cases, users are unable to determine what kind of analysis to perform on the data, nor what form of chart to use to present it. This makes chart creation very difficult and it is difficult to meet user needs. In addition, in order to meet user needs as much as possible, charts may need to be constantly adjusted, which is not only labor-intensive but also extremely inefficient.

[0051] In order to solve the above problems, multiple models are pre-built in this embodiment, and each preset model represents an analysis dimension. When a chart needs to be generated, the first field of the data source is read, and the first field of the data source is matched with the preset model. If there are multiple first target fields matching the target model in the first field, and there is an association relationship between the multiple first target fields, a chart is generated based on the data of the multiple first target fields and the configuration information of the target model; wherein each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one or more of the first fields. Therefore, based on the preset model, different fields in the data source can be combined to generate charts of different analysis dimensions, thereby providing users with a variety of chart presentation forms, so that customers can quickly select suitable charts, thereby shortening the chart generation cycle.

[0052] The following is a detailed introduction to the method of generating the chart:

[0053] Example 1

[0054] refer to Figure 1 , shows a schematic flow chart of a chart generation method provided by Embodiment 1 of the present invention. In this embodiment, the method includes:

[0055] S101: Read the first field of the data source;

[0056] In this embodiment, the data source includes data that needs to be analyzed, and the data source includes: fields and data, and the field represents the type of data, and the field includes, for example: income, time, department, etc. For ease of distinction, in this embodiment, the fields in the data source are represented by the first field, and the first field is all the fields in the data source. S102: Detect whether there are multiple first target fields that match the target model; each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields;

[0057] In this embodiment, different types of models are preset, and each model represents a different analysis dimension, for example, including: income analysis dimension, personnel flow analysis dimension, etc.

[0058] Moreover, the fields included in different types of models are not exactly the same. For example, the model of the income analysis dimension includes fields such as income and time; the fields included in the personnel flow analysis dimension include fields such as the number of personnel and time.

[0059] Optionally, the model generation process includes:

[0060] Acquire data of charts of different analysis dimensions, perform semantic analysis on the data of charts of different analysis dimensions, and obtain description information of charts of different analysis dimensions;

[0061] The description information of the charts of different analysis dimensions is segmented to obtain the second field of each model, and the configuration information of the model is set based on the description information of the charts of different analysis dimensions.

[0062] Among them, the data of charts of different analysis dimensions can be crawled from data classification websites. The descriptive information of the charts is obtained by performing semantic analysis on the data of charts of different analysis dimensions, for example, including: year-on-year analysis of the company's revenue, profit share of each department, profit ranking of each part of the company, etc.

[0063] In this embodiment, the second field obtained after word segmentation processing is information related to data, and the configuration information is information related to generating a chart.

[0064] The configuration information may include: analysis method and chart type.

[0065] For example: the description information of the chart is the year-on-year analysis of the company's annual revenue. The fields obtained after splitting include, for example: year, company revenue, year-on-year, analysis. Among them, the second field corresponding to each year can be time, the dimension is year, and the second field corresponding to the company's revenue is revenue. This model is used to perform year-on-year analysis on the annual revenue. Then the configuration information can be an advanced aggregation calculation for year-on-year analysis. In addition, the configuration information can also include chart types: bar chart or line chart.

[0066] In this embodiment, it can be known from the above introduction that the data source includes multiple fields, and the fields in the data source are represented as first fields. When detecting whether there are multiple first target fields matching the target model, all fields in the data source are traversed to detect whether there is a first target field matching a preset model. Optionally, the following two methods can be included to detect whether there are multiple first target fields matching the model:

[0067] Implementation method 1:

[0068] Get a second field group of each model; the second field group includes multiple second fields;

[0069] Traverse the first field of the data source and detect whether there are multiple first fields that match the second field group of any model;

[0070] If it is detected that the plurality of first target fields match the second field group of the target model, it means that the plurality of first target fields match the target model.

[0071] For example: Assume that the second field group in the company's annual revenue year-on-year analysis model includes: revenue field and time field, and the first field in the data source includes many. When it is detected that there are revenue fields and time fields in the data source, it means that there is a first field that matches the revenue analysis model.

[0072] In this embodiment, the matching of the first field in the data source and the second field in the model can be understood as that if the meaning represented by the first field and the meaning represented by the second field are the same, then they are considered to be matched.

[0073] In this embodiment, when detecting whether there is a first field that matches the second field group of the model, a preset semantic analysis model can be used to detect whether the first field matches the second field in the second field group of the model.

[0074] The semantic analysis model may be pre-trained, with some fields that may be used to construct a chart as training samples, and the semantic analysis model to be trained is trained with the purpose of outputting results close to standard classification results.

[0075] For example: if the first field is year, and the second field of a preset model is time, where the attribute of year is time, the semantic analysis model can determine that year and time belong to the same category, which means that the first field and the second field match.

[0076] Furthermore, in order to obtain a more accurate matching result, when the semantic analysis model is used to detect whether the first field matches the fields in the second field group, the annotation of the first field may be used for determination.

[0077] For example, the first field is: revenue (annotated as profit). Therefore, when checking whether the first field and the second field match, you can use "revenue" to match and verify with the second field of each preset model, or you can use the annotation "profit" of the first field to assist in matching and verifying.

[0078] Implementation method 2:

[0079] From the above introduction, we can know that each model represents a different analysis dimension, so the label description information can be expressed as a description of different analysis dimensions. The field information of the data source and the label description information of the model are analyzed through the semantic analysis model to determine whether the first field matches the label description information.

[0080] S103: If there are multiple first target fields in the first field that match the target model, and there is an association relationship between the multiple first target fields, generate a chart based on the data of the multiple first target fields and the configuration information of the target model.

[0081] In this embodiment, the conditions for generating a chart based on a preset model include:

[0082] Condition 1: There are multiple first target fields in the data source that match the model;

[0083] Condition 2: There is an association relationship between multiple first target fields that match the model.

[0084] In this embodiment, there are multiple methods for detecting whether there is an association relationship between multiple first target fields that match the model, for example, it can be determined based on the relationship between the fields in the data source or the relationship between the data tables to which the fields belong. Among them, when the fields in the same data table in the data source are represented as fields with an association relationship, or the fields contained in the data table with an association relationship are fields with an association relationship.

[0085] When the above two conditions are met, a chart can be generated based on the data of the first target field and the configuration information of the target model.

[0086] In this embodiment, the configuration information of the target model represents relevant information for generating a chart, including an analysis method of the chart, a chart type, and the like.

[0087] In one implementation, generating a chart includes:

[0088] Based on the matching relationship between the first target field and the second target field of the target model, establishing a corresponding relationship between the data of the first target field and the second target field;

[0089] Retrieve data of the first target field;

[0090] A chart is generated based on the data of the first target field, the corresponding relationship between the data of the first target field and the second target field, and the configuration information of the target model.

[0091] In this embodiment, the corresponding relationship between the data of the first target field and the second target field is established, which is represented by binding the data of the first target field with the second target field. For example, the address of the first target field can be bound to the second target field.

[0092] In this embodiment, each model can be presented in the form of any chart. In the absence of human intervention, a default chart type can be preset, and the default chart type can be any one or more chart types, or an optimal chart type. That is, the configuration information of the target model includes information of one or more preset charts.

[0093] In this embodiment, from the above introduction, it can be known that the target model is one or more of the preset models, so the generated chart can be generated based on at least one model. When a chart is generated based on each model, each model includes at least one form of chart. When the configuration information includes information of at least one chart, then when a chart is generated based on a model, at least one chart can be generated.

[0094] For example: when a chart needs to be generated, the first field in the data source is read. If the first field in the data source includes: company revenue, year, expenditure, cost, etc., the field in the data source is matched with the second field group of the preset model. If the first model (represented as the revenue analysis dimension) contains the fields of revenue and time, then the "company revenue" and "revenue" of the first field are considered to be matched, and the "year" of the first field and the "time" of the second field are matched, which means that there is a first field matching the model in the data source. The chart is generated by the configuration information of the model representing the revenue analysis dimension and the data of the "company revenue" field and the "revenue" field. If the second field contained in the second model is "expenditure" and "time", then the "year" of the first field in the data source matches the "time" of the second field, and the "expenditure" of the first field in the data source matches the "expenditure" of the second field, then the chart can be generated based on the data of the "year" and "expenditure" fields of the first field and the configuration information of the second field.

[0095] In this embodiment, a variety of different models are preset, each preset model represents an analysis dimension, and the first field of the data source is matched with the preset model by reading the first field in the data source; when multiple first target fields matching the target model are detected, and the multiple first target fields are associated, a chart is generated based on the configuration information of the model and the data of the first target field. Thus, the fields in the data source can be automatically matched with the model and a chart is generated, which provides a valuable reference for users to select a suitable chart analysis solution, so that customers can quickly select a suitable chart, thereby shortening the chart generation cycle.

[0096] Example 2

[0097] Due to different user needs, the automatically generated charts may not directly meet the user's satisfaction. In order to obtain an analysis solution that better meets the user's needs, the user can make adjustments based on the generated charts. For details, refer to Figure 2 , shows a flow chart of a method for generating a chart provided by Embodiment 2 of the present invention. In this embodiment, the method includes:

[0098] S201: Read the first field of the data source;

[0099] In this embodiment, S201 is consistent with the above-mentioned S101 and will not be described in detail in this embodiment.

[0100] S202: Detect whether there are multiple first target fields matching the target model; each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields;

[0101] In this embodiment, S202 is consistent with the above-mentioned S102 and will not be described in detail in this embodiment.

[0102] S203: If there are multiple first target fields in the first field that match the target model, and there is an association relationship between the multiple first target fields, generate a chart based on the data of the multiple first target fields and the configuration information of the target model.

[0103] In this embodiment, S203 is consistent with the above S103 and will not be described in detail in this embodiment.

[0104] S204: In response to the chart adjustment instruction, parsing the adjustment instruction to obtain adjustment information;

[0105] In this embodiment, the chart adjustment instruction is triggered by the user and is used to instruct the execution of the chart adjustment operation.

[0106] In this embodiment, the chart adjustment instructions include multiple types, such as modifying the second field name, setting the analysis dimension, and changing the chart type. Each different chart adjustment instruction includes different adjustment information.

[0107] For example: when the adjustment instruction is to modify the name of the second field, the adjustment information includes: the second field name before adjustment and the second field name after adjustment; when the adjustment instruction is to modify the analysis dimension, the adjustment information includes: the analysis method and the second field name; when the adjustment instruction is to change the chart type, the adjustment information includes: the chart type after change.

[0108] Furthermore, in order to facilitate user operation, a visual adjustment interface is provided, and the user can select an item to be adjusted and set adjustment information of the item to be adjusted.

[0109] S205: Adjust the chart according to the adjustment information.

[0110] In this embodiment, the chart adjustment operation is performed through the adjustment information to achieve adjustment of the generated chart.

[0111] For example: when matching the first field of the data source and the model, due to the difference between the first field name in the data source and the second field name in the model, there may be an error in the matching. The user can replace the fields and data in the chart by correcting the fields. Or when the second field provided in the model does not meet the requirements, the second field provided by the model can also be modified; or when the user determines the data analysis method through the generated chart, but the analysis method does not exist in the model, the analysis dimension of the chart can also be modified to modify the generated chart.

[0112] For example: when a chart needs to be generated, the first field in the data source is read. If the first field in the data source includes: company revenue, year, expenditure, cost, etc., the field in the data source is matched with the second field group of the preset model. If a model (represented as the revenue analysis dimension) contains the fields of revenue and time, then the "company revenue" and "revenue" of the first field are considered to be matched, and the "year" of the first field and the "time" of the second field are matched, which means that there is a first field matching the model in the data source. The chart is generated by the configuration information of the model representing the revenue analysis dimension and the data of the "company revenue" field and the "revenue" field. However, the generated chart may not meet the user's needs, so the user can adjust the generated chart, for example, the adjustment instruction is to modify the chart type, and the currently generated chart type can be replaced with the chart type selected by the user. Or if the user thinks that the result of the semantic analysis is inaccurate and needs to replace the data of a certain field, the data of each field in the model can be reset.

[0113] In this embodiment, when the automatically generated chart cannot meet the user's needs, the user can adjust the generated chart according to the needs, so as to obtain a chart that matches the user's needs.

[0114] Example 3

[0115] Furthermore, after the chart is created, in order to more clearly and systematically reflect the analysis results of the data source, it is necessary to summarize the generated charts. For details, refer to Figure 3, shows another flow chart of a method for generating a chart provided by an embodiment of the present invention. In this embodiment, the method includes:

[0116] S301: Read the first field of the data source;

[0117] In this embodiment, S301 is consistent with the above-mentioned S101 and will not be described in detail in this embodiment.

[0118] S302: Detect whether there are multiple first target fields matching the target model; each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields;

[0119] In this embodiment, S302 is consistent with the above-mentioned S102 and will not be described in detail in this embodiment.

[0120] S303: If there are multiple first target fields in the first field that match the target model, and there is an association relationship between the multiple first target fields, generate a chart based on the data of the multiple first target fields and the configuration information of the target model.

[0121] In this embodiment, S303 is consistent with the above S303 and will not be described in detail in this embodiment.

[0122] S304: Obtain label information of models corresponding to a plurality of target charts; the target chart is any one of the charts;

[0123] S305: Combine the charts with the same label information into one album.

[0124] In this embodiment, each model is pre-set with label information, and the label information is used to indicate the type of model analysis, such as related to the company's profit and revenue, related to the company's personnel turnover, etc.

[0125] Among them, the label of each model is pre-set.

[0126] In this embodiment, the multiple target charts mentioned in the above S304 may be all generated charts, or may be multiple charts selected by the user from the generated charts.

[0127] In addition, when the charts with the same label information are combined into an album, the layout of the album can be pre-set, random, or a layout selected by the user in the preset layout. Moreover, before executing S304, the generated chart can also be adjusted based on user needs.

[0128] In this embodiment, by combining the generated charts into an atlas, the analysis of the data can be presented more clearly.

[0129] Example 4

[0130] refer to Figure 4 , shows a schematic diagram of the structure of a chart generating device provided by an embodiment of the present invention. In this embodiment, the device includes:

[0131] A reading unit 401 is used to read a first field of a data source;

[0132] A matching unit 402 is used to detect whether there are multiple first target fields that match the target model; each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields;

[0133] The chart generating unit 403 is used to generate a chart based on the data of the multiple first target fields and the configuration information of the target model if there are multiple first target fields matching the target model in the first field and there is an association relationship between the multiple first target fields.

[0134] Optionally, the matching unit includes:

[0135] An acquisition subunit, used for acquiring a second field group of each model; the second field group includes a plurality of second fields;

[0136] A detection subunit, used for traversing the first fields of the data source and detecting whether there are multiple first fields matching the second field group of any model;

[0137] The matching subunit is used for, if it is detected that the plurality of first target fields match the second field group of the target model, indicating that the plurality of first target fields match the target model.

[0138] Optionally, the chart generating unit includes:

[0139] a relationship establishing subunit, configured to establish a corresponding relationship between the data of the first target field and the second target field based on a matching relationship between the first target field and the second target field of the target model;

[0140] A calling subunit, used for calling data of the first target field;

[0141] The chart generating subunit is used to generate a chart based on the data of the first target field, the corresponding relationship between the data of the first target field and the second target field, and the configuration information of the target model.

[0142] Optionally, also include:

[0143] The chart adjustment subunit is used to:

[0144] In response to the chart adjustment instruction, parsing the adjustment instruction to obtain adjustment information;

[0145] The chart is adjusted according to the adjustment information.

[0146] By reading the first field in the data source, the first field of the data source is matched with the preset model; each model represents an analysis dimension, and when multiple first target fields matching the model are detected, and the multiple first target fields are associated, it means that the data in the data source can be adapted to the model of an analysis dimension, and a chart is generated based on the configuration information of the model and the data of the first target field. In this way, the model can be automatically matched based on the fields in the data source, and a chart can be generated, which provides a valuable reference for users to select a suitable analysis plan, so that customers can quickly select a suitable analysis plan, thereby shortening the chart generation cycle.

[0147] Example 5

[0148] refer to Figure 5 , shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. In this embodiment, the electronic device includes:

[0149] Memory 501 and processor 502;

[0150] The memory 501 is used to store programs, and the processor 502 is used to execute the following chart generation method when executing the program in the memory:

[0151] Read the first field of the data source;

[0152] Detecting whether there are multiple first target fields matching the target model; each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields;

[0153] If there are multiple first target fields matching the target model in the first field, and there is an association relationship between the multiple first target fields, a chart is generated based on the data of the multiple first target fields and the configuration information of the target model.

[0154] Optionally, the detecting whether there are multiple first target fields matching the target model includes:

[0155] Get a second field group of each model; the second field group includes multiple second fields;

[0156] Checks whether there are multiple first fields that match the second field group of any model.

[0157] Optionally, generating a chart based on the data of the plurality of first target fields and the configuration information of the target model includes:

[0158] Based on the matching relationship between the first target field and the second target field of the target model, establishing a corresponding relationship between the data of the first target field and the second target field;

[0159] Retrieve data of the first target field;

[0160] A chart is generated based on the data of the first target field, the corresponding relationship between the data of the first target field and the second target field, and the configuration information of the target model.

[0161] Optionally, also include:

[0162] In response to the chart adjustment instruction, parsing the adjustment instruction to obtain adjustment information;

[0163] The chart is adjusted according to the adjustment information.

[0164] Optionally, also include:

[0165] Obtain label information of models corresponding to a plurality of target charts; the target chart is any one of the charts;

[0166] Group charts with the same label information into one atlas.

[0167] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0168] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating a chart, characterized in that: include: Read the first field of the data source; detecting whether there are multiple first target fields matching the target model; Each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields; If there are multiple first target fields matching the target model in the first field, and there is an association relationship between the multiple first target fields, generating a chart based on the data of the multiple first target fields and the configuration information of the target model; The generating a chart based on the data of the plurality of first target fields and the configuration information of the target model comprises: Based on the matching relationship between the first target field and the second target field of the target model, establishing a corresponding relationship between the data of the first target field and the second target field; Retrieve data of the first target field; A chart is generated based on the data of the first target field, the corresponding relationship between the data of the first target field and the second target field, and the configuration information of the target model.

2. The method according to claim 1, characterized in that The detecting whether there are multiple first target fields matching the target model includes: Get a second field group for each model; the second field group includes multiple second fields; Traverse the first field of the data source and detect whether there are multiple first fields that match the second field group of any model; If it is detected that the plurality of first target fields match the second field group of the target model, it means that the plurality of first target fields match the target model.

3. The method according to claim 1, characterized in that Also includes: In response to the chart adjustment instruction, parsing the adjustment instruction to obtain adjustment information; The chart is adjusted according to the adjustment information.

4. The method according to claim 1, characterized in that: Also includes: Obtain label information of models corresponding to a plurality of target charts; the target chart is any one of the charts; Group charts with the same label information into one atlas.

5. A chart generating device, characterized in that: include: A reading unit, used for reading a first field of a data source; A matching unit, used for detecting whether there are multiple first target fields matching the target model; Each preset model represents an analysis dimension, the target model is any one or more of the preset models, and the first target field is any one of the first fields; a chart generating unit, configured to generate a chart based on data of the plurality of first target fields and configuration information of the target model if there are a plurality of first target fields matching the target model in the first field and there is an association relationship between the plurality of first target fields; The chart generating unit comprises: a relationship establishing subunit, configured to establish a corresponding relationship between the data of the first target field and the second target field based on a matching relationship between the first target field and the second target field of the target model; A calling subunit, used for calling data of the first target field; The chart generating subunit is used to generate a chart based on the data of the first target field, the corresponding relationship between the data of the first target field and the second target field, and the configuration information of the target model.

6. The device according to claim 5, characterized in that The matching unit comprises: An acquisition subunit, used for acquiring a second field group of each model; the second field group includes a plurality of second fields; A detection subunit, used for traversing the first fields of the data source and detecting whether there are multiple first fields matching the second field group of any model; The matching subunit is used for, if it is detected that the plurality of first target fields match the second field group of the target model, indicating that the plurality of first target fields match the target model.

7. The device according to claim 5, characterized in that Also includes: The chart adjustment subunit is used to: In response to the chart adjustment instruction, parsing the adjustment instruction to obtain adjustment information; The chart is adjusted according to the adjustment information.

8. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs, and the processor is used to execute the chart generating method described in any one of claims 1 to 4 when executing the programs in the memory.

Citation Information

Patent Citations

  • Case information processing method and device, computer equipment and storage medium

    CN110377631A

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

    CN110825472A