CN112686015A - Chart generation method, device, equipment and storage medium - Google Patents

Chart generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN112686015A
CN112686015A CN202011578006.9A CN202011578006A CN112686015A CN 112686015 A CN112686015 A CN 112686015A CN 202011578006 A CN202011578006 A CN 202011578006A CN 112686015 A CN112686015 A CN 112686015A
Authority
CN
China
Prior art keywords
chart
data
picture
user
data sheet
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.)
Pending
Application number
CN202011578006.9A
Other languages
Chinese (zh)
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011578006.9A priority Critical patent/CN112686015A/en
Publication of CN112686015A publication Critical patent/CN112686015A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention relates to the field of data processing, and discloses a chart generation method, a device, equipment and a storage medium, which are used for automatically generating a chart picture according to data input by a user. The chart generation method comprises the following steps: acquiring a chart type to be generated and a chart file format; generating a corresponding chart data sheet according to the chart type, and pushing the chart data sheet to a user for filling; extracting the filled chart data sheet to obtain chart data; inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture; and converting the format of the chart picture according to the format of the chart file to generate the chart file. According to the chart generation method, the chart file is generated by the headless browser through the server, the generation speed is high, the generated chart file can be directly used, and the method is simple and convenient. In addition, the invention also relates to a block chain technology, and the chart related data information can be stored in the block chain.

Description

Chart generation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, an apparatus, a device, and a storage medium for generating a graph.
Background
In life and work, visual conversion of data is often needed, for example, when a report is made, the distribution rule and the change rule of the data can be mastered quickly by using a chart, so that the data can be embodied more intuitively and clearly.
In the prior art, most chart generation methods adopt front-end rendering and drawing, and the processing speed of the front end is limited, so that the chart generation speed is low, and the use experience is influenced; secondly, the chart that generates when drawing is rendered with the front end mostly shows on the page in the module form, can not directly generate the file of chart, still need to use after screenshot or other secondary treatment, and it is comparatively loaded down with trivial details convenient not enough in the use.
Disclosure of Invention
The invention mainly aims to solve the problems that the chart generation method in the prior art is low in chart generation speed, cannot directly generate a chart file and is not convenient to use.
The invention provides a chart generation method in a first aspect, which comprises the following steps:
acquiring a chart type to be generated and a chart file format;
generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and obtaining the filled chart data sheet;
performing data extraction on the filled chart data sheet to obtain chart data;
inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture;
and converting the format of the chart picture according to the format of the chart file to generate a chart file, and returning the chart file to the user.
Optionally, in a first implementation manner of the first aspect of the present invention, the obtaining a chart type and a chart file format to be generated includes:
acquiring a chart type selection result of a user on a chart type to be selected displayed on a client page, and acquiring the chart type to be generated according to the chart type selection result;
the method comprises the steps of obtaining input content of a user or a chart file format selection result of a chart file format to be selected displayed on a client page by the user, and obtaining the chart file format to be generated according to the input content or the chart file format selection result.
Optionally, in a second implementation manner of the first aspect of the present invention, the performing data extraction on the filled-in chart data sheet to obtain chart data includes:
format verification is carried out on the information in the filled chart data sheet, and a verification chart data sheet is output after the format verification is passed;
carrying out item identification on information in the check chart data sheet to obtain a data item;
and extracting project parameters corresponding to the data projects in the verification chart data sheet to obtain chart data.
Optionally, in a third implementation manner of the first aspect of the present invention, before the obtaining the type of the chart to be generated and the format of the chart file, the method further includes:
collecting various chart types;
collecting required chart materials according to the chart types, and carrying out labeling and classification on the chart materials to obtain material classification;
and classifying the chart materials into a chart template according to the materials, and establishing a mapping relation between the chart type and the chart template.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture includes:
determining a target template according to the mapping relation between the chart type and the chart template;
and rendering the chart according to the chart data by using the headless browser according to the target template to obtain a chart picture.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the inputting the chart data into a preset headless browser, and performing chart rendering by using the chart material according to the target template to obtain a chart picture includes:
calculating the display state of the chart materials in the target template according to the chart data, wherein the display state comprises the geometric dimensions of the chart materials;
and performing chart rendering according to the display state to obtain a chart picture.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the inputting the chart data into a preset headless browser, and performing chart rendering by using the chart material according to the target template to obtain a chart picture further includes:
acquiring additional content input by a user, wherein the additional content comprises a chart background picture and/or a watermark picture;
performing picture processing operation on the additional content to obtain processed additional content, wherein the picture processing operation comprises size adjustment, color change and transparency change;
and rendering the processing additional content into the chart picture to obtain the chart picture with the additional content.
A second aspect of the present invention provides a chart generating apparatus, including:
the acquisition module is used for acquiring the type and the file format of the chart to be generated;
the data sheet generation module is used for generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and obtaining the filled chart data sheet;
the data extraction module is used for extracting data of the filled chart data sheet to obtain chart data;
the rendering module is used for inputting the chart data into a preset headless browser and rendering the chart according to the chart type through the headless browser to obtain a chart picture;
and the chart generation module is used for carrying out format conversion on the chart picture according to the chart file format to generate a chart file and returning the chart file to the user.
Optionally, in a first implementation manner of the second aspect of the present invention, the obtaining module includes:
the type obtaining unit is used for obtaining a chart type selection result of a chart type to be selected displayed on a client page by a user and obtaining the chart type to be generated according to the chart type selection result;
the format obtaining unit is used for obtaining input content of a user or a chart file format selection result of a chart file format to be selected displayed on a client page by the user, and obtaining the chart file format to be generated according to the input content or the chart file format selection result.
Optionally, in a second implementation manner of the second aspect of the present invention, the data extraction module includes:
the verification unit is used for carrying out format verification on the information in the filled chart data sheet and outputting a verification chart data sheet after the format verification is passed;
the data extraction unit is used for carrying out item identification on the information in the check chart data sheet to obtain a data item; and extracting project parameters corresponding to the data projects in the verification chart data sheet to obtain chart data.
Optionally, in a third implementation manner of the second aspect of the present invention, the chart generating apparatus further includes:
the chart material collecting module is used for collecting various chart types;
the material classification module is used for collecting required chart materials according to the chart types and labeling and classifying the chart materials to obtain material classifications;
and the chart template establishing module is used for classifying the chart materials into chart templates according to the materials and establishing the mapping relation between the chart types and the chart templates.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the rendering module includes:
the template selection unit is used for determining a target template according to the mapping relation between the chart type and the chart template;
and the picture rendering unit is used for inputting the chart data into a preset headless browser and utilizing the chart materials to perform chart rendering according to the target template to obtain a chart picture.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the picture rendering unit includes:
the display calculation subunit is used for calculating the display state of the chart materials in the target template according to the chart data, wherein the display state comprises the geometric dimensions of the chart materials;
and the picture rendering subunit is used for performing chart rendering according to the display state to obtain a chart picture.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the picture rendering unit further includes:
the device comprises an additional content acquisition subunit, a watermark extraction subunit and a watermark extraction subunit, wherein the additional content acquisition subunit is used for acquiring additional content input by a user, and the additional content comprises a chart background picture and/or a watermark picture;
the additional content processing subunit is used for carrying out picture processing operation on the additional content to obtain processed additional content, wherein the picture processing operation comprises size adjustment, color change and transparency change;
and the additional content rendering subunit is used for rendering the processing additional content into the chart picture to obtain the chart picture with the additional content.
A third aspect of the present invention provides a chart generating apparatus, comprising: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the chart generation apparatus to perform the steps of the chart generation method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the chart generation method described above.
According to the technical scheme provided by the invention, the type and the file format of the chart to be generated are obtained; generating a corresponding chart data sheet according to the chart type, and pushing the chart data sheet to a user for filling; extracting the filled chart data sheet to obtain chart data; inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture; and converting the format of the chart picture according to the format of the chart file to generate a chart file, and returning the chart file to the user. In the embodiment of the invention, the chart file is generated by the headless browser through the server, the generating speed is high, the generated chart file can be directly used, and the operation is simple and convenient.
Drawings
FIG. 1 is a diagram of an embodiment of a chart generation method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of another embodiment of a chart generation method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of another embodiment of a chart generation method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of another embodiment of a chart generation method according to an embodiment of the invention;
FIG. 5 is a schematic diagram of an embodiment of a chart generation apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of another embodiment of a chart generation apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an embodiment of a chart generation apparatus in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a chart generation method, a device, equipment and a storage medium, wherein the chart generation method comprises the following steps: acquiring a chart type to be generated and a chart file format; generating a corresponding chart data sheet according to the chart type, and pushing the chart data sheet to a user for filling; extracting the filled chart data sheet to obtain chart data; inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture; and converting the format of the chart picture according to the format of the chart file to generate a chart file, and returning the chart file to the user. According to the chart generation method, the chart file is generated by the headless browser through the server, the generation speed is high, the generated chart file can be directly used, and the method is simple and convenient.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For understanding, a specific flow of an embodiment of the present invention is described below, and referring to fig. 1, an embodiment of a graph generating method according to an embodiment of the present invention includes:
101. acquiring a chart type to be generated and a chart file format;
it is to be understood that the executing entity of the present invention may be a graph generating apparatus, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
In the scheme, one or more chart types required to be made by a user are obtained firstly.
Specifically, names and example pictures of all charts are loaded from a preset chart library, and in the process of acquiring a specific chart type, a user can select rough classification of the chart type first, select according to the names of the large classes classified in advance, for example, select a general data processing class or a professional data processing class, and then select the chart type to be generated according to the example pictures provided in the scheme.
Secondly, the user can select a format of a chart file to be generated according to the use requirement, for example, under the general use condition, the user can select a picture in a JPEG (Joint Photographic Experts Group, which is a product of JPEG standard, the standard is formulated by the International organization for standardization (ISO), and is a compression standard facing continuous tone still images) format, and a picture in a PNG (Portable Network Graphics) format can be selected when the blank part of the picture needs to be transparently processed; if a dynamic graph is generated, a file Format of a dynamic picture such as GIF (Graphics Interchange Format) may be selected.
102. Generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and obtaining the filled chart data sheet;
firstly, generating a corresponding chart data sheet according to the chart type selected by a user. Because the required data of different chart types are different, different chart data sheets are set according to the chart types, and required filling items in the chart data sheets are determined by the chart types.
For example, when the user selects to generate the histogram, it is necessary to input information such as the content of the abscissa and the content of the ordinate, and the value of the ordinate corresponding to each item in the abscissa, according to the characteristics of the histogram. Therefore, when generating the corresponding chart data sheet, the chart data sheet needs to include the contents of the above-described items. When the user selects the chart type to be generated as the pie chart, the name and the quantity information of each item of content to be displayed in the pie chart are required to be input, and the filled chart data sheet is obtained after the required data content is filled.
In addition, the chart data sheet also comprises contents such as color information of the chart, and a user can select and fill in the preset color theme, so that the color matching chart according with psychological expectation can be obtained when the chart is rendered subsequently.
Furthermore, the chart data sheet can also adopt an automatic filling method; specifically, a table of the original data may be directly pasted in a designated position in the chart data sheet or a data file may be imported into the chart data sheet using an import function. And automatically identifying the pasted or imported data form according to a preset character identification algorithm and automatically filling the data form into the chart data sheet to generate the filled chart data sheet. When the data amount in the chart required to be generated by the user is large, the chart data sheet can be automatically filled in by the method for importing the data table, and the speed and the accuracy of chart generation can be greatly improved.
103. Performing data extraction on the filled chart data sheet to obtain chart data;
and carrying out format verification on the chart data sheet filled by the user, and checking whether the filled content conforms to the definition. If the graph data sheet does not accord with the definition, the part which does not accord with the definition is specially marked and then the graph data sheet is returned to the user for modification.
And after the filled chart data sheet is verified and the format meets the requirement, extracting the data in the filled chart data sheet to obtain chart data. At this time, a drawing request is sent to the background, and the chart data is simultaneously transmitted to the background.
104. Inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture;
after receiving the drawing request, the background starts a Headless Browser (header Browser) according to the obtained chart data, wherein the Headless Browser (header Browser) refers to a Browser without an operation Interface and is commonly used for automatic testing of a webpage, and various operation instructions, such as testing and screen capturing, can be automatically executed by using an Application Programming Interface (API).
In the proposal, after a drawing request is received, the chart data is input into a headless browser, a pre-collected chart template is loaded according to the chart type selected by a user, and a generated chart is rendered to obtain a rendered chart file.
According to the proposal, a headless browser is deployed at a background server, the content requested by a client is rendered according to a pre-written code, namely, a chart to be generated in the proposal is rendered, and rendered page data is sent to the client, so that rendering at the client is replaced, time required by rendering a page at the client for the first time can be saved, and the page generation speed is obviously improved.
105. And converting the format of the chart picture according to the format of the chart file to generate the chart file, and returning the chart file to the user.
And according to the picture format selected by the user, converting the format of the rendered chart picture in the previous step into a format specified by the user, generating a chart file, transmitting the chart file to a client used by the user, and directly using the chart file after the user directly performs operations such as copying, downloading and the like on the chart file.
In the embodiment of the invention, the chart file is generated by the headless browser through the server, the generating speed is high, the generated chart file can be directly used, and the operation is simple and convenient.
Referring to fig. 2, another embodiment of the graph generating method according to the embodiment of the present invention includes:
201. acquiring a chart type selection result of a user on a chart type to be selected displayed on a client page, and acquiring the chart type to be generated according to the chart type selection result;
the method comprises the steps of collecting various chart types in advance, generating various corresponding chart representation intentions and applicable scenes of the charts according to the chart types, displaying the diagrams of the various chart types and the scenes applicable to the chart types on a client page of a user in a classified mode for the user to select, and enabling the user to select the approximate type according to a scene index used by the chart types to ensure that the selected chart types can better display data required to be displayed; then, the type of the specific diagram required is intuitively selected according to the schematic diagram. And obtaining the type of the chart to be generated according to the chart type selection result of the user.
202. Acquiring input content of a user or a chart file format selection result of a chart file format to be selected displayed on a client page by the user, and acquiring a chart file format to be generated according to the input content or the chart file format selection result;
a user can input or select a format of a chart file to be generated according to use requirements, for example, under a general use condition, a picture in a JPEG (Joint Photographic Experts Group) format, which is a product of a JPEG standard, is formulated by international organization for standardization (ISO), and is a compression standard facing continuous tone still images, and a picture in a PNG (Portable Network Graphics) format, which needs a blank part of the picture to be transparently processed, can be selected; if a dynamic graph is generated, a file Format of a dynamic picture such as GIF (Graphics Interchange Format) may be selected.
203. Generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and obtaining the filled chart data sheet;
firstly, generating a corresponding chart data sheet according to the chart type selected by a user. Because the required data of different chart types are different, different chart data sheets are set according to the chart types, and required filling items in the chart data sheets are determined by the chart types.
For example, when the user selects to generate the histogram, it is necessary to input information such as the content of the abscissa and the content of the ordinate, and the value of the ordinate corresponding to each item in the abscissa, according to the characteristics of the histogram. Therefore, when generating the corresponding chart data sheet, the chart data sheet needs to include the contents of the above-described items. When the user selects the chart type to be generated as the pie chart, the name and the quantity information of each item of content to be displayed in the pie chart are required to be input, and the filled chart data sheet is obtained after the required data content is filled.
In addition, the chart data sheet also comprises contents such as color information of the chart, and a user can select and fill in the preset color theme, so that the color matching chart according with psychological expectation can be obtained when the chart is rendered subsequently.
Furthermore, the chart data sheet can also adopt an automatic filling method; specifically, a table of the original data may be directly pasted in a designated position in the chart data sheet or a data file may be imported into the chart data sheet using an import function. And automatically identifying the pasted or imported data form according to a preset character identification algorithm and automatically filling the data form into the chart data sheet to generate the filled chart data sheet. When the data amount in the chart required to be generated by the user is large, the chart data sheet can be automatically filled in by the method for importing the data table, and the speed and the accuracy of chart generation can be greatly improved.
204. Format verification is carried out on the information in the filled chart data sheet, and a verification chart data sheet is output after the format verification is passed;
and carrying out format verification on the filled chart data sheet, and checking whether the filled content conforms to the definition. Defining specific character types for each item of content in the chart data sheet, for example, the character types in the items in which numbers must be filled must have numbers, and checking whether the items are wrongly filled with characters; whether the mandatory item is empty, etc. If the content input by the user does not accord with the definition, the part which does not accord with the definition is specially marked, and the chart data sheet is returned to the user for modification. Similarly, if the function of automatically filling in the form content or the imported data file is adopted, the data format is also checked, and the part which does not meet the definition is specially marked and then the chart data sheet is returned to the user for modification.
And if the content in the filled chart data sheet conforms to the definition, passing format verification, and outputting a verification chart data sheet after the format verification passes.
205. Carrying out item identification on information in the check chart data sheet to obtain a data item; extracting project parameters corresponding to the data projects in the check chart data sheet to obtain chart data;
and performing item identification on information in the check chart data sheet to obtain a data item in the check chart data sheet, and extracting an item parameter corresponding to the data item from the check chart data sheet according to the data item. Specifically, the data items include data categories in the check chart data sheet, for example, in the statistical data of the number of the clients increasing, the number of months is the data category, and the number of the month corresponding to the number of the month is the item parameter of the data item. And extracting project parameters corresponding to the data projects in the verification chart data sheet to obtain chart data. And after the check chart data sheet is obtained, initiating a drawing request to a background, and simultaneously transmitting the chart data to the background.
206. Inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture;
after receiving the drawing request, the background starts a Headless Browser (header Browser) according to the obtained chart data, wherein the Headless Browser (header Browser) refers to a Browser without an operation Interface and is commonly used for automatic testing of a webpage, and various operation instructions, such as testing and screen capturing, can be automatically executed by using an Application Programming Interface (API).
In the proposal, after a drawing request is received, the chart data is input into a headless browser, a pre-collected chart template is loaded according to the chart type selected by a user, and a generated chart is rendered to obtain a rendered chart file.
According to the proposal, a headless browser is deployed at a background server, the content requested by a client is rendered according to a pre-written code, namely, a chart to be generated in the proposal is rendered, and rendered page data is sent to the client, so that rendering at the client is replaced, time required by rendering a page at the client for the first time can be saved, and the page generation speed is obviously improved.
207. And converting the format of the chart picture according to the format of the chart file to generate the chart file, and returning the chart file to the user.
And according to the picture format selected by the user, converting the format of the rendered chart picture in the previous step into a format specified by the user, generating a chart file, transmitting the chart file to a client used by the user, and directly using the chart file after the user directly performs operations such as copying, downloading and the like on the chart file.
In the embodiment of the invention, the chart generation method generates the chart file according to the selection of the user by the headless browser and the server after acquiring the data input by the user, the generation speed is high, the generated chart file can be directly used, and the operation is simple and convenient; a chart file can be generated that more closely fits the needs of the user.
Referring to fig. 3, another embodiment of the graph generating method according to the embodiment of the present invention includes:
301. collecting various chart types; collecting required chart materials according to the chart types, and carrying out labeling and classification on the chart materials to obtain material classification;
in this step, various chart types are collected in advance, and the collected chart types are simply classified, for example: the classification criteria for charts may be a professional level, and all charts may be classified according to the professional level used, for example, charts may be classified into general data processing categories and professional data processing categories. The general data processing classes can include simpler column diagrams, pie diagrams and the like, the charts are generally used for processing when the data is less, the use is the most extensive, the information transmission is most obvious, and the charts are generally used for facing common people; more complex graph types, such as bubble graphs, dynamic data graphs, etc., may be included in the professional data processing class, and such graphs typically require a larger amount of data or have more states, which are typically used in professional situations. Since the amount of data required for generating different charts is relatively different, the data required for each chart type is collected in advance.
After obtaining various chart types, the required materials are collected according to different chart types. The materials described in this proposal include backgrounds, shapes, lines, etc. in a chart, and each material has a variety of different style types and different alternative colors. The material of different chart templates is different. For example, the graph of the plane effect includes polygonal materials of various shapes, and the graph of the stereoscopic effect includes materials of various cubes and cylinders. The dynamic chart also contains dynamic effect materials and the like. And marking and classifying the materials according to the style types of the collected materials to obtain material classification. For example, the method is divided into dynamic materials and static materials; the static materials can be divided into three-dimensional materials, flat wind materials and the like according to design styles.
302. Classifying the chart materials into chart templates according to the materials, and establishing a mapping relation between the chart types and the chart templates;
after the materials with the style classification are obtained in the previous step, the materials are spliced into a plurality of chart templates according to the collected various chart types and the data information required by the various chart types in the previous step. And establishing a mapping relation between the chart type and the chart template for the generated plurality of chart templates, and storing the mapping relation, wherein one chart type can correspond to a plurality of chart templates.
303. Acquiring a chart type to be generated and a chart file format;
in the scheme, one or more chart types required to be made by a user are obtained firstly.
Specifically, names and example pictures of all charts are loaded from a preset chart library, and in the process of acquiring a specific chart type, a user can select rough classification of the chart type first, select according to the names of the large classes classified in advance, for example, select a general data processing class or a professional data processing class, and then select the chart type to be generated according to the example pictures provided in the scheme.
Secondly, the user can select a format of a chart file to be generated according to the use requirement, for example, under the general use condition, the user can select a picture in a JPEG (Joint Photographic Experts Group, which is a product of JPEG standard, the standard is formulated by the International organization for standardization (ISO), and is a compression standard facing continuous tone still images) format, and a picture in a PNG (Portable Network Graphics) format can be selected when the blank part of the picture needs to be transparently processed; if a dynamic graph is generated, a file Format of a dynamic picture such as GIF (Graphics Interchange Format) may be selected.
304. Generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and obtaining the filled chart data sheet;
firstly, generating a corresponding chart data sheet according to the chart type selected by a user. Because the required data of different chart types are different, different chart data sheets are set according to the chart types, and required filling items in the chart data sheets are determined by the chart types.
For example, when the user selects to generate the histogram, it is necessary to input information such as the content of the abscissa and the content of the ordinate, and the value of the ordinate corresponding to each item in the abscissa, according to the characteristics of the histogram. Therefore, when generating the corresponding chart data sheet, the chart data sheet needs to include the contents of the above-described items. When the user selects the chart type to be generated as the pie chart, the name and the quantity information of each item of content to be displayed in the pie chart are required to be input, and the filled chart data sheet is obtained after the required data content is filled.
In addition, the chart data sheet also comprises contents such as color information of the chart, and a user can select and fill in the preset color theme, so that the color matching chart according with psychological expectation can be obtained when the chart is rendered subsequently.
Furthermore, the chart data sheet can also adopt an automatic filling method; specifically, a table of the original data may be directly pasted in a designated position in the chart data sheet or a data file may be imported into the chart data sheet using an import function. And automatically identifying the pasted or imported data form according to a preset character identification algorithm and automatically filling the data form into the chart data sheet to generate the filled chart data sheet. When the data amount in the chart required to be generated by the user is large, the chart data sheet can be automatically filled in by the method for importing the data table, and the speed and the accuracy of chart generation can be greatly improved.
305. Performing data extraction on the filled chart data sheet to obtain chart data;
and carrying out format verification on the chart data sheet filled by the user, and checking whether the filled content conforms to the definition. Defining specific character types for each item of content in the chart data sheet, for example, the character types in the items in which numbers must be filled must have numbers, and checking whether the items are wrongly filled with characters; whether the mandatory item is empty, etc. If the content input by the user does not accord with the definition, the part which does not accord with the definition is specially marked, and the chart data sheet is returned to the user for modification. Similarly, if the function of automatically filling in the form content or the imported data file is adopted, the data format is also checked, and the part which does not meet the definition is specially marked and then the chart data sheet is returned to the user for modification.
And after the filled chart data sheet is verified and the format meets the requirement, extracting the data in the filled chart data sheet to obtain chart data. At this time, a drawing request is sent to the background, and the chart data is simultaneously transmitted to the background.
306. Determining a target template according to the mapping relation between the graph type and the graph template; rendering the chart according to the chart data by using a headless browser according to the target template to obtain a chart picture;
in the proposal, an automatic control instruction of the headless browser is written in advance, and the automatic control instruction can automatically control the headless browser to execute operations such as picture rendering and picture returning when a client sends a drawing request to a server.
Specifically, after a drawing request is received, the headless browser is controlled to determine a target template of a diagram to be generated according to the established mapping relation between the diagram type and the diagram template, and various materials in the target template are loaded according to the target template. And rendering the chart according to the chart data.
In addition, since there are multiple templates in the same chart type, the user can select a preferred template style, such as color theme, when filling out the chart data sheet. In addition, the headless browser can also recognize the application range of the chart to be generated according to the icons or the characters of the head of the chart in the chart data, and select a proper template type according to the application range. For example, if the legend of the chart to be generated is "monthly user growth data chart", application areas such as "work report", "summary", etc. may be identified, the chart may be rendered using a color-matching template that is more conspicuous but not so vivid as to be suitable for reading, among a plurality of chart templates appropriate for that chart type.
307. And converting the format of the chart picture according to the format of the chart file to generate the chart file, and returning the chart file to the user.
And according to the picture format selected by the user, converting the format of the rendered chart picture in the previous step into a format specified by the user, generating a chart file, transmitting the chart file to a client used by the user, and directly using the chart file after the user directly performs operations such as copying, downloading and the like on the chart file.
In the embodiment of the invention, the chart generation method collects various chart templates and chart data materials in advance, generates the chart file according to the selection of the user by using the server through the headless browser after acquiring the data input by the user, has high generation speed, can directly use the generated chart file, and is simple and convenient to operate; a chart file can be generated that more closely fits the needs of the user.
Referring to fig. 4, another embodiment of the graph generating method according to the embodiment of the present invention includes:
401. collecting various chart types; collecting required chart materials according to the chart types, and carrying out labeling and classification on the chart materials to obtain material classification;
in this step, various chart types are collected in advance, and the collected chart types are simply classified, for example: the classification criteria for charts may be a professional level, and all charts may be classified according to the professional level used, for example, charts may be classified into general data processing categories and professional data processing categories. The general data processing classes can include simpler column diagrams, pie diagrams and the like, the charts are generally used for processing when the data is less, the use is the most extensive, the information transmission is most obvious, and the charts are generally used for facing common people; more complex graph types, such as bubble graphs, dynamic data graphs, etc., may be included in the professional data processing class, and such graphs typically require a larger amount of data or have more states, which are typically used in professional situations. Since the amount of data required for generating different charts is relatively different, the data required for each chart type is collected in advance.
After obtaining various chart types, the required materials are collected according to different chart types. The materials described in this proposal include backgrounds, shapes, lines, etc. in a chart, and each material has a variety of different style types and different alternative colors. The material of different chart templates is different. For example, the graph of the plane effect includes polygonal materials of various shapes, and the graph of the stereoscopic effect includes materials of various cubes and cylinders. The dynamic chart also contains dynamic effect materials and the like. And marking and classifying the materials according to the style types of the collected materials to obtain material classification. For example, the method is divided into dynamic materials and static materials; the static materials can be divided into three-dimensional materials, flat wind materials and the like according to design styles.
402. Classifying the chart materials into chart templates according to the materials, and establishing a mapping relation between the chart types and the chart templates;
after the materials with the style classification are obtained in the previous step, the materials are spliced into a plurality of chart templates according to the material classification according to the various chart types collected in the previous step and the data information required by the various chart types. And establishing a mapping relation between the chart type and the chart template for the generated plurality of chart templates, and storing the mapping relation, wherein one chart type can correspond to a plurality of chart templates.
403. Acquiring a chart type selection result of a user on a chart type to be selected displayed on a client page, and acquiring the chart type to be generated according to the chart type selection result;
the method comprises the steps of collecting various chart types in advance, generating various corresponding chart representation intentions and applicable scenes of the charts according to the chart types, displaying the diagrams of the various chart types and the scenes applicable to the chart types in a classification mode on a use interface of a user for the user to select, and enabling the user to select the general types according to scene indexes used by the chart types to ensure that the selected chart types can better display data required to be displayed; then, the type of the specific diagram required is intuitively selected according to the schematic diagram.
404. Acquiring input content of a user or a chart file format selection result of a chart file format to be selected displayed on a client page by the user, and acquiring a chart file format to be generated according to the input content or the chart file format selection result;
a user can input or select a format of a chart file to be generated according to use requirements, for example, under a general use condition, a picture in a JPEG (Joint Photographic Experts Group) format, which is a product of a JPEG standard, is formulated by international organization for standardization (ISO), and is a compression standard facing continuous tone still images, and a picture in a PNG (Portable Network Graphics) format, which needs a blank part of the picture to be transparently processed, can be selected; if a dynamic graph needs to be generated, a file Format of a dynamic picture such as GIF (Graphics Interchange Format) can be selected.
405. Generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and obtaining the filled chart data sheet;
firstly, generating a corresponding chart data sheet according to the chart type selected by a user. Because the required data of different chart types are different, different chart data sheets are set according to the chart types, and required filling items in the chart data sheets are determined by the chart types.
For example, when the user selects to generate the histogram, it is necessary to input information such as the content of the abscissa and the content of the ordinate, and the value of the ordinate corresponding to each item in the abscissa, according to the characteristics of the histogram. Therefore, when generating the corresponding chart data sheet, the chart data sheet needs to include the contents of the above-described items. When the user selects the chart type to be generated as the pie chart, the name and the quantity information of each item of content to be displayed in the pie chart are required to be input, and the filled chart data sheet is obtained after the required data content is filled.
In addition, the chart data sheet also comprises contents such as color information of the chart, and a user can select and fill in the preset color theme, so that the color matching chart according with psychological expectation can be obtained when the chart is rendered subsequently.
Furthermore, the chart data sheet can also adopt an automatic filling method; specifically, a table of the original data may be directly pasted in a designated position in the chart data sheet or a data file may be imported into the chart data sheet using an import function. And automatically identifying the pasted or imported data form according to a preset character identification algorithm and automatically filling the data form into the chart data sheet to generate the filled chart data sheet. When the data amount in the chart required to be generated by the user is large, the chart data sheet can be automatically filled in by the method for importing the data table, and the speed and the accuracy of chart generation can be greatly improved.
406. Format verification is carried out on the information in the filled chart data sheet, and a verification chart data sheet is output after the format verification is passed;
and carrying out format verification on the filled chart data sheet, and checking whether the filled content conforms to the definition. Defining specific character types for each item of content in the chart data sheet, for example, the character types in the items in which numbers must be filled must have numbers, and checking whether the items are wrongly filled with characters; whether the mandatory item is empty, etc. If the content input by the user does not accord with the definition, the part which does not accord with the definition is specially marked, and the chart data sheet is returned to the user for modification. Similarly, if the function of automatically filling in the form content or the imported data file is adopted, the data format is also checked, and the part which does not meet the definition is specially marked and then the chart data sheet is returned to the user for modification.
And after the filled chart data sheet is verified and the format meets the requirement, outputting the verification chart data sheet.
407. Carrying out item identification on information in the check chart data sheet to obtain a data item; extracting project parameters corresponding to the data projects in the check chart data sheet to obtain chart data;
and performing item identification on information in the check chart data sheet to obtain a data item in the check chart data sheet, and extracting an item parameter corresponding to the data item from the check chart data sheet according to the data item. Specifically, the data items include data categories in the check chart data sheet, for example, in the statistical data of the number of the clients increasing, the number of months is the data category, and the number of the month corresponding to the number of the month is the item parameter of the data item. And extracting project parameters corresponding to the data projects in the verification chart data sheet to obtain chart data. And after the check chart data sheet is obtained, initiating a drawing request to a background, and simultaneously transmitting the chart data to the background.
408. Determining a target template according to the mapping relation between the graph type and the graph template; calculating the display state of each material in the target template according to the chart data; rendering the chart according to the display state to obtain a chart picture;
in the proposal, an automatic control instruction of the headless browser is written in advance, and the automatic control instruction can automatically control the headless browser to execute operations such as picture rendering and picture returning when a client sends a drawing request to a server.
Specifically, after a drawing request is received, the headless browser is controlled to determine a target template of a diagram to be generated according to the established mapping relation between the diagram type and the diagram template, and various materials in the target template are loaded according to the target template. And rendering the chart according to the chart data.
In addition, since there are multiple templates in the same chart type, the user can select a preferred template style, such as color theme, when filling out the chart data sheet. In addition, the headless browser can also recognize the application range of the chart to be generated according to the icons or the characters of the head of the chart in the chart data, and select a proper template type according to the application range. For example, if the legend of the chart to be generated is "monthly user growth data chart", application areas such as "work report", "summary", etc. may be identified, the chart may be rendered using a color-matching template that is more conspicuous but not so vivid as to be suitable for reading, among a plurality of chart templates appropriate for that chart type.
Because various chart data are complex and have large differences, the area or volume of material display of each item can be greatly different when the chart is generated according to the data. For example, in a pie chart, due to the size difference of data, there may be a case where the display area of some data materials is much larger than that of other materials; in a general pie chart, in order to make data display more intuitive, a text material is added to a sector module in a general pie chart template to specifically display data content displayed in a current sector range, and if the sector area of one item is too small, the text material is not suitable for being directly marked in the sector area. Therefore, the display state of each material in the target template is calculated in advance according to the chart data, wherein the display state comprises the size range of the area or the volume of each material.
After the display state of each material is obtained, the material is rendered, for example, when the area in a certain sector module in the pie chart is too small. The text material can be marked in the appropriate blank space by means of an arrow or a lead line for the situation. In addition, after the area size occupied by each material is calculated, the position of the character content can be calculated and the size of the character material can be modified according to the area size. In other types of charts, the display range of the horizontal and vertical coordinates is specifically adjusted for the display state of the material, and rendering is performed according to the adjusted numerical value.
409. Acquiring additional content input by a user; performing picture processing operation on the additional content to obtain processed additional content; rendering the processed additional content into the chart picture to obtain the chart picture with the additional content;
and acquiring additional content input by a user in advance, wherein the additional content can be filled in or uploaded in a data sheet. And before rendering the graph picture, processing the obtained additional content to obtain processed additional content, wherein the processing of the additional content comprises copying, zooming, color changing, transparency changing and the like.
In particular, the additional content may be a picture, and the picture is used as a background of the chart to make the chart picture more beautiful. Therefore, when the graph picture is rendered, the picture can be zoomed and the transparency can be changed according to the graph template, so that the background is more attached to the graph template, and the readability of the graph is improved.
In addition, aiming at the requirement that some users need to perform anti-counterfeiting or add source information, copyright information and the like to the graph in the process of generating the graph, the additional content in the proposal can render the watermark into the graph in the process of rendering the graph according to the watermark content input by the users, wherein the watermark content input by the users can be pictures or character content. When the watermark content input by the user is a picture, the size, the color and the transparency of the watermark picture input by the user are adjusted according to the size and the color of the template when the chart is rendered by using a headless browser, and the adjusted watermark picture is synthesized into the chart. When the watermark content input by the user is character information, the font of the watermark content is adjusted according to the character font in the chart template currently generated by the user, and the size, the color and the transparency of the character are also adjusted, so that the character is synthesized into the chart. Therefore, a user can directly generate the chart file with the anti-counterfeiting watermark when generating the chart, the operation of adding the watermark after obtaining the chart is omitted, and the generating step of the chart is simplified.
410. And converting the format of the chart picture according to the format of the chart file to generate the chart file, and returning the chart file to the user.
And according to the picture format selected by the user, converting the format of the rendered chart picture in the previous step into a format specified by the user, generating a chart file, transmitting the chart file to a client used by the user, and directly using the chart file after the user directly performs operations such as copying, downloading and the like on the chart file.
In the embodiment of the invention, the chart generation method generates the chart file according to the selection of the user by the headless browser and the server after acquiring the data input by the user, the generation speed is high, the generated chart file can be directly used, and the operation is simple and convenient; in the chart generation method in the embodiment, various chart templates and chart data materials are collected in advance, so that a chart file closer to the requirements of a user can be generated; in addition, the chart generating method in the embodiment can also automatically add additional contents including the background and the watermark to the chart file according to the user requirement, so that the trouble of adding the additional contents for the second time after the chart file is generated is avoided, and the operation flow is further simplified.
In the above description of the chart generating method in the embodiment of the present invention, referring to fig. 5, a chart generating apparatus in the embodiment of the present invention is described below, where an embodiment of the chart generating apparatus in the embodiment of the present invention includes:
an obtaining module 501, configured to obtain a type of a chart to be generated and a format of a chart file;
a data sheet generation module 502, configured to generate a corresponding chart data sheet according to the chart type, and push the chart data sheet to a user for filling, so as to obtain a filled chart data sheet;
the data extraction module 503 is configured to perform data extraction on the filled-in chart data sheet to obtain chart data;
the rendering module 504 is configured to input the chart data into a preset headless browser, and perform chart rendering according to the chart type through the headless browser to obtain a chart picture;
and the chart generating module 505 is configured to perform format conversion on the chart picture according to the chart file format, generate a chart file, and return the chart file to the user.
In the embodiment of the invention, the chart file is generated by the headless browser through the server, the generating speed is high, the generated chart file can be directly used, and the operation is simple and convenient.
Referring to fig. 6, another embodiment of the graph generating apparatus according to the embodiment of the present invention includes:
an obtaining module 501, configured to obtain a type of a chart to be generated and a format of a chart file;
a data sheet generation module 502, configured to generate a corresponding chart data sheet according to the chart type, and push the chart data sheet to a user for filling, so as to obtain a filled chart data sheet;
the data extraction module 503 is configured to perform data extraction on the filled-in chart data sheet to obtain chart data;
the rendering module 504 is configured to input the chart data into a preset headless browser, and perform chart rendering according to the chart type through the headless browser to obtain a chart picture;
and the chart generating module 505 is configured to perform format conversion on the chart picture according to the chart file format, generate a chart file, and return the chart file to the user.
Optionally, the obtaining module 501 includes:
the type obtaining unit 5011 is configured to obtain a chart type selection result of a chart type to be selected displayed on a client page by a user, and obtain the chart type to be generated according to the chart type selection result;
the format obtaining unit 5012 is configured to obtain input content of a user or a result of selecting a chart file format to be selected, which is displayed on a client page by the user, and obtain the chart file format to be generated according to the input content or the result of selecting the chart file format.
Optionally, the data extracting module 503 includes:
a checking unit 5031, configured to perform format checking on information in the filled-in chart data sheet, and output a check chart data sheet after the format checking passes;
the data extraction unit 5032 is configured to perform item identification on information in the check chart data sheet to obtain a data item; and extracting project parameters corresponding to the data projects in the verification chart data sheet to obtain chart data.
Optionally, the chart generating device in this embodiment further includes:
the chart material collecting module is used for collecting various chart types;
the material classification module is used for collecting required chart materials according to the chart types, labeling and classifying the chart materials to obtain material classifications;
and the chart template establishing module is used for classifying the chart materials into chart templates according to the materials and establishing the mapping relation between the chart types and the chart templates.
Optionally, the rendering module 504 includes:
the template selecting unit 5041 is used for determining a target template according to the mapping relation between the graph type and the graph template;
and the picture rendering unit 5042 is configured to input the chart data into a preset headless browser, and perform chart rendering by using the chart material according to the target template to obtain a chart picture.
Optionally, the picture rendering unit 5042 includes:
the display calculation subunit is used for calculating the display state of the chart material in the target template according to the chart data, wherein the display state comprises the geometric dimension of the chart material;
and the picture rendering subunit is used for performing chart rendering according to the display state to obtain a chart picture.
Optionally, the picture rendering unit 5042 further includes:
the device comprises an additional content acquisition subunit, a watermark extraction subunit and a watermark extraction subunit, wherein the additional content acquisition subunit is used for acquiring additional content input by a user, and the additional content comprises a chart background picture and/or a watermark picture;
the additional content processing subunit is used for carrying out picture processing operation on the additional content to obtain processed additional content, wherein the picture processing operation comprises size adjustment, color change and transparency change;
and the additional content rendering subunit is used for rendering the processing additional content into the chart picture to obtain the chart picture with the additional content.
In the embodiment of the invention, the chart file is generated by the headless browser through the server, the generating speed is high, the generated chart file can be directly used, and the operation is simple and convenient.
Fig. 5 and fig. 6 describe the diagram generating apparatus in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the diagram generating apparatus in the embodiment of the present invention is described in detail from the perspective of the hardware processing.
Fig. 7 is a schematic structural diagram of a diagram generating apparatus 700 according to an embodiment of the present invention, where the diagram generating apparatus 700 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 710 (e.g., one or more processors) and a memory 520, and one or more storage media 730 (e.g., one or more mass storage devices) for storing applications 733 or data 732. Memory 720 and storage medium 730 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 730 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the chart generating apparatus 700. Still further, processor 710 may be configured to communicate with storage medium 730 to execute a series of instruction operations in storage medium 730 on chart generating device 700.
The chart generating apparatus 700 may also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input-output interfaces 760, and/or one or more operating systems 731, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the diagram generating device configuration shown in FIG. 7 does not constitute a limitation of the diagram generating device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The present invention also provides a chart generating device, which includes a memory and a processor, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, cause the processor to execute the steps of the chart generating method in the above embodiments.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the chart generation method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A chart generation method, characterized by comprising:
acquiring a chart type to be generated and a chart file format;
generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and obtaining the filled chart data sheet;
performing data extraction on the filled chart data sheet to obtain chart data;
inputting the chart data into a preset headless browser, and performing chart rendering according to the chart type through the headless browser to obtain a chart picture;
and converting the format of the chart picture according to the format of the chart file to generate a chart file, and returning the chart file to the user.
2. The chart generation method according to claim 1, wherein the obtaining of the chart type and the chart file format to be generated comprises:
acquiring a chart type selection result of a user on a chart type to be selected displayed on a client page, and acquiring the chart type to be generated according to the chart type selection result;
the method comprises the steps of obtaining input content of a user or a chart file format selection result of a chart file format to be selected displayed on a client page by the user, and obtaining the chart file format to be generated according to the input content or the chart file format selection result.
3. The chart generation method according to claim 2, wherein the data extraction of the filled-in chart data sheet to obtain chart data comprises:
format verification is carried out on the information in the filled chart data sheet, and a verification chart data sheet is output after the format verification is passed;
carrying out item identification on information in the check chart data sheet to obtain a data item;
and extracting project parameters corresponding to the data projects in the verification chart data sheet to obtain chart data.
4. The chart generating method according to claim 3, before the obtaining of the chart type and the chart file format to be generated, further comprising:
collecting various chart types;
collecting required chart materials according to the chart types, and carrying out labeling and classification on the chart materials to obtain material classification;
and classifying the chart materials into a chart template according to the materials, and establishing a mapping relation between the chart type and the chart template.
5. The chart generation method according to claim 4, wherein the inputting the chart data into a preset headless browser, and the chart rendering according to the chart type through the headless browser to obtain a chart picture comprises:
determining a target template according to the mapping relation between the chart type and the chart template;
and inputting the chart data into a preset headless browser, and performing chart rendering by using the chart materials according to the target template to obtain a chart picture.
6. The chart generation method according to claim 5, wherein the inputting the chart data into a preset headless browser, and the chart rendering by using the chart material according to the target template to obtain a chart picture comprises:
calculating the display state of the chart materials in the target template according to the chart data, wherein the display state comprises the geometric dimensions of the chart materials;
and performing chart rendering according to the display state to obtain a chart picture.
7. The method as claimed in claim 5, wherein the step of inputting the chart data into a preset headless browser, and performing chart rendering by using the chart material according to the target template to obtain a chart picture further comprises:
acquiring additional content input by a user, wherein the additional content comprises a chart background picture and/or a watermark picture;
performing picture processing operation on the additional content to obtain processed additional content, wherein the picture processing operation comprises size adjustment, color change and transparency change;
and rendering the processing additional content into the chart picture to obtain the chart picture with the additional content.
8. A chart generating apparatus, characterized in that the chart generating apparatus comprises:
the acquisition module is used for acquiring the type and the file format of the chart to be generated;
the data sheet generation module is used for generating a corresponding chart data sheet according to the chart type, pushing the chart data sheet to a user for filling, and generating a filled chart data sheet;
the data extraction module is used for extracting data of the filled chart data sheet to obtain chart data;
the rendering module is used for inputting the chart data into a preset headless browser and rendering the chart according to the chart type through the headless browser to obtain a chart picture;
and the chart generation module is used for carrying out format conversion on the chart picture according to the chart file format to generate a chart file and returning the chart file to the user.
9. A chart generating apparatus, characterized in that the chart generating apparatus comprises: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause the chart generation apparatus to perform the steps of the chart generation method of any of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the steps of the chart generation method of any of claims 1-7.
CN202011578006.9A 2020-12-28 2020-12-28 Chart generation method, device, equipment and storage medium Pending CN112686015A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011578006.9A CN112686015A (en) 2020-12-28 2020-12-28 Chart generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011578006.9A CN112686015A (en) 2020-12-28 2020-12-28 Chart generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112686015A true CN112686015A (en) 2021-04-20

Family

ID=75452586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011578006.9A Pending CN112686015A (en) 2020-12-28 2020-12-28 Chart generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112686015A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554546A (en) * 2021-07-30 2021-10-26 北京东方国信科技股份有限公司 Watermark drawing method and device
CN113901561A (en) * 2021-10-27 2022-01-07 广州山水比德设计股份有限公司 Seedling table generation method and device and drawing operation system
CN115131006A (en) * 2022-08-29 2022-09-30 云账户技术(天津)有限公司 Data chart mail sending method and device
CN115438287A (en) * 2022-11-04 2022-12-06 平安银行股份有限公司 Method for generating chart without browser mode, electronic device and readable storage medium
CN115496834A (en) * 2022-10-13 2022-12-20 东方合智数据科技(广东)有限责任公司 Dynamic chart generation method, dynamic chart generation equipment, dynamic chart generation storage medium and dynamic chart generation device
CN117687737A (en) * 2024-02-01 2024-03-12 成都数之联科技股份有限公司 Echarts chart display optimization method and system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554546A (en) * 2021-07-30 2021-10-26 北京东方国信科技股份有限公司 Watermark drawing method and device
CN113901561A (en) * 2021-10-27 2022-01-07 广州山水比德设计股份有限公司 Seedling table generation method and device and drawing operation system
CN115131006A (en) * 2022-08-29 2022-09-30 云账户技术(天津)有限公司 Data chart mail sending method and device
CN115496834A (en) * 2022-10-13 2022-12-20 东方合智数据科技(广东)有限责任公司 Dynamic chart generation method, dynamic chart generation equipment, dynamic chart generation storage medium and dynamic chart generation device
CN115438287A (en) * 2022-11-04 2022-12-06 平安银行股份有限公司 Method for generating chart without browser mode, electronic device and readable storage medium
CN117687737A (en) * 2024-02-01 2024-03-12 成都数之联科技股份有限公司 Echarts chart display optimization method and system
CN117687737B (en) * 2024-02-01 2024-04-12 成都数之联科技股份有限公司 Echarts chart display optimization method and system

Similar Documents

Publication Publication Date Title
CN112686015A (en) Chart generation method, device, equipment and storage medium
JP5851607B2 (en) Kanji composition method and apparatus, character composition method and apparatus, and font library construction method
CN109308729B (en) Picture synthesis processing method, device and system
US20070234203A1 (en) Generating image-based reflowable files for rendering on various sized displays
CN112016273A (en) Document directory generation method and device, electronic equipment and readable storage medium
CN111752557A (en) Display method and device
JP2015130158A (en) Cloud-based font service system
US11238215B2 (en) Systems and methods for generating social assets from electronic publications
CN101908218A (en) Editing equipment and method for arranging
CN106933887A (en) A kind of data visualization method and device
CN112330532A (en) Image analysis processing method and equipment
CN112835577A (en) Data processing method, data processing device, computer equipment and readable storage medium
CN111222517A (en) Test sample generation method, system, computer device and storage medium
CN114564131B (en) Content publishing method, device, computer equipment and storage medium
CN109726369A (en) A kind of intelligent template questions record Implementation Technology based on normative document
KR102234172B1 (en) Apparatus and method for providing digital twin book shelf
CN109582401B (en) Promotion picture generation method and device, storage medium and computer equipment
CN116702703A (en) Automatic typesetting method and electronic equipment
KR20200098286A (en) Deviec, system and method of providing service of creating detailed pages for sales item on open market
CN113254455B (en) Dynamic configuration method and device of database, computer equipment and storage medium
JP2019053362A (en) Electronic comic book digest generation device and method
CN108063936B (en) Method and device for realizing augmented reality AR and computer readable storage medium
CN113569114A (en) Visual display method and device for system data
CN114419194A (en) Method for generating collocation image and electronic equipment
CN112950167A (en) Design service matching method, device, equipment and storage medium

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