CN107315729B - Data processing method, medium, device and computing equipment for chart - Google Patents

Data processing method, medium, device and computing equipment for chart Download PDF

Info

Publication number
CN107315729B
CN107315729B CN201710449909.9A CN201710449909A CN107315729B CN 107315729 B CN107315729 B CN 107315729B CN 201710449909 A CN201710449909 A CN 201710449909A CN 107315729 B CN107315729 B CN 107315729B
Authority
CN
China
Prior art keywords
chart
configuration information
data
scales
axis
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.)
Active
Application number
CN201710449909.9A
Other languages
Chinese (zh)
Other versions
CN107315729A (en
Inventor
李诺
刘阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201710449909.9A priority Critical patent/CN107315729B/en
Publication of CN107315729A publication Critical patent/CN107315729A/en
Application granted granted Critical
Publication of CN107315729B publication Critical patent/CN107315729B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging

Abstract

The embodiment of the invention provides a data processing method for a chart. The method comprises the following steps: acquiring chart configuration information containing configuration information of a plurality of axes; obtaining chart data for drawing a chart; carrying out self-adaptive adjustment according to the configuration information of the logarithmic axis of the chart data; and displaying the chart data after the self-adaptive adjustment of the configuration information of the numerical axis is completed. By adjusting the configuration information of the numerical axis based on the chart data before the chart data is drawn to display the chart data, the method overcomes the defect that the chart data is not enough to distinguish different data when displayed in the related technology, thereby obviously reducing the possibility that different data correspond to the same scale, bringing better experience for users and reducing interference. Furthermore, embodiments of the present invention provide a data processing system, a medium, and a computing device for charts.

Description

Data processing method, medium, device and computing equipment for chart
Technical Field
The embodiment of the invention relates to the field of data processing, in particular to a data processing method, a data processing system, a data processing medium and a computing device for charts.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
In the whole field of data processing and analysis, graph plotting and displaying are widely used, and the forms of graph plotting and displaying are increasingly diversified, for example, various forms of graphs such as a bar graph, a line graph, a graph and the like.
Currently, some dedicated chart drawing tools have appeared for providing services for drawing various forms of charts and displaying them on a terminal, however, in implementing the disclosed concept, the inventors found that at least the following problems exist in the related art:
(1) after a user sets a data format of scales on a number axis used in a chart on an interface, the finally drawn chart may be interfered by rounding up different data corresponding to the same scale, for example, 1200 and 1400 both correspond to 1k, 1600 and 1800 both correspond to 2k, which results in that 1200 and 1400 cannot be distinguished, 1600 and 1800 cannot be distinguished, and so on.
(2) In order to save the display space of the numerical labels on the numerical axis, the data format of the scales on the numerical axis used in the graph generally uses a default format, which is usually set according to the interval where the numerical value itself is located, such as 1K (one thousand), 1M (one million), etc., however, when the actual step length is too small and is smaller than the data unit in the default format, the finally drawn graph may not be able to distinguish different data due to insufficient numerical value change between the two scales, resulting in that different data correspond to the same scale, causing interference, such as that 1200 and 1240 both correspond to 1.2K, resulting in that 1200 and 1240 cannot distinguish, etc.
In view of the above problems in the related art, no effective solution has been proposed at present.
Disclosure of Invention
However, due to the scale number of the axis or the improper display format in the process of drawing the chart, the prior art may not be enough to distinguish different data when the chart data is displayed, so that the chart data is displayed on the same scale.
In the prior art, therefore, it is a very annoying process to distinguish between different data presented on the same scale.
For this reason, an improved data processing method for charts is highly required, so that chart data display results can clearly distinguish different data.
In this context, embodiments of the present invention are intended to provide an improved data processing method for charts and a system thereof.
In a first aspect of embodiments of the present invention, there is provided a data processing method for a chart, including: acquiring chart configuration information containing configuration information of a plurality of axes; obtaining chart data for drawing a chart; carrying out self-adaptive adjustment on the configuration information of the number axis according to the chart data; and displaying the chart data after the configuration information of the number axis is adjusted in a self-adaptive manner.
In an embodiment of the present invention, the adaptively adjusting the configuration information of the number axis according to the graph data includes: calculating an actual step length according to the chart data, wherein the actual step length is an actual span between adjacent scales on the numerical axis; and carrying out self-adaptive adjustment on the number of scales on the number axis or the data display format according to the calculated actual step length.
In another embodiment of the present invention, adaptively adjusting the number of scales on the number axis or the data display format according to the calculated actual step size includes: determining whether the current data display format of the scales on the number axis is a preset format or not according to the configuration information of the number axis; and if so, carrying out self-adaptive adjustment on the current data display format of the scales on the numerical axis according to the calculated actual step length.
In another embodiment of the present invention, the method further includes: and if not, performing self-adaptive adjustment on the number of the scales on the number axis according to the calculated actual step length.
In another embodiment of the present invention, the adaptively adjusting the number of scales on the number axis according to the calculated actual step length includes: determining a preset step length according to the configuration information of the number axis, wherein the preset step length is a preset span between adjacent scales on the number axis; judging whether the actual step length is larger than the preset step length; if so, calculating according to the value range of the number axis and the actual step length to obtain the corresponding scale number; and adjusting the number of the scales on the number axis to the corresponding number of the scales.
In a further embodiment of the present invention, calculating the actual step size according to the graph data includes: calculating the difference between every two data in the chart data; determining the minimum value of the absolute values of the calculated difference values; and taking the minimum value as the actual step size.
In another embodiment of the present invention, obtaining chart configuration information including configuration information of a number axis includes: sending a chart drawing request, wherein the chart drawing request is used for requesting the chart configuration information required to be used when a chart is drawn, and the chart configuration information at least comprises the configuration information of the numerical axis; and receiving the chart configuration information including the configuration information of the number axis returned based on the chart drawing request.
In a second aspect of the embodiments of the present invention, there is provided a medium storing computer-executable instructions, which when executed by a processing unit, are used for implementing the data processing method for charts described in any one of the above embodiments.
In a third aspect of embodiments of the present invention, there is provided a data processing system for a graph, comprising: the first acquisition module is used for acquiring chart configuration information containing configuration information of a number axis; the second acquisition module is used for acquiring chart data used for drawing a chart; the first adjusting module is used for carrying out self-adaptive adjustment on the configuration information of the number axis according to the chart data; and the display module is used for displaying the chart data after the self-adaptive adjustment of the configuration information of the number axis is finished.
In an embodiment of the invention, the first adjusting module includes: a first calculating unit, configured to calculate an actual step length according to the graph data, where the actual step length is an actual span between adjacent scales on the number axis; and the first adjusting unit is used for adaptively adjusting the number of scales on the number axis or the data display format according to the calculated actual step length.
In another embodiment of the present invention, the first adjusting unit includes: the first determining subunit is configured to determine, according to the configuration information of the number axis, whether a current data display format of the scales on the number axis is a preset format; and an adjustment subunit, configured to, if yes, adaptively adjust the current data display format of the scale on the axis according to the calculated actual step length.
In another embodiment of the present invention, the system further includes: and the second adjusting module is used for adaptively adjusting the number of scales on the number axis according to the calculated actual step length under the condition of no.
In another embodiment of the present invention, the second adjusting module includes: a determining unit, configured to determine a preset step length according to the configuration information of the number axis, where the preset step length is a preset span between adjacent scales on the number axis; a judging unit, configured to judge whether the actual step length is greater than the preset step length; the second calculation unit is used for calculating according to the value range of the number axis and the actual step length under the condition of yes so as to obtain the corresponding scale number; and a second adjusting unit for adjusting the number of the scales on the number axis to the corresponding number of the scales.
In still another embodiment of the present invention, the first calculating unit includes: the calculating subunit is used for calculating the difference value between every two data in the chart data; a second determining subunit, configured to determine a minimum value of the absolute values of the calculated difference values; and a third determining subunit, configured to use the minimum value as the actual step size.
In another embodiment of the present invention, the first obtaining module includes: a sending unit, configured to send a chart drawing request, where the chart drawing request is used to request the chart configuration information that needs to be used when drawing a chart, and the chart configuration information at least includes configuration information of the number axis; and a receiving unit configured to receive the chart arrangement information including the arrangement information of the axes returned based on the chart drawing request.
In a fourth aspect of embodiments of the present invention, there is provided a computing device comprising: a processing unit; and a storage unit storing computer-executable instructions, which when executed by the processing unit, are used to implement the data processing method for charts in any of the above embodiments.
According to the data processing and system for the chart, provided by the embodiment of the invention, before the chart is drawn to display the chart data, the configuration information of the numerical axis can be adjusted based on the chart data, so that the data is adaptive to the data which needs to be displayed in the chart currently, and the defect that the chart data is not enough to distinguish different data when displayed in the related technology is overcome, so that the possibility that different data correspond to the same scale is remarkably reduced, better experience is brought to a user, and interference is reduced.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 schematically illustrates an application scenario of a data processing method for a graph and a system thereof according to an embodiment of the present invention;
FIG. 2 schematically illustrates a flow diagram of a data processing method for a graph according to one embodiment of the invention;
FIG. 3A schematically illustrates a block diagram of a data processing system for a graph according to one embodiment of the present invention; and
FIG. 3B schematically shows a block diagram of a data processing system for a graph according to another embodiment of the present invention;
FIG. 3C schematically illustrates a block diagram of a data processing system for a graph according to another embodiment of the present invention;
FIG. 3D schematically illustrates a block diagram of a data processing system for a graph according to another embodiment of the invention;
FIG. 3E schematically illustrates a block diagram of a data processing system for a graph according to another embodiment of the present invention;
FIG. 3F schematically illustrates a block diagram of a data processing system for a graph according to another embodiment of the invention;
FIG. 3G schematically illustrates a block diagram of a data processing system for a graph according to another embodiment of the present invention;
FIG. 4 schematically shows a schematic view of a computer-readable storage medium product according to an embodiment of the invention; and
FIG. 5 schematically shows a block diagram of a computing device according to an embodiment of the present invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to an embodiment of the invention, a data processing method, a system, a medium and a computing device for charts are provided.
In this context, it is to be understood that the terms referred to include, primarily: step size, data format, pixel and scale density, etc. Wherein, the step length represents the span between adjacent scales on the number axis, such as scale 10, scale 20, scale 30, and the step length is 10. The data format indicates the format in which the numerical values are displayed in the graph, such as 3k (3000), 30.1% (0.301), and so on. A pixel represents a basic unit constituting a digital image. The scale density indicates the number of scales that need to be displayed per a preset number of unit pixels, for example, the number of scales that need to be displayed per 100 unit pixels. Moreover, any number of elements in the drawings are by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Summary of The Invention
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art:
(1) after a user sets a data format of scales on a number axis to be used in a chart on a chart drawing interface, different data corresponding to the same scale may be rounded up to cause interference, for example, 1200 and 1400 both correspond to 1k, 1600 and 1800 both correspond to 2k, so that 1200 and 1400 cannot be distinguished, 1600 and 1800 cannot be distinguished, and the like.
(2) In order to save the display space of the numerical labels on the numerical axis, the data format of the scales on the numerical axis used in the graph generally uses a default format, which is usually set according to the interval where the numerical value itself is located, such as 1K (one thousand), 1M (one million), etc., however, when the actual step length is too small and is smaller than the data unit in the default format, the finally drawn graph may not be able to distinguish different data due to insufficient numerical value change between the two scales, resulting in that different data correspond to the same scale, causing interference, such as that 1200 and 1240 both correspond to 1.2K, resulting in that 1200 and 1240 cannot distinguish, etc.
The embodiment of the invention provides a data processing method and a device for a chart, wherein the method comprises the following steps: acquiring chart configuration information containing configuration information of a plurality of axes; obtaining chart data for drawing a chart; carrying out self-adaptive adjustment according to the configuration information of the logarithmic axis of the chart data; and displaying the chart data after the self-adaptive adjustment of the configuration information of the numerical axis is completed. According to the method and the device, before the chart is drawn to display the chart data, the configuration information of the numerical axis is adjusted based on the chart data to be adaptive to the data which needs to be displayed in the chart at present, so that the defect that different data cannot be distinguished enough when the chart data is displayed in the related technology is overcome, the possibility that different data correspond to the same scale is remarkably reduced, better experience is brought to a user, and interference is reduced.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Application scene overview
First, an application scenario of the data processing method for a diagram and the system thereof according to an embodiment of the present invention is described in detail with reference to fig. 1.
In the whole field of data processing and analysis, graph plotting and displaying are widely used, and the forms of graph plotting and displaying are increasingly diversified, for example, various forms of graphs such as a bar graph, a line graph, a graph and the like. The data processing method and the system for the chart, provided by the embodiment of the invention, can be used for drawing application scenes of various forms of charts, such as a line graph shown in fig. 1.
For example, A, B, C, D corresponds to data 1200, 1400, 1600, 1800, respectively, and A, B, C, D is shown as 1K, 2K, respectively, in the numerical axis arrangement of the chart shown in fig. 1. It can be seen that in the graph shown in fig. 1, A, B and C, D cannot be distinguished due to improper arrangement of the number axes.
Exemplary method
In the following, a data processing method for a diagram according to an exemplary embodiment of the present invention is described with reference to fig. 2 in conjunction with the application scenario of fig. 1. It should be noted that the above application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present invention, and the embodiments of the present invention are not limited in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
The embodiment of the invention provides a data processing method for a chart.
Fig. 2 schematically shows a flow chart of a data processing method for a graph according to an embodiment of the present invention. As shown in fig. 2, the method may include the operations of:
operation S201, acquiring diagram configuration information including configuration information of a number axis;
operation S202, acquiring chart data for drawing a chart;
operation S203, performing adaptive adjustment according to the configuration information of the logarithmic axis of the chart data; and
in operation S204, after the adaptive adjustment of the configuration information of the number axis is completed, the chart data is displayed.
According to an embodiment of the present invention, the chart configuration information may include, but is not limited to: the arrangement information of the numerical axis, the representation form of the chart data (such as various forms of bar chart, line chart, curve chart and the like) and the like. Further, the configuration information of the data axis may include, but is not limited to: scale values on the number axis, the number of scales, the data display format (also called data format), the name of the number axis, etc.
For the data format, the number of scales to be displayed on the digit axis can be calculated according to the number of pixels in the display space and the reasonable scale density, further, the span between the maximum value and the minimum value of the digit axis is divided by the number of scales, the scale value of each scale can be calculated, and when the chart data is large, units (namely the data format) such as K, M, B, million, billion and the like can be considered to be used to reduce the space occupation.
In order to facilitate the use of the user, a default data format (also called default format) is generally set during the implementation, and further, in order to meet the actual requirements of the user, for example, in order to avoid displaying different data on the same scale, the user may also set the data format according to the actual requirements and adjust the number of scales on the number axis. Correspondingly, when performing adaptive adjustment according to the configuration information of the log axis of the chart data, two cases are generally considered: 1, if a user sets a data format, considering the number of scales on an adjusting shaft during self-adaptive adjustment; 2, if the default format is adopted, the data modulation format is considered during the adaptive adjustment, but the number of scales is kept unchanged.
According to the embodiment of the invention, since the adaptive adjustment can be carried out according to the configuration information of the logarithmic axis of the chart data and the corresponding chart data is displayed after the adjustment, the scales on the axis can be correctly and reasonably distributed or the data format can be set according to the chart data to be displayed actually, so that each scale can distinguish different chart data, and the usability and the correctness are ensured. In other words, the embodiment of the disclosure can adjust the configuration information of the numerical axis based on the chart data before the chart is drawn to show the chart data, so that the configuration information is adapted to the data which needs to be shown in the chart at present, and the defect that the chart data is not enough to distinguish different data when displayed in the related art is overcome, so that the possibility that different data correspond to the same scale is remarkably reduced, better experience is brought to a user, and interference is reduced.
As an alternative embodiment, the adaptively adjusting according to the configuration information of the logarithmic axis of the chart data may include: calculating an actual step length according to the chart data, wherein the actual step length is an actual span between adjacent scales on the number axis; and carrying out self-adaptive adjustment according to the number of scales on the actual step length logarithmic axis or the data display format obtained by calculation.
Generally, to adapt to a display space, a chart rendering engine provides the number of scales on a number axis according to the number of pixels in the display space and the scale density (generally, 3/100 pixels), and at this time, the preset step length is equal to the value range/scale number of the number axis.
When a user sets a data format, in the process of self-adaptive adjustment according to the number of scales on the logarithmic axis of the actual step length obtained by calculation or the data display format, if the actual step length is larger than the preset step length, the number of the scales on the logarithmic axis is preferentially adjusted by using the actual step length so as to ensure that no repeated scales occur, namely, different chart data are not displayed into the same scale. In this case, the number of scales is the numeric axis's numeric area/actual step length.
For example, for 1200 and 1240, if the data format set by the user is 0.1K, the corresponding preset step size is 100, and at this time, the display results of 1200 and 1240 are both 1.2K, so that 1200 and 1240 cannot be distinguished; while the actual step sizes of 1200 and 1240 are 40, after recalculating the scale number using the actual step sizes, the display results of 1200 and 1240 are 1.20k and 1.24k, respectively, and thus 1200 and 1240 can be distinguished.
In the default format mode, in the process of self-adaptive adjustment according to the number of scales on the actual step length logarithmic axis obtained by calculation or the data display format, the preset step length is directly used to adjust the data format of the whole logarithmic axis so as to ensure that the repetition does not occur. Depending on the actual step size, it can be determined what data format is needed to ensure that the different data are distinguished, e.g. 1200, 1240, 1280, where the step size is 40, and then must be accurate to ten bits, i.e. k (in thousands) of bits in a band.
According to the embodiment of the invention, the self-adaptive adjustment is carried out according to the number of the scales on the log axis of the actual step length obtained by calculation or the data display format, the distribution/data format of the scales on the log axis and the data display method can be jointly adjusted according to the mutual relation of the actual step length and the data format, and the technical effects of considering both the correctness and simplifying the expression of the numerical values on the scales are achieved.
As an alternative embodiment, the adaptively adjusting according to the calculated number of scales on the log-axis of the actual step size or the data display format may include: determining whether the current data display format of the scales on the digit axis is a preset format or not according to the configuration information of the digit axis; and if so, performing self-adaptive adjustment according to the current data display format of the scales on the actual step length logarithmic axis obtained by calculation.
Here, the predetermined format is the default format described above. Under the preset format, the data format can be adjusted according to the actual step length during the self-adaptive adjustment. The method for adjusting the data format based on the actual step size is the same as or similar to the embodiment in the foregoing embodiment, and is not repeated here.
As an alternative embodiment, the method may further comprise: if not, self-adaptive adjustment is carried out according to the number of scales on the actual step length logarithmic axis obtained through calculation.
Here, in a non-preset format, that is, in a case where a user sets a data format, the number of scales may be adjusted according to an actual step size in adaptive adjustment. The method for adjusting the number of scales based on the actual step length is the same as or similar to the embodiment in the foregoing embodiment, and is not described herein again.
As an alternative embodiment, the adaptively adjusting according to the calculated number of scales on the logarithmic axis of the actual step size may include: determining a preset step length according to the configuration information of the number axis, wherein the preset step length is a preset span between adjacent scales on the number axis; judging whether the actual step length is larger than a preset step length or not; if so, calculating according to the value range of the number axis and the actual step length to obtain the corresponding scale number; and adjusting the number of the scales on the number axis to the corresponding number of the scales.
Generally, to adapt to a display space, a chart rendering engine provides the number of scales on a number axis according to the number of pixels in the display space and the scale density (generally, 3/100 pixels), and at this time, the preset step length is equal to the value range/scale number of the number axis.
If the actual step length is larger than the preset step length, the number of scales on the number axis is adjusted by using the actual step length in priority, so that repeated scales cannot be generated, namely, different chart data cannot be displayed to be the same scale. In this case, the number of scales is the numeric axis's numeric area/actual step length.
If the actual step length is smaller than or equal to the preset step length, the preset step length is preferentially considered to be used for adjusting the scale number on the number axis so as to save the occupation of the display space. At this moment, the number of scales is equal to the value range/preset step length of the counting axis, and at this moment, the number of scales does not need to be adjusted, and the chart data can be directly displayed.
As an alternative embodiment, calculating the actual step size from the graph data may include: calculating the difference between every two data in the chart data; determining the minimum value of the absolute values of the calculated difference values; and taking the minimum value as the actual step size.
It should be noted that, under the condition that the user sets the data format, the minimum step length can be calculated through the data unit and the decimal place, and the minimum step length is taken as the actual step length, and if the minimum step length is greater than the preset step length, the minimum step length is preferentially considered to be used to determine the scale number.
For example, for 1200 and 1240, if the data format set by the user is 0.1K, the corresponding preset step size is 100, and at this time, the display results of 1200 and 1240 are both 1.2K, so that 1200 and 1240 cannot be distinguished; while the actual step sizes of 1200 and 1240 are 40, after recalculating the scale number using the actual step sizes, the display results of 1200 and 1240 are 1.20k and 1.24k, respectively, and thus 1200 and 1240 can be distinguished.
As an alternative embodiment, obtaining the chart configuration information including the configuration information of the number axis may include: sending a chart drawing request, wherein the chart drawing request is used for requesting chart configuration information needed to be used when a chart is drawn, and the chart configuration information at least comprises configuration information of a number axis; and receiving chart configuration information including configuration information of the number axis returned based on the chart drawing request.
In the embodiment of the invention, when a user accesses the report page, the report page sends a chart drawing request from the front end to the back end (including but not limited to a server, a database and the like) according to an operation instruction of the user, and the back end returns data and chart configuration information to the front end based on the chart drawing request, so that the front end performs adaptive adjustment based on the chart configuration information and the configuration information of a logarithmic axis of the chart data, and different data in the chart data can be displayed in a differentiated mode, for example, different data are displayed on different scales.
Exemplary devices
Having described the media of the exemplary embodiments of the present invention, a system for implementing a data processing method for a graph of the exemplary embodiments of the present invention will be described in detail with reference to fig. 3.
The embodiment of the invention provides a data processing system for a chart.
FIG. 3A schematically illustrates a block diagram of a data processing system for a graph according to one embodiment of the present invention. As shown in fig. 3A, the system includes: a first obtaining module 10, configured to obtain chart configuration information including configuration information of a number axis; a second obtaining module 20, configured to obtain chart data used for drawing a chart; the first adjusting module 30 is configured to perform adaptive adjustment according to the configuration information of the logarithmic axis of the graph data; and a display module 40, configured to display the chart data after the adaptive adjustment of the configuration information of the number axis is completed.
According to an embodiment of the present invention, the chart configuration information may include, but is not limited to: the arrangement information of the numerical axis, the representation form of the chart data (such as various forms of bar chart, line chart, curve chart and the like) and the like. Further, the configuration information of the data axis may include, but is not limited to: scale values on the number axis, the number of scales, the data display format (also called data format), the name of the number axis, etc.
For the data format, the number of scales to be displayed on the digit axis can be calculated according to the number of pixels in the display space and the reasonable scale density, further, the span between the maximum value and the minimum value of the digit axis is divided by the number of scales, the scale value of each scale can be calculated, and when the chart data is large, units (namely the data format) such as K, M, B, million, billion and the like can be considered to be used to reduce the space occupation.
In order to facilitate the use of the user, a default data format (also called default format) is generally set during the implementation, and further, in order to meet the actual requirements of the user, for example, in order to avoid displaying different data on the same scale, the user may also set the data format according to the actual requirements and adjust the number of scales on the number axis. Correspondingly, when performing adaptive adjustment according to the configuration information of the log axis of the chart data, two cases are generally considered: 1, if a user sets a data format, considering the number of scales on an adjusting shaft during self-adaptive adjustment; 2, if the default format is adopted, the data modulation format is considered during the adaptive adjustment, but the number of scales is kept unchanged.
According to the embodiment of the invention, since the adaptive adjustment can be carried out according to the configuration information of the logarithmic axis of the chart data and the corresponding chart data is displayed after the adjustment, the scales on the axis can be correctly and reasonably distributed or the data format can be set according to the chart data to be displayed actually, so that each scale can distinguish different chart data, and the usability and the correctness are ensured. In other words, the embodiment of the invention can adjust the configuration information of the numerical axis based on the chart data before the chart is drawn to show the chart data, so that the configuration information is adapted to the data which needs to be shown in the chart currently, and the defect that the chart data is not enough to distinguish different data when displayed in the related technology is overcome, thereby obviously reducing the possibility that different data correspond to the same scale, bringing better experience for users, and reducing interference.
As an alternative embodiment, as shown in fig. 3B, the first adjusting module 30 may include: a first calculating unit 301, configured to calculate an actual step length according to the graph data, where the actual step length is an actual span between adjacent scales on the number axis; and a first adjusting unit 302, configured to perform adaptive adjustment according to the calculated number of scales on the log axis of the actual step length or the data display format.
As an alternative embodiment, as shown in fig. 3C, the first adjusting unit 302 may include: a first determining subunit 3021, configured to determine whether a current data display format of the scales on the data axis is a preset format according to the configuration information of the data axis; and an adjusting subunit 3022, configured to, in the case of yes, perform adaptive adjustment according to the current data display format of the logarithmic axis scale of the calculated actual step size.
As an alternative embodiment, as shown in fig. 3D, the system may further include: and the second adjusting module 50 is configured to perform adaptive adjustment according to the calculated number of scales on the log axis of the actual step length if the actual step length is not the same as the actual step length.
As an alternative embodiment, as shown in fig. 3E, the second adjusting module 50 may include: a determining unit 501, configured to determine a preset step length according to configuration information of the number axis, where the preset step length is a preset span between adjacent scales on the number axis; a judging unit 502, configured to judge whether the actual step size is greater than a preset step size; the second calculating unit 503 is configured to, in the case of yes, perform calculation according to the value range of the number axis and the actual step length to obtain the corresponding number of scales; and a second adjusting unit 504 for adjusting the number of scales on the axis to the corresponding number of scales.
As an alternative embodiment, as shown in fig. 3F, the first calculating unit 301 may include: a calculation subunit 3011, configured to calculate a difference between every two data in the graph data; a second determining subunit 3012, configured to determine a minimum value of the absolute values of the calculated differences; and a third determination subunit 3013, configured to take the minimum value as an actual step size.
As an alternative embodiment, as shown in fig. 3G, the first obtaining module 10 may include: a sending unit 101, configured to send a chart drawing request, where the chart drawing request is used to request chart configuration information that needs to be used when drawing a chart, and the chart configuration information at least includes configuration information of a numerical axis; and a receiving unit 102, configured to receive chart configuration information including configuration information of the number axis returned based on the chart drawing request.
It should be noted that the implementation, solved technical problems, implemented functions, and achieved technical effects of each module/unit/subunit and the like in the apparatus part embodiment are respectively the same as or similar to the implementation, solved technical problems, implemented functions, and achieved technical effects of each corresponding step in the method part embodiment, and are not described herein again.
Exemplary Medium
An embodiment of the present invention provides a medium storing computer-executable instructions, which when executed by a processing unit, are used to implement any one of the above-mentioned method embodiments of the data processing method for charts
In some possible embodiments, aspects of the present invention may also be implemented in the form of a program product including program code for causing a terminal device to perform steps in a data processing method for a diagram according to various exemplary embodiments of the present invention described in the above section "exemplary method" of this specification when the program product is run on the terminal device, for example, the terminal device may perform step S201 as shown in fig. 2: acquiring chart configuration information containing configuration information of a plurality of axes; step S202: obtaining chart data for drawing a chart; step S203: carrying out self-adaptive adjustment according to the configuration information of the logarithmic axis of the chart data; and an operation S204 of displaying the chart data after the adaptive adjustment of the configuration information of the axes is completed.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As shown in fig. 4, a program product 40 for data processing of charts according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Exemplary computing device
Having described the method, medium, and system of exemplary embodiments of the present invention, a computing device for data processing of charts in accordance with another exemplary embodiment of the present invention is described next.
The embodiment of the invention also provides the computing equipment. The computing device includes: a processing unit; and a storage unit storing computer-executable instructions for implementing the data processing method for charts described in any one of the above method embodiments when executed by the processing unit.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible embodiments, a computing device for data processing of charts according to the present invention may comprise at least one processing unit, and at least one memory unit. Wherein the storage unit stores program code that, when executed by the processing unit, causes the processing unit to perform the steps in the data processing method for charts according to various exemplary embodiments of the present invention described in the above-mentioned "exemplary method" section of this specification. For example, the processing unit may perform step S201 as shown in fig. 2: acquiring chart configuration information containing configuration information of a plurality of axes; step S202: obtaining chart data for drawing a chart; step S203: carrying out self-adaptive adjustment according to the configuration information of the logarithmic axis of the chart data; and an operation S204 of displaying the chart data after the adaptive adjustment of the configuration information of the axes is completed.
A computing device 50 for data processing of charts according to this embodiment of the invention is described below with reference to fig. 5. The computing device 50 shown in FIG. 5 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the present invention.
As shown in fig. 5, computing device 50 is embodied in the form of a general purpose computing device. Components of computing device 50 may include, but are not limited to: the at least one processing unit 501, the at least one memory unit 502, and a bus 503 connecting the various system components (including the memory unit 502 and the processing unit 501).
Bus 503 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
The storage unit 502 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)5021 and/or cache memory 5022, and may further include Read Only Memory (ROM) 5023.
The storage unit 502 may also include a program/utility 5025 having a set (at least one) of program modules 5024, such program modules 5024 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Computing device 50 may also communicate with one or more external devices 504 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with computing device 50, and/or with any devices (e.g., router, modem, etc.) that enable computing device 50 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interfaces 505. Moreover, computing device 50 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via network adapter 506. As shown, network adapter 506 communicates with the other modules of computing device 50 over bus 503. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computing device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although in the above detailed description reference has been made to several units/modules or sub-units/modules of a data processing system for a diagram, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (12)

1. A data processing method for a chart, comprising:
acquiring chart configuration information containing configuration information of a plurality of axes;
obtaining chart data for drawing a chart;
carrying out self-adaptive adjustment on the configuration information of the number axis according to the chart data; and
after the configuration information of the number axis is adjusted in a self-adaptive manner, the chart data is displayed,
wherein adaptively adjusting the configuration information of the number axis according to the chart data comprises:
calculating an actual step length according to the chart data, wherein the actual step length is an actual span between adjacent scales on the number axis; and
the number of scales on the number axis or the data display format is adjusted in a self-adaptive way according to the actual step length obtained by calculation,
wherein calculating an actual step size from the graph data comprises:
calculating the difference between every two data in the chart data;
determining the minimum value of the absolute values of the calculated difference values; and
and taking the minimum value as the actual step size.
2. The method of claim 1, wherein adaptively adjusting the number of scales on the number axis or the data display format according to the calculated actual step size comprises:
determining whether the current data display format of the scales on the number axis is a preset format or not according to the configuration information of the number axis; and
and if so, carrying out self-adaptive adjustment on the current data display format of the scales on the numerical axis according to the actual step length obtained by calculation.
3. The method of claim 2, wherein the method further comprises:
if not, the number of the scales on the number axis is adjusted in a self-adaptive mode according to the actual step length obtained through calculation.
4. The method of claim 3, wherein adaptively adjusting the number of scales on the number axis according to the calculated actual step size comprises:
determining a preset step length according to the configuration information of the number axis, wherein the preset step length is a preset span between adjacent scales on the number axis;
judging whether the actual step length is larger than the preset step length or not;
if so, calculating according to the value range of the number axis and the actual step length to obtain the corresponding scale number; and
and adjusting the number of the scales on the number axis to the corresponding number of the scales.
5. The method of claim 1, wherein obtaining chart configuration information comprising configuration information for a number axis comprises:
sending a chart drawing request, wherein the chart drawing request is used for requesting the chart configuration information needed to be used when a chart is drawn, and the chart configuration information at least comprises the configuration information of the number axis; and
receiving the chart configuration information which is returned based on the chart drawing request and contains the configuration information of the number axis.
6. A data processing system for charts, comprising:
the first acquisition module is used for acquiring chart configuration information containing configuration information of a number axis;
the second acquisition module is used for acquiring chart data used for drawing a chart;
the first adjusting module is used for carrying out self-adaptive adjustment on the configuration information of the number axis according to the chart data; and
a display module for displaying the chart data after the adaptive adjustment of the configuration information of the number axis is completed,
wherein the first adjusting module comprises:
the first calculation unit is used for calculating an actual step length according to the chart data, wherein the actual step length is an actual span between adjacent scales on the number axis; and
a first adjusting unit for adaptively adjusting the number of scales on the number axis or the data display format according to the calculated actual step length,
the first calculation unit includes:
the calculating subunit is used for calculating the difference value between every two data in the chart data;
a second determining subunit, configured to determine a minimum value of the absolute values of the calculated difference values; and
and the third determining subunit is used for taking the minimum value as the actual step size.
7. The system of claim 6, wherein the first adjusting unit comprises:
the first determining subunit is used for determining whether the current data display format of the scales on the number axis is a preset format or not according to the configuration information of the number axis; and
and the adjusting subunit is used for carrying out self-adaptive adjustment on the current data display format of the scales on the numerical axis according to the actual step length obtained by calculation under the condition of yes.
8. The system of claim 7, wherein the system further comprises:
and the second adjusting module is used for adaptively adjusting the number of the scales on the number axis according to the actual step length obtained by calculation under the condition of no.
9. The system of claim 8, wherein the second adjustment module comprises:
the determining unit is used for determining a preset step length according to the configuration information of the number axis, wherein the preset step length is a preset span between adjacent scales on the number axis;
the judging unit is used for judging whether the actual step length is larger than the preset step length or not;
the second calculation unit is used for calculating according to the value range of the number axis and the actual step length under the condition of yes so as to obtain the corresponding scale number; and
and the second adjusting unit is used for adjusting the number of the scales on the number axis to the corresponding number of the scales.
10. The system of claim 6, wherein the first acquisition module comprises:
a sending unit, configured to send a chart drawing request, where the chart drawing request is used to request the chart configuration information that needs to be used when drawing a chart, and the chart configuration information at least includes the configuration information of the number axis; and
and the receiving unit is used for receiving the chart configuration information which is returned based on the chart drawing request and contains the configuration information of the number axis.
11. A computer-readable storage medium storing computer-executable instructions for implementing the data processing method for charts in any one of claims 1 to 5 when executed by a processing unit.
12. A computing device, comprising:
a processing unit; and
a storage unit storing computer-executable instructions for implementing the data processing method for charts of any one of claims 1 to 5 when executed by the processing unit.
CN201710449909.9A 2017-06-14 2017-06-14 Data processing method, medium, device and computing equipment for chart Active CN107315729B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710449909.9A CN107315729B (en) 2017-06-14 2017-06-14 Data processing method, medium, device and computing equipment for chart

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710449909.9A CN107315729B (en) 2017-06-14 2017-06-14 Data processing method, medium, device and computing equipment for chart

Publications (2)

Publication Number Publication Date
CN107315729A CN107315729A (en) 2017-11-03
CN107315729B true CN107315729B (en) 2020-09-15

Family

ID=60183313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710449909.9A Active CN107315729B (en) 2017-06-14 2017-06-14 Data processing method, medium, device and computing equipment for chart

Country Status (1)

Country Link
CN (1) CN107315729B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108198273A (en) * 2017-12-29 2018-06-22 深圳市元征科技股份有限公司 Data display method, terminal and computer-readable medium
CN108287810A (en) * 2018-01-22 2018-07-17 平安科技(深圳)有限公司 A kind of business datum display methods, device, equipment and storage medium
CN108416024A (en) * 2018-03-08 2018-08-17 网易乐得科技有限公司 Data processing method and device, medium and computing device
CN110046184A (en) * 2019-02-19 2019-07-23 广州视源电子科技股份有限公司 Datagraphic display adjusting method, device, storage medium and computer equipment
CN112328346A (en) * 2020-11-04 2021-02-05 支付宝(杭州)信息技术有限公司 Method and apparatus for data processing
CN113807062A (en) * 2021-08-02 2021-12-17 上海派森诺生物科技有限公司 Online drawing method and device for combined density map and electronic equipment
CN114281450A (en) * 2021-12-09 2022-04-05 山石网科通信技术股份有限公司 Chart visualization method and device, storage medium and processor

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1236145A (en) * 1998-03-26 1999-11-24 夏普公司 Information processing device
CN102968808A (en) * 2012-11-21 2013-03-13 华为技术有限公司 Method and device for displaying
CN103914504A (en) * 2012-12-28 2014-07-09 富士通株式会社 Information processing apparatus and method for generating graphs
CN105574094A (en) * 2015-12-11 2016-05-11 深圳安泰创新科技股份有限公司 Trend graph display method and device
CN106610926A (en) * 2015-10-27 2017-05-03 北京国双科技有限公司 Data display method and device for Echarts (Enterprise Charts)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1236145A (en) * 1998-03-26 1999-11-24 夏普公司 Information processing device
CN102968808A (en) * 2012-11-21 2013-03-13 华为技术有限公司 Method and device for displaying
CN103914504A (en) * 2012-12-28 2014-07-09 富士通株式会社 Information processing apparatus and method for generating graphs
CN106610926A (en) * 2015-10-27 2017-05-03 北京国双科技有限公司 Data display method and device for Echarts (Enterprise Charts)
CN105574094A (en) * 2015-12-11 2016-05-11 深圳安泰创新科技股份有限公司 Trend graph display method and device

Also Published As

Publication number Publication date
CN107315729A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
CN107315729B (en) Data processing method, medium, device and computing equipment for chart
CN107204023B (en) Method and apparatus for avoiding distortion of graphics drawn in canvas
CN109756568B (en) File processing method and device and computer readable storage medium
CN111625473B (en) Interface test case generation method and device, storage medium and electronic equipment
CN109684008B (en) Card rendering method, device, terminal and computer readable storage medium
CN109873735B (en) Performance test method and device for H5 page and computer equipment
CN109101228B (en) Application program execution method and device
CN111310866B (en) Data labeling method, device, system and terminal equipment
CN111198859B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN111459364B (en) Icon updating method and device and electronic equipment
CN113626743A (en) Method and device for determining target display page, electronic equipment and storage medium
CN112306793A (en) Method and device for monitoring webpage
CN111813465B (en) Information acquisition method, device, medium and equipment
CN109902726B (en) Resume information processing method and device
CN111241043A (en) Multimedia file sharing method, terminal and storage medium
CN111352913A (en) File compression method and device, storage medium and terminal equipment
CN111352957A (en) Remote dictionary service optimization method and related equipment
CN111783010B (en) Webpage blank page monitoring method, device, terminal and storage medium
CN106302011B (en) Multi-terminal-based test method and terminal
CN115858905A (en) Data processing method and device, electronic equipment and storage medium
CN112035401A (en) Model data processing method and device, electronic equipment and readable medium
CN111382557B (en) Batch processing method, device, terminal and storage medium for non-fixed-length input data
CN111258582B (en) Window rendering method and device, computer equipment and storage medium
CN114218166A (en) Data processing method and device, electronic equipment and readable storage medium
CN113626402A (en) Log data acquisition method and device, electronic 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
GR01 Patent grant
GR01 Patent grant