Method, device, storage medium and processor for visualizing chart

By obtaining the original data, preset configuration and total width information of the chart, and determining a reasonable number of horizontal axis scales, the problem of poor visibility of the timeline in the chart is solved, and the visual effect of the chart is improved.

CN114281450BActive Publication Date: 2024-11-22HILLSTONE NETWORKS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111503935.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-09
Publication Date
2024-11-22
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

In the prior art, the visibility of the time axis in the chart is poor, mainly because the calculation of the number of scale values ​​does not take into account the total width, height and size of the scale value, resulting in uneven distribution and crowded distribution, which affects the visual effect of the time axis.

Method used

By obtaining the original data, preset configuration and total width information of the chart, determine the target scale number of the horizontal axis, and display the original data according to equal spacing processing to ensure the reasonable number of scales, thereby improving the visibility of the time axis.

Benefits of technology

By reasonably determining the number of horizontal axis scales, the problem of poor visibility of the time axis in the chart is solved, and the visual effect of the chart is improved, making the data display more uniform and reasonable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281450B_ABST
    Figure CN114281450B_ABST
Patent Text Reader

Abstract

The present application discloses a visualization method, device, storage medium and processor for a chart. The method comprises: obtaining target information from a chart, wherein the target information comprises at least: original data of the chart, preset configuration of the chart, and total width information of the chart; determining the target number of scales of the horizontal axis in the chart according to the target information; and displaying the original data according to the target number of scales. The present application solves the problem of poor visibility of the time axis in the chart in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of web page interface processing, and in particular to a method, device, storage medium and processor for visualizing a chart. Background Art

[0002] Front-end web pages are the most direct way for people to interact with the Internet. A web page with good visual effects can often attract more users. Drawing charts in a two-dimensional rectangular coordinate system is the most commonly used drawing method on the front end. There are many open source libraries available for developers to use, such as BitCharts and eCharts.

[0003] In the prior art, only the number of labeled values ​​is calculated through the data source, but the influence of the total width and height of the chart and the size of the labeled values ​​on the drawing and display of the chart is not taken into consideration. If the number of labeled values ​​calculated for some data is large and the data is too long, it will cause uneven distribution of labeled values ​​and crowded labeled values, resulting in poor visibility of the time axis coordinates.

[0004] With regard to the problem of poor visibility of the time axis in the chart in the related art, no effective solution has been proposed yet. Summary of the invention

[0005] The main purpose of the present application is to provide a method, device, storage medium and processor for visualizing a chart to solve the problem of poor visibility of the time axis in the chart in the related art.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for visualizing a chart is provided. The method comprises: obtaining target information from a chart, wherein the target information comprises at least: original data of the chart, preset configuration of the chart, and total width information of the chart; determining the target number of scales of the horizontal axis in the chart according to the target information; and displaying the original data according to the target number of scales.

[0007] Further, determining a target number of scales for the horizontal axis in the chart based on the target information includes: when the target information is a preset configuration of the chart, obtaining a first number of scales for the horizontal axis in the chart based on the preset configuration; when the target information is original data, determining a second number of scales for the horizontal axis in the chart based on the original data; when the target information is total width information of the chart, determining a third number of scales for the horizontal axis in the chart based on the total width information of the chart; and determining the target number of scales based on the first number of scales, the second number of scales, and the third number of scales.

[0008] Further, in the case where the target information is raw data, determining the second number of scales on the horizontal axis of the chart based on the raw data includes: obtaining length information of the raw data; comparing the length information with a preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; and determining the second number of scales based on the comparison result.

[0009] Further, determining the second scale number based on the comparison result includes: if the comparison result indicates that the length information is greater than the first preset scale number, calculating the ratio of the length information to the target value to obtain ratio information, wherein the target value is multiple; judging whether the ratio information is within a target range, wherein the target range is greater than the second preset scale number and the target range is less than the first preset scale number; if the ratio information is within the target range, determining the second scale number based on the ratio information.

[0010] Furthermore, when the target information is the total width information of the chart, determining the third number of scales of the horizontal axis in the chart according to the total width information of the chart includes: obtaining preset width information of the horizontal axis scale in the chart from the chart; and determining the third number of scales according to the total width information and the preset width information.

[0011] Further, determining the target number of scales according to the first number of scales, the second number of scales and the third number of scales includes: selecting a minimum number of scales from the first number of scales, the second number of scales and the third number of scales; and using the minimum number of scales as the target number of scales.

[0012] Furthermore, displaying the original data according to the target scale number includes: processing the original data at equal intervals according to the target scale number to obtain processed original data; and displaying the processed original data.

[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a visualization device for a chart is provided. The device includes: an acquisition unit, used to acquire target information from a chart, wherein the target information includes at least: original data of the chart, preset configuration of the chart, and total width information of the chart; a determination unit, used to determine the target number of scales of the horizontal axis in the chart according to the target information; and a display unit, used to display the original data according to the target number of scales.

[0014] Furthermore, the determination unit includes: an acquisition subunit, which is used to acquire a first number of scales on the horizontal axis of the chart according to a preset configuration when the target information is a preset configuration of the chart; a first determination subunit, which is used to determine a second number of scales on the horizontal axis of the chart according to the original data when the target information is original data; a second determination subunit, which is used to determine a third number of scales on the horizontal axis of the chart according to the total width information of the chart when the target information is the total width information of the chart; and a third determination subunit, which is used to determine the target number of scales based on the first number of scales, the second number of scales and the third number of scales.

[0015] Furthermore, the first determination subunit includes: a first acquisition module, used to obtain the length information of the original data; a comparison module, used to compare the length information with a preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; a first determination module, used to determine the second number of scales based on the comparison result.

[0016] Furthermore, the determination module includes: a calculation submodule, which is used to calculate the ratio of the length information to the target value to obtain ratio information if the comparison result indicates that the length information is greater than the first preset scale number, wherein the target value is multiple; a judgment submodule, which is used to judge whether the ratio information is within a target range, wherein the target range is greater than the second preset scale number and the target range is less than the first preset scale number; and a determination submodule, which is used to determine the second scale number according to the ratio information if the ratio information is within the target range.

[0017] Furthermore, the second determining subunit includes: a second obtaining module, used to obtain preset width information of the horizontal axis scale in the chart from the chart; and a second determining module, used to determine the number of third scales according to the total width information and the preset width information.

[0018] Furthermore, the third determination subunit includes: a selection module for selecting a minimum number of scales from the first number of scales, the second number of scales and the third number of scales; and a third determination module for using the minimum number of scales as a target number of scales.

[0019] Furthermore, the display unit includes: a processing subunit, which is used to process the original data at equal intervals according to the target scale quantity to obtain processed original data; and a display subunit, which is used to display the processed original data.

[0020] According to another aspect of an embodiment of the present application, a processor is further provided, and the processor is used to run a program, wherein any one of the above methods is executed when the program is run.

[0021] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, any one of the above methods is performed.

[0022] Through this application, the following steps are adopted: obtaining target information from a chart, wherein the target information includes at least: the original data of the chart, the preset configuration of the chart, and the total width information of the chart; determining the target number of scales on the horizontal axis of the chart according to the target information; and displaying the original data according to the target number of scales. The problem of poor visibility of the time axis in the chart in the related art is solved. The target number of scales on the horizontal axis of the chart is determined by the target information, and the original data is displayed according to the target number of scales, thereby achieving the effect of improving the visibility of the time axis in the chart. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0024] Figure 1 is a flowchart of a method for visualizing a chart provided in an embodiment of the present application;

[0025] Figure 2 It is an operation flow chart of determining the number of scales based on original data according to the visualization method of a chart provided in an embodiment of the present application;

[0026] Figure 3 This is an operation diagram of determining the number of scales based on the total width of a chart according to a method for visualizing a chart provided in an embodiment of the present application;

[0027] Figure 4 It is a flowchart of the optimal number of scales of the visualization method of the chart provided in the embodiment of the present application;

[0028] Figure 5 is a diagram showing a target scale number of a diagram visualization method according to an embodiment of the present application;

[0029] Figure 6 is a schematic diagram of a visualization device for a chart provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] According to an embodiment of the present application, a method for visualizing a chart is provided.

[0034] Figure 1 is a flow chart of a method for visualizing a chart according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0035] Step S101, obtaining target information from a chart, wherein the target information at least includes: original data of the chart, preset configuration of the chart, and total width information of the chart.

[0036] Specifically, the original data of the chart is the data to be displayed in the chart.

[0037] Step S102, determining the target scale number of the horizontal axis in the chart according to the target information.

[0038] Specifically, the preset configuration may be the number of horizontal axis values ​​that are custom-set for the chart. For example, without considering the number of original data, the system custom-configures the number of scales on the horizontal axis in advance.

[0039] Optionally, in the visualization method of a chart provided in an embodiment of the present application, determining a target number of scales for the horizontal axis of the chart based on target information includes: when the target information is a preset configuration of the chart, obtaining a first number of scales for the horizontal axis of the chart based on the preset configuration; when the target information is original data, determining a second number of scales for the horizontal axis of the chart based on the original data; when the target information is total width information of the chart, determining a third number of scales for the horizontal axis of the chart based on the total width information of the chart; and determining the target number of scales based on the first number of scales, the second number of scales, and the third number of scales.

[0040] For example, when the target information is the preset configuration of the chart, the system customizes the number of horizontal axis values ​​(corresponding to the scale in this application, the same below) to 5 in advance, and uses 5 as the first scale number. When the target information is raw data, the data source information of the raw data is read, the total number of horizontal axis scales of the chart is analyzed, and the second scale number is calculated and processed. When the target information is the total width information of the chart, the total number of values ​​that the horizontal axis of the chart can accommodate is calculated, and the total number is used as the third scale number. This application calculates the number of horizontal axis scales from three aspects, which is conducive to more reasonable display of data in the chart.

[0041] Optionally, in the visualization method of a chart provided in an embodiment of the present application, when the target information is original data, determining the second number of scales of the horizontal axis in the chart based on the original data includes: obtaining length information of the original data; comparing the length information with a preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; determining the second number of scales based on the comparison result.

[0042] Figure 2 is an operation flow chart of determining the number of scales based on original data according to the visualization method of a chart provided in an embodiment of the present application, such as Figure 2 As shown, the default setting of the number of labeled values ​​dataTickCount is equal to the length of the original data dataSource; in the current algorithm, a maximum value maxDataTickCount of the number of labeled values ​​on the horizontal axis is set to 10 (corresponding to the first preset number of scales in the present application), and a minimum value minDataTickCount of the number of labeled values ​​on the horizontal axis is set to 4 (corresponding to the second preset number of scales in the present application). The present application sets the maximum and minimum values ​​of the number of labeled values ​​on the horizontal axis so that the value of the second number of scales is more accurate, which is conducive to more reasonable display of data in the chart.

[0043] Optionally, in the visualization method of the chart provided in the embodiment of the present application, determining the second scale number based on the comparison result includes: if the comparison result indicates that the length information is greater than the first preset scale number, calculating the ratio of the length information to the target value to obtain ratio information, wherein the target value is multiple; judging whether the ratio information is within a target range, wherein the target range is greater than the second preset scale number and the target range is less than the first preset scale number; if the ratio information is within the target range, determining the second scale number based on the ratio information.

[0044] Specifically, Figure 2 As shown, if the length of the original data is greater than the first preset scale number, determine whether the length of the original data is divisible by 2 (corresponding to the target value in the present application); if the length of the original data is divisible by 2, determine whether the value of the length of the original data is divisible by 2n is within the threshold range; if the value of the length of the original data is divisible by 2n is within the threshold range, then the current second scale number may be the value of the length of the original data is divisible by 2n; if the length of the original data is not divisible by 2, determine whether the length of the original data is divisible by 3 (corresponding to the target value in the present application); if the length of the original data is divisible by 3, determine whether the value of the length of the original data is divisible by 3n is within the threshold range; if the length of the original data is divisible by 3n If the value is within the threshold range, the current second scale number can be the value of the original data length divisible by 3n. If the original data length is not divisible by 3, determine whether the original data length can be divisible by 5 (corresponding to the target value in this application). If the original data length is divisible by 5, determine whether the value of the original data length divisible by 5n is within the threshold range. If the value of the original data length divisible by 5n is within the threshold range, the current second scale number can be the value of the original data length divisible by 5n. By comparing the processed original data length with the threshold range, the value of the second scale number is made more accurate, which is conducive to more reasonable display of data in the chart, further improving the visual effect of the chart.

[0045] It should be noted that the threshold range mentioned above is a region greater than minDataTickCount and less than maxDataTickCount, and n refers to a natural number 1, 2, 3, 4...

[0046] Optionally, in the chart visualization method provided in an embodiment of the present application, when the target information is the total width information of the chart, determining the third number of scales on the horizontal axis of the chart based on the total width information of the chart includes: obtaining preset width information of the horizontal axis scale in the chart from the chart; and determining the third number of scales based on the total width information and the preset width information.

[0047] Figure 3 FIG. 1 is a schematic diagram of an operation of determining the number of scales based on the total width of a chart according to a method for visualizing a chart provided in an embodiment of the present application, such as Figure 3 As shown, it is known that the total width of the chart drawing area is maxWidth, and the maximum width of the preset label value is labelWidth, then the value of widthTickCount (corresponding to the third scale number in this application) is the total width / the maximum width of the preset label value. This application calculates the third scale number to facilitate a more reasonable display of data in the chart and enhance the visual effect of the chart.

[0048] Optionally, in the visualization method of the chart provided in the embodiment of the present application, determining the target scale number based on the first scale number, the second scale number and the third scale number includes: selecting the minimum scale number from the first scale number, the second scale number and the third scale number; and using the minimum scale number as the target scale number.

[0049] Specifically, Figure 4 is a flowchart of the optimal number of scales for the visualization method of a chart provided in an embodiment of the present application, such as Figure 4 As shown, the number of user-defined values ​​corresponds to the first scale number, the number of calculated values ​​corresponds to the second scale number, and the number of container values ​​corresponds to the third scale number. If the first scale number is 7, the second scale number is 5, and the third scale number is 6, the second scale number is selected as the target value number for the horizontal axis of the chart. By drawing the chart according to the optimized target value number, the data in the chart is displayed evenly and reasonably.

[0050] Step S103, displaying the original data according to the target scale quantity.

[0051] Specifically, the horizontal axis of the chart is drawn according to the target scale quantity obtained in the above steps.

[0052] Optionally, in the visualization method of the chart provided in the embodiment of the present application, displaying the original data according to the target scale number includes: processing the original data at equal intervals according to the target scale number to obtain processed original data; and displaying the processed original data.

[0053] For example, Figure 5 is a diagram showing a target scale number of a diagram visualization method according to an embodiment of the present application, such as Figure 5 It can be seen that the minimum number of scales selected from the first number of scales, the second number of scales and the third number of scales is 7, then 7 is used as the target number of values ​​for the horizontal axis, and 7 data information are selected at equal intervals for display by traversing the original data. This application further rationalizes the distribution of horizontal axis values ​​by selecting the minimum number of values, and there will be no inconsistent step sizes or crowded display of horizontal axis values, thereby improving the visual effect of the chart.

[0054] In summary, the visualization method of the chart provided in the embodiment of the present application obtains target information from the chart, wherein the target information includes at least: the original data of the chart, the preset configuration of the chart, and the total width information of the chart; determines the target number of scales on the horizontal axis of the chart according to the target information; and displays the original data according to the target number of scales. The problem of poor visibility of the time axis in the chart in the related art is solved. The target number of scales on the horizontal axis of the chart is determined by the target information, and the original data is displayed according to the target number of scales, thereby achieving the effect of improving the visibility of the time axis in the chart.

[0055] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0056] The present application also provides a visualization device for a chart. It should be noted that the visualization device for a chart in the present application can be used to execute the visualization method for a chart provided in the present application. The following is an introduction to the visualization device for a chart provided in the present application.

[0057] Figure 6 is a schematic diagram of a visualization device for a chart according to an embodiment of the present application. Figure 6 As shown, the device includes: an acquisition unit 601, a determination unit 602, and a display unit 603.

[0058] Specifically, the acquisition unit 601 is used to acquire target information from the chart, wherein the target information at least includes: original data of the chart, preset configuration of the chart, and total width information of the chart;

[0059] A determination unit 602, configured to determine a target number of scales on the horizontal axis of the chart according to the target information;

[0060] The display unit 603 is used to display the original data according to the target scale quantity.

[0061] In summary, the visualization device of the chart provided in the embodiment of the present application obtains target information from the chart through the acquisition unit 601, wherein the target information includes at least: the original data of the chart, the preset configuration of the chart, and the total width information of the chart; the determination unit 602 determines the target number of scales of the horizontal axis in the chart according to the target information; the display unit 603 displays the original data according to the target number of scales, thereby solving the problem of poor visibility of the time axis in the chart in the related art. The target number of scales of the horizontal axis in the chart is determined through the target information, and the original data is displayed according to the target number of scales, thereby achieving the effect of improving the visibility of the time axis in the chart.

[0062] Optionally, in the visualization device of the chart provided in the embodiment of the present application, the determination unit 602 includes: an acquisition subunit, which is used to acquire a first number of scales of the horizontal axis in the chart according to the preset configuration when the target information is the preset configuration of the chart; a first determination subunit, which is used to determine the second number of scales of the horizontal axis in the chart according to the original data when the target information is the original data; a second determination subunit, which is used to determine the third number of scales of the horizontal axis in the chart according to the total width information of the chart when the target information is the total width information of the chart; and a third determination subunit, which is used to determine the target number of scales based on the first number of scales, the second number of scales and the third number of scales.

[0063] Optionally, in the visualization device of the chart provided in the embodiment of the present application, the first determination subunit includes: a first acquisition module, used to acquire the length information of the original data; a comparison module, used to compare the length information with a preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; and a first determination module, used to determine the second number of scales based on the comparison result.

[0064] Optionally, in the visualization device of the chart provided in the embodiment of the present application, the determination module includes: a calculation submodule, which is used to calculate the ratio of the length information to the target value to obtain ratio information if the comparison result indicates that the length information is greater than a first preset number of scales, wherein the target value is multiple; a judgment submodule, which is used to judge whether the ratio information is within a target range, wherein the target range is greater than a second preset number of scales and the target range is less than the first preset number of scales; and a determination submodule, which is used to determine the second number of scales according to the ratio information if the ratio information is within the target range.

[0065] Optionally, in the visualization device of the chart provided in the embodiment of the present application, the second determination subunit includes: a second acquisition module, used to obtain preset width information of the horizontal axis scale in the chart from the chart; and a second determination module, used to determine the number of third scales based on the total width information and the preset width information.

[0066] Optionally, in the visualization device of the chart provided in the embodiment of the present application, the third determination subunit includes: a selection module, used to select the minimum scale number from the first scale number, the second scale number and the third scale number; a third determination module, used to use the minimum scale number as the target scale number.

[0067] Optionally, in the visualization device of the chart provided in the embodiment of the present application, the display unit 603 includes: a processing subunit, used to process the original data at equal intervals according to the target scale number to obtain processed original data; and a display subunit, used to display the processed original data.

[0068] The visualization device of the chart includes a processor and a memory. The above-mentioned acquisition unit 601, determination unit 602, display unit 603, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0069] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the visualization of the chart can be performed by adjusting the kernel parameters.

[0070] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0071] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, a method for visualizing a chart is implemented.

[0072] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes a method for visualizing a chart when the program is running.

[0073] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: obtaining target information from a chart, wherein the target information includes at least: original data of the chart, a preset configuration of the chart, and total width information of the chart; determining a target number of scales on the horizontal axis of the chart based on the target information; and displaying the original data according to the target number of scales.

[0074] When the processor executes the program, the following steps are also implemented: when the target information is a preset configuration of the chart, the first number of scales on the horizontal axis of the chart is obtained according to the preset configuration; when the target information is original data, the second number of scales on the horizontal axis of the chart is determined according to the original data; when the target information is the total width information of the chart, the third number of scales on the horizontal axis of the chart is determined according to the total width information of the chart; and the target number of scales is determined according to the first number of scales, the second number of scales and the third number of scales.

[0075] When the processor executes the program, the following steps are also implemented: obtaining the length information of the original data; comparing the length information with the preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; determining the second number of scales based on the comparison result.

[0076] When the processor executes the program, the following steps are also implemented: if the comparison result indicates that the length information is greater than the first preset number of scales, the ratio of the length information to the target value is calculated to obtain ratio information, wherein the target value is multiple; whether the ratio information is within a target range, wherein the target range is greater than the second preset number of scales and the target range is less than the first preset number of scales; if the ratio information is within the target range, the second number of scales is determined according to the ratio information.

[0077] When the processor executes the program, the following steps are also implemented: obtaining preset width information of the horizontal axis scale in the chart from the chart; and determining the number of third scales according to the total width information and the preset width information.

[0078] When the processor executes the program, the following steps are also implemented: selecting the minimum scale number from the first scale number, the second scale number and the third scale number; and using the minimum scale number as the target scale number.

[0079] When the processor executes the program, the following steps are also implemented: the original data is processed at equal intervals according to the target scale quantity to obtain processed original data; and the processed original data is displayed.

[0080] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0081] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: obtaining target information from a chart, wherein the target information includes at least: original data of the chart, preset configuration of the chart, and total width information of the chart; determining a target number of scales on the horizontal axis of the chart based on the target information; and displaying the original data according to the target number of scales.

[0082] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: when the target information is a preset configuration of a chart, obtaining the first number of scales on the horizontal axis of the chart according to the preset configuration; when the target information is original data, determining the second number of scales on the horizontal axis of the chart according to the original data; when the target information is the total width information of the chart, determining the third number of scales on the horizontal axis of the chart according to the total width information of the chart; determining the target number of scales according to the first number of scales, the second number of scales and the third number of scales.

[0083] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: obtaining length information of the original data; comparing the length information with a preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; and determining the second number of scales based on the comparison result.

[0084] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: if the comparison result indicates that the length information is greater than a first preset number of scales, calculate the ratio of the length information to the target value to obtain ratio information, wherein the target value is multiple; determine whether the ratio information is within a target range, wherein the target range is greater than a second preset number of scales and the target range is less than the first preset number of scales; if the ratio information is within the target range, determine the second number of scales based on the ratio information.

[0085] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: obtaining preset width information of the horizontal axis scale in the chart from the chart; and determining the number of third scales according to the total width information and the preset width information.

[0086] When executed on a data processing device, the program is also suitable for executing initialization having the following method steps: selecting the minimum scale number from the first scale number, the second scale number and the third scale number; and using the minimum scale number as the target scale number.

[0087] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: processing the original data at equal intervals according to the target scale quantity to obtain processed original data; and displaying the processed original data.

[0088] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0089] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0090] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0092] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0093] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0094] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0095] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0096] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0097] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for visualizing a chart, characterized in that: include: Acquire target information from a chart, wherein the target information includes at least: original data of the chart, preset configuration of the chart, and total width information of the chart; Determine the target number of scales for the horizontal axis in the chart according to the target information, wherein determining the target number of scales for the horizontal axis in the chart according to the target information includes: obtaining the first number of scales for the horizontal axis in the chart according to the preset configuration; determining the second number of scales for the horizontal axis in the chart according to the original data; determining the third number of scales for the horizontal axis in the chart according to the total width information of the chart; determining the target number of scales according to the first number of scales, the second number of scales, and the third number of scales, wherein determining the target number of scales according to the first number of scales, the second number of scales, and the third number of scales includes: selecting the minimum number of scales from the first number of scales, the second number of scales, and the third number of scales; using the minimum number of scales as the target number of scales, wherein, in the case where the target information is the original data, determining the target number of scales according to the original data Determining the second number of scales on the horizontal axis of the chart includes: obtaining length information of the original data; comparing the length information with a preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; determining the second number of scales according to the comparison result, wherein the first preset number of scales is a preset maximum number of scales on the horizontal axis, and the second preset number of scales is a preset minimum number of scales on the horizontal axis; in the case where the target information is the total width information of the chart, determining the third number of scales on the horizontal axis of the chart according to the total width information of the chart includes: obtaining preset width information of the horizontal axis scale in the chart from the chart; determining the third number of scales according to the total width information and the preset width information; The raw data is displayed according to the target scale quantity.

2. The method according to claim 1, characterized in that Determining the second scale quantity according to the comparison result includes: If the comparison result indicates that the length information is greater than the first preset number of scales, a ratio of the length information to a target value is calculated to obtain ratio information, wherein the target value is a plurality of values, wherein the target value is a multiple of a prime number, and the ratio information is a value of the length information divided by the target value; Determining whether the ratio information is within a target range, wherein the target range is greater than the second preset scale number and the target range is less than the first preset scale number; If the ratio information is within the target range, the second scale quantity is determined according to the ratio information.

3. The method according to claim 1, characterized in that: Displaying the original data according to the target scale quantity includes: Processing the original data with equal spacing according to the target scale quantity to obtain processed original data; The processed raw data are displayed.

4. A diagram visualization device, characterized in that: include: An acquisition unit, configured to acquire target information from a chart, wherein the target information at least includes: original data of the chart, a preset configuration of the chart, and total width information of the chart; A determination unit, configured to determine a target number of scales on the horizontal axis of the chart according to the target information; A display unit, used for displaying the raw data according to the target scale quantity; The determining unit comprises: An acquisition subunit, used for acquiring the first scale number of the horizontal axis in the chart according to the preset configuration; A first determining subunit, configured to determine the number of second scales on the horizontal axis of the chart according to the original data; A second determining subunit, configured to determine the number of third scales of the horizontal axis in the chart according to the total width information of the chart; A third determining subunit, configured to determine the target number of scales according to the first number of scales, the second number of scales, and a third number of scales; The third determining subunit is used to select a minimum number of scales from the first number of scales, the second number of scales and the third number of scales; and use the minimum number of scales as the target number of scales; The first determination subunit includes: a first acquisition module, used to acquire the length information of the original data; a comparison module, used to compare the length information with a preset number of scales to obtain a comparison result, wherein the preset number of scales includes one of the following: a first preset number of scales, a second preset number of scales, wherein the first preset number of scales is greater than the second preset number of scales; a first determination module, used to determine the second number of scales according to the comparison result, wherein the first preset number of scales is a preset maximum number of scales on the horizontal axis, and the second preset number of scales is a preset minimum number of scales on the horizontal axis; The second determining subunit includes: a second obtaining module, used to obtain preset width information of the horizontal axis scale in the chart from the chart; and a second determining module, used to determine the third scale quantity according to the total width information and the preset width information.

5. The device according to claim 4, characterized in that The first determining module comprises: a calculation submodule, configured to calculate a ratio of the length information to a target value to obtain ratio information if the comparison result indicates that the length information is greater than the first preset number of scales, wherein the target value is a plurality of values, wherein the target value is a multiple of a prime number, and the ratio information is a value of the length information divided by the target value; a judgment submodule, configured to judge whether the ratio information is within a target range, wherein the target range is greater than the second preset scale number and the target range is less than the first preset scale number; A determination submodule is used to determine the second scale quantity according to the ratio information if the ratio information is within the target range.

6. The device according to claim 4, characterized in that The display unit comprises: A processing subunit, used for processing the raw data at equal intervals according to the target scale quantity to obtain processed raw data; The display subunit is used to display the processed original data.

7. A processor, characterized in that: The processor is used to run a program, wherein the program executes the diagram visualization method according to any one of claims 1 to 3 when running.

8. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the diagram visualization method according to any one of claims 1 to 3.