CN109933264B - Graphic data display method and device - Google Patents

Graphic data display method and device Download PDF

Info

Publication number
CN109933264B
CN109933264B CN201910208625.XA CN201910208625A CN109933264B CN 109933264 B CN109933264 B CN 109933264B CN 201910208625 A CN201910208625 A CN 201910208625A CN 109933264 B CN109933264 B CN 109933264B
Authority
CN
China
Prior art keywords
data
target
displayed
display range
maximum
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
CN201910208625.XA
Other languages
Chinese (zh)
Other versions
CN109933264A (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.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology 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 Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN201910208625.XA priority Critical patent/CN109933264B/en
Publication of CN109933264A publication Critical patent/CN109933264A/en
Application granted granted Critical
Publication of CN109933264B publication Critical patent/CN109933264B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a graphic data display method and device. The method comprises the following steps: acquiring data to be displayed; obtaining a target display range according to the data to be displayed and the target zoom factor; and displaying the data to be displayed within the target display range under a coordinate system. A corresponding apparatus is also disclosed. The method and the device have the advantages that the middle point of the initial display range is used as the reference point, the current display range of the coordinate axis is determined according to the scale number of the coordinate axis, the data to be displayed in the current display range are displayed, and the data with dynamically changed numerical values are accurately displayed in a zooming mode.

Description

Graphic data display method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for displaying graphic data.
Background
In recent years, the economy is rapidly developed, the living standard of people is continuously improved, and more people buy the automobile. The automobile brings convenience to people, but at the end, the automobile is also a machine and has faults, and when the faults occur, the automobile needs to be maintained. The maintenance personnel can determine the automobile fault by analyzing the state data of the automobile internal spare and accessory parts. The maintenance personnel need to zoom the automobile state data when looking over the automobile state data. The traditional method can carry out zooming display on the automobile state data, but the zooming display effect on the data with numerical value transformation is poor.
Disclosure of Invention
The application provides a graphic data display method and device to achieve zooming display of graphic data.
In a first aspect, a method for displaying graphic data is provided, including: acquiring data to be displayed; obtaining a target display range according to the data to be displayed and the target zoom factor; and displaying the data to be displayed within the target display range under a coordinate system.
In a possible implementation manner, the obtaining a target display range according to the data to be displayed and a target zoom factor includes: determining an initial display range according to the maximum value and the minimum value in the data to be displayed; and acquiring a target zoom multiple, and adjusting the initial range to be displayed according to the target zoom multiple to obtain the target display range.
In another possible implementation manner, the obtaining a target zoom factor and adjusting the size of the range to be displayed according to the target zoom factor to obtain the target display range includes: determining a midpoint of the initial display range; adjusting the initial scale of the coordinate axis of the coordinate system according to the zoom factor to obtain a target scale; and acquiring the number of scales of the coordinate axis, and acquiring the target display range according to the numerical value of the midpoint, the target scale and the number of the scales.
In another possible implementation manner, the scaling factor includes a target reduction factor, and the adjusting an initial scale of a coordinate axis of the coordinate system according to the scaling factor to obtain a target scale includes: determining a maximum zooming multiple according to the quantity of the data to be displayed, wherein the maximum zooming multiple comprises a maximum zooming multiple; and the target operation is a zoom-out operation, and when the target zoom-out multiple is smaller than the maximum zoom multiple, the initial scale is multiplied by the target zoom-out multiple to obtain the target scale.
In yet another possible implementation manner, the zoom factor further includes a target magnification factor, the maximum zoom factor further includes a maximum magnification factor, and the maximum zoom-out factor is equal to the maximum magnification factor, and the method further includes: and when the target magnification is smaller than the maximum magnification, taking the quotient of the initial scale and the target magnification as the target scale.
In yet another possible implementation manner, the method further includes: and taking the initial scale as a target scale when the target scaling factor is larger than or equal to the maximum scaling factor.
In another possible implementation manner, the determining a maximum zoom factor according to the amount of the data to be displayed includes: the maximum is obtained according to the following formulaScaling factor: [ log ]2N]M; wherein M is the maximum zoom factor and is a positive integer; and N is the number of the data to be displayed.
In another possible implementation manner, the acquiring data to be displayed includes: s data are obtained and stored, wherein S is equal to N, N is the number of the data to be displayed, and the data comprise time stamps; under the condition of acquiring a new data, removing the data with the minimum time stamp, and storing the new data; and taking the stored S data as the data to be displayed.
In another possible implementation manner, the determining an initial display range according to the maximum value and the minimum value in the data to be displayed includes: taking the difference value between the maximum value and the minimum value of the data to be displayed as the initial span of the coordinate axis; acquiring the number of scales of a coordinate axis of the coordinate system, and taking a numerical value with the minimum difference with the initial span in multiples of the number of the scales as a target span of the coordinate axis; determining the initial display range according to the target span of the coordinate axis by taking the minimum value of the data to be displayed as the starting point of the coordinate axis; or determining the initial display range according to the target span of the coordinate axis by taking the maximum value of the data to be displayed as the end point of the coordinate axis.
In another possible implementation manner, the displaying the data to be displayed in the current display range in a coordinate system includes: and sequentially arranging the data to be displayed according to the sequence of the timestamps from large to small, and displaying the data under the coordinate.
In a second aspect, there is provided a graphic data display apparatus comprising: the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for acquiring data to be displayed; the processing unit is used for obtaining a target display range according to the data to be displayed and the target scaling multiple; and the display unit is used for displaying the data to be displayed within the target display range under a coordinate system.
In one possible implementation, the processing unit includes: the first determining subunit is used for determining an initial display range according to the maximum value and the minimum value in the data to be displayed; and the first obtaining subunit is used for obtaining a target zoom multiple and adjusting the initial range to be displayed according to the target zoom multiple to obtain the target display range.
In another possible implementation manner, the first obtaining subunit is further configured to: determining a midpoint of the initial display range; adjusting the initial scale of the coordinate axis of the coordinate system according to the zoom factor to obtain a target scale; and acquiring the number of scales of the coordinate axis, and acquiring the target display range according to the numerical value of the midpoint, the target scale and the number of the scales.
In yet another possible implementation manner, the scaling factor includes a target reduction factor, and the first obtaining subunit is further configured to: determining a maximum zooming multiple according to the quantity of the data to be displayed, wherein the maximum zooming multiple comprises a maximum zooming multiple; and the target operation is a zoom-out operation, and when the target zoom-out multiple is smaller than the maximum zoom-out multiple, the initial scale is multiplied by the target zoom-out multiple to obtain the target scale.
In yet another possible implementation manner, the zoom factor further includes a target magnification factor, the maximum zoom factor further includes a maximum magnification factor, and the maximum zoom factor is equal to the maximum magnification factor, and the first obtaining subunit is further configured to: and when the target magnification is smaller than the maximum magnification, taking the quotient of the initial scale and the target magnification as the target scale.
In another possible implementation manner, the first obtaining subunit is further configured to: and when the target zoom factor is larger than or equal to the maximum zoom factor, taking the initial scale as a target scale.
In yet another possible implementation manner, the adjusting subunit: the maximum scaling factor is obtained according to the following formula: [ log ]2N]M; wherein the content of the first and second substances,and M is the maximum zoom multiple and is a positive integer, and N is the number of the data to be displayed.
In another possible implementation manner, the obtaining unit includes: the second obtaining subunit is configured to obtain S data and store the S data, where S is equal to N, where N is the number of the data to be displayed, and the data includes a timestamp; the storage subunit is used for removing the data with the minimum time stamp and storing the new data under the condition of acquiring the new data; and the second determining subunit is used for taking the stored S data as the data to be displayed.
In yet another possible implementation manner, the first determining subunit is further configured to: taking the difference value between the maximum value and the minimum value of the data to be displayed as the initial span of the coordinate axis; acquiring the number of scales of a coordinate axis of the coordinate system, and taking a numerical value with the minimum difference with the initial span in multiples of the number of the scales as a target span of the coordinate axis; determining the initial display range by taking the minimum value of the data to be displayed as the starting point of the coordinate axis and according to the target span of the coordinate axis; or determining the initial display range according to the target span of the coordinate axis by taking the maximum value of the data to be displayed as the end point of the coordinate axis.
In yet another possible implementation manner, the display unit includes: and the display subunit is used for sequentially arranging the data to be displayed according to the sequence of the timestamps from large to small and displaying the data under the coordinate.
In a third aspect, there is provided a graphic data display apparatus comprising: comprises a processor and a memory; the processor is configured to support the apparatus to perform corresponding functions in the method of the first aspect and any possible implementation manner thereof. The memory is used for coupling with the processor and holds the programs (instructions) and data necessary for the device. Optionally, the apparatus may further comprise an input/output interface for supporting communication between the apparatus and other apparatuses.
In a fourth aspect, there is provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the first aspect and any possible implementation thereof.
In a fifth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of the first aspect and any of its possible implementations.
The method and the device have the advantages that the middle point of the initial display range is used as the reference point, the current display range of the coordinate axis is determined according to the scale number of the coordinate axis, the data to be displayed in the current display range are displayed, and the data with dynamically changed numerical values are accurately displayed in a zooming mode.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
Fig. 1 is a schematic flowchart of a method for displaying graphic data according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another method for displaying graphic data according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another method for displaying graphic data according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating a display range of coordinate axes according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram illustrating a display range of another coordinate axis according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a graphic data display device according to an embodiment of the present application;
fig. 7 is a schematic diagram of a hardware structure of a graphic data display device according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
The embodiments of the present application will be described below with reference to the drawings.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a method for displaying graphic data according to an embodiment of the present disclosure.
101. And acquiring data to be displayed.
The embodiment of the application can realize zooming display of dynamically changed graphic data, and the maximum quantity of the data to be displayed is set before the graphic data are displayed, so that the real-time performance of the current display data is guaranteed, the storage space is reduced, and the running speed of the display equipment is increased. In a possible implementation manner, the data to be displayed includes a timestamp and a numerical value, a predetermined number of data to be displayed (i.e., the set maximum number of the data to be displayed) is obtained according to the size of the timestamp, and the data to be displayed is stored, and when new data to be displayed is obtained, the data to be displayed with the smallest timestamp is removed, and the new data to be displayed is stored, so that real-time update of the data to be displayed is realized.
102. And obtaining a target display range according to the data to be displayed and the target scaling multiple.
The zoom operation includes zoom-in and zoom-out, the display device determines the target zoom factor by detecting the current operation of the user, and in a possible implementation manner, the target zoom factor is determined by detecting the operation of the user, specifically, the target zoom factor is increased once every time the user performs the zoom-out operation, and the target zoom factor is increased once every time the user performs the zoom-in operation, such as: the current reduction factor is 1, and when the user performs a reduction operation once, the reduction factor increases once to become 2.
When the user performs the zoom-out operation, the number of display data should be increased and the display range should be enlarged; when a user performs an enlarging operation, the number of display data should be reduced, and the display range is reduced, in a possible implementation manner, a reference display range is determined according to the maximum value and the minimum value of data to be displayed, and on the basis, the reference display range is doubled every time the reducing operation is performed, so that a target display range is obtained; and each time of executing the amplification operation, reducing the reference display range by one time to obtain a target display range, and ensuring that the midpoint of the reference display range is the same as the midpoint of the target range, such as: the current display range is 20 to 60, the midpoint of the current display range is 40, when the user performs a zoom-out operation, the target display range is 0 to 80, and the midpoint of the target display range is also 40; when the user performs one zoom-in operation, the target display range is 30 to 50, and the midpoint of the target display range is also 40.
103. And displaying the data to be displayed within the target display range under a coordinate system.
The target display range is dynamically changed according to the real-time operation of the user, the target display range is always located in the initial display range, data to be displayed outside the target display range can exist, and the data to be displayed does not need to be displayed under the current zooming operation, so that the data to be displayed in the target display range is displayed under a coordinate system. In a possible implementation manner, according to the acquired data to be displayed, drawing a corresponding graph in a coordinate system, and after a target display range is determined, displaying the graph in the target display range. In another possible implementation manner, data within the target display range are acquired from the data to be displayed, and corresponding graphs are drawn under coordinates according to the data.
According to the embodiment of the application, the middle point of the initial display range is used as the reference point, the current display range of the coordinate axis is determined according to the scale number of the coordinate axis, the data to be displayed in the current display range is displayed, and the data with dynamically changed numerical values are accurately displayed in a zooming mode.
Referring to fig. 2, fig. 2 is a schematic flow chart diagram illustrating another method for displaying graphic data according to an embodiment of the present disclosure.
201. And acquiring data to be displayed.
The embodiment of the application can realize zooming display of dynamically changed graphic data, and the maximum quantity of the data to be displayed is set before the graphic data are displayed, so that the real-time performance of the current display data is guaranteed, the storage space is reduced, and the running speed of the display equipment is increased. In a possible implementation manner, the data to be displayed includes a timestamp and a numerical value, a predetermined number of data to be displayed (i.e., the set maximum number of the data to be displayed) is obtained according to the size of the timestamp, and the data to be displayed is stored, and when new data to be displayed is obtained, the data to be displayed with the smallest timestamp is removed, and the new data to be displayed is stored, so that real-time update of the data to be displayed is realized.
202. And determining an initial display range according to the maximum value and the minimum value in the data to be displayed.
In order to display all the data to be displayed under the coordinate system, a reference display range is determined according to the maximum value and the minimum value of the data to be displayed, such as: the maximum value of the data to be displayed is 60, the minimum value is 10, and the reference display range is 10 to 60.
Because the scale of coordinate axis is definite, in order to guarantee to show a complete scale all the time, bring better experience for the user, based on the scale of benchmark display range and coordinate axis, confirm initial display range, subsequent demonstration all can be adjusted based on initial display range, in a mode that probably realizes, in order to guarantee to show a complete scale all the time, the span of initial display range needs the multiple of scale, and simultaneously, in order to guarantee to treat that the data homoenergetic that shows can normally show, benchmark display range should be in initial display range, when the scale is 6, when the basic display range is 10 to 60, the span of initial display range is 54, initial display range is 10 to 64, or 6 to 60.
203. And acquiring a target zoom multiple, and adjusting the initial range to be displayed according to the target zoom multiple to obtain a target display range.
When the user performs the zoom-out operation, the number of display data should be increased and the display range should be enlarged; when a user performs a zoom-in operation, the number of display data should be reduced, and the display range should be reduced, in one possible implementation, the initial display range is doubled every time the zoom-out operation is performed, so as to obtain a target display range; and each time of executing the amplification operation, reducing the initial display range by one time to obtain a target display range, and ensuring that the midpoint of the current display range is the same as the midpoint of the target range, such as: the current display range is 20 to 60, the midpoint of the current display range is 40, when the user performs a zoom-out operation, the target display range is 0 to 80, and the midpoint of the target display range is also 40; when the user performs one zoom-in operation, the target display range is 30 to 50, and the midpoint of the target display range is also 40.
204. And displaying the data to be displayed within the target display range under a coordinate system.
The target display range is dynamically changed according to the real-time operation of the user, the target display range is always located in the initial display range, data to be displayed outside the target display range can exist, and the data to be displayed does not need to be displayed under the current zooming operation, so that the data to be displayed in the target display range is displayed under a coordinate system. In a possible implementation manner, according to the acquired data to be displayed, drawing a corresponding graph in a coordinate system, and after a target display range is determined, displaying the graph in the target display range. In another possible implementation manner, data within the target display range are acquired from the data to be displayed, and corresponding graphs are drawn under coordinates according to the data.
According to the method and the device, the initial display range is determined according to the reference display range and the scales of the coordinate axis, the midpoint of the initial display range is used as a reference point, the current display range of the coordinate axis is determined according to the number of the scales of the coordinate axis, the data to be displayed in the current display range is displayed, and the data with dynamically changed numerical values are accurately displayed in a zooming mode.
Referring to fig. 3, fig. 3 is a schematic flow chart diagram illustrating another method for displaying graphic data according to an embodiment of the present disclosure.
301. And acquiring data to be displayed.
The embodiment of the application can realize zooming display of dynamically changed graphic data, and the maximum quantity of the data to be displayed is set before the graphic data are displayed, so that the real-time performance of the current display data is guaranteed, the storage space is reduced, and the running speed of the display equipment is increased. In a possible implementation manner, the data to be displayed includes a timestamp and a numerical value, a predetermined number of data to be displayed (i.e., the set maximum number of the data to be displayed) is obtained according to the size of the timestamp, and the data to be displayed is stored, and when new data to be displayed is obtained, the data to be displayed with the smallest timestamp is removed, and the new data to be displayed is stored, so that real-time update of the data to be displayed is realized. In a possible implementation manner, S data are acquired and stored, where S is the maximum number of data to be displayed, each data includes a timestamp, and in the case of acquiring a new data, the data with the smallest timestamp is removed, and the new data is stored, and the stored S data are used as the data to be displayed.
302. And determining an initial display range according to the maximum value and the minimum value in the data to be displayed.
In order to ensure that all data to be displayed can be normally displayed, the difference value between the maximum value and the minimum value of the data to be displayed is used as the initial span of the coordinate axis, and in a possible implementation mode: the maximum value of the data to be displayed is 60, the minimum value is 5, and the initial span is 60-5-55. The number of scales of the coordinate axis of the coordinate system is obtained, and the value with the minimum difference from the initial span in the multiple of the number of scales is used as the target span of the coordinate axis, in a possible implementation mode, the number of scales of the coordinate axis of the coordinate system is 6, namely the coordinate axis only displays 6 scales no matter how many times the scales are scaled, the initial span is 55, and the minimum value in all the numbers which are larger than 55 and are multiple of 6 is used as the target span of the coordinate axis, namely 60.
The method comprises the steps of determining an initial display range of a coordinate axis based on the numerical size of data to be displayed and a target span of the coordinate axis, namely, taking the minimum value of the data to be displayed as a starting point of the coordinate axis, and determining the initial display range according to the target span of the coordinate axis. The method comprises the steps of determining an initial display range of a coordinate axis based on the numerical size of data to be displayed and a target span of the coordinate axis, and determining the initial display range according to the target range of the coordinate axis by taking the maximum value of the data to be displayed as an end point of the coordinate axis.
303. The midpoint of the initial display range is determined.
In order to ensure that data matched with the user operation is displayed, the middle point of the initial display range is always used as the middle point of the display range of the coordinate axis, and the display range corresponding to the zooming operation is determined according to the size of the display range corresponding to the zooming operation. Thus, before subsequent processing, the midpoint of the initial display range is determined, and in one possible implementation, 302 results in an initial display range of 0 to 60, and the midpoint of the initial display range is 30.
304. And adjusting the initial scale of the coordinate axis of the coordinate system according to the zoom factor to obtain the target scale.
In actual operation, but the data is enlarged or reduced to a certain degree, and then the meaning of the displayed data is greatly reduced when the enlargement or reduction is continued, for example: when the data displayed is not clearly seen after being reduced to a certain degree, obviously, the meaning of continuing to reduce the display is not large; when the zoom-in is performed until the number of the data to be displayed included in the display range is very small, it will be meaningless to continue the zoom-in display. Therefore, the scaling factor should be appropriately limited, and in one possible implementation, the maximum scaling factor is determined according to the following formula:
[log2N]=M
wherein, M is the maximum zoom multiple and is a positive integer, [ ] is a rounding symbol, and N is the number of the data to be displayed.
In a possible implementation, the number of data to be displayed is 8, and the maximum zoom factor log is obtained according to the above formula2When 8 is 3, the display can be enlarged 2 times based on the initial display range, and when the magnification reaches the maximum magnification, the display can be reduced 3 times. It should be understood that the maximum zoom factor includes a maximum zoom factor, and the zoom factor decreases once for each increase of the zoom factor, and similarly, the zoom factor decreases once for each increase of the zoom factor. The reduction factor corresponding to the initial display range is the maximum reduction factor, and the magnification factor is 1, such as: the maximum zoom factor is 3, the zoom factor in the initial display range is 3, and the zoom factor is 1, and after one zoom-in operation is performed on this basis, the zoom factor becomes 2, and the zoom factor becomes 2. At this time, the zoom-in operation is performed once again, the zoom-out factor becomes 1, the zoom-in factor becomes 3, the zoom-in factor has reached the maximum zoom-in factor, and the zoom-in cannot be continued, and if the zoom-out operation is performed once, the zoom-out factor becomes 2, and the zoom-in factor becomes 2. It should be noted that the zoom factor corresponds to a zoom factor, i.e., zoom in 1 time makes zoom in 2 times, and zoom out 1 time is zoom out 2 times.
As described above, the number of scales displayed on the coordinate axis is not changed, and the midpoint of the display range of the coordinate axis is also not changed, so that the display range corresponding to the zoom operation can be determined only by determining the corresponding scale of the coordinate axis according to the zoom operation. And when the target operation is detected to be a zoom-out operation and the target zoom-out multiple is smaller than the maximum zoom-out multiple, multiplying the initial scale by the target zoom-out multiple to obtain a target scale. In one possible implementation, as shown in fig. 4, the initial display range is 15 to 45, the number of scales is 6, the initial scale is 5, and when the target reduction multiple is 2, as shown in fig. 5, the target scale is adjusted to 5 × 2 — 10. And when the target operation is detected to be a magnification operation and the target magnification is smaller than the maximum magnification, taking the quotient of the initial scale and the target magnification as a target scale. In one possible implementation, as shown in fig. 5, the initial display range is 0 to 60, the number of scales is 6, the initial scale is 10, and when the target magnification is 2, as shown in fig. 4, the target scale is adjusted to 10/2-5. And when the target zoom multiple is larger than or equal to the maximum zoom multiple, the zoom display cannot be continued, and therefore the initial scale is used as the target scale.
305. And acquiring the number of scales of the coordinate axis, and acquiring a target display range according to the numerical value of the midpoint, the target scale and the number of the scales.
And after the target scale is determined, obtaining the target display range according to the number of the scale and the numerical value of the midpoint of the target display range. In one possible implementation, as shown in fig. 4, the target scale is 5, the number of scales is 6, the numerical value of the midpoint is 30, and the target display range is 15 to 45.
306. And displaying the data to be displayed within the target display range under a coordinate system.
And determining a target display range according to the zooming operation of the user, and finally displaying the data to be displayed in the target display range under the coordinate system. In a possible implementation mode, N pieces of automobile diagnosis data are obtained, through the processing of 301 to 305, the display range of a Y axis (a coordinate axis corresponding to the numerical value) is adjusted in real time according to the zooming operation of a user, and the data to be displayed in the target display range is displayed under the coordinate.
According to the embodiment of the application, the display range of the coordinate axis is fixed to the middle point of the initial display range, the scales of the coordinate axis are adjusted according to the multiple of the zooming operation, the target display range is determined, and the zooming display of the graphic data is achieved.
The method of the embodiments of the present application is set forth above in detail and the apparatus of the embodiments of the present application is provided below.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an image data display device according to an embodiment of the present application, where the device 1 includes: an acquisition unit 11, a processing unit 12 and a display unit 13. Wherein:
an obtaining unit 11, configured to obtain data to be displayed;
the processing unit 12 is configured to obtain a target display range according to the data to be displayed and the target zoom factor;
and the display unit 13 is configured to display the data to be displayed within the target display range in a coordinate system.
Further, the processing unit 12 includes: a first determining subunit 121, configured to determine an initial display range according to a maximum value and a minimum value in the data to be displayed; the first obtaining subunit 122 is configured to obtain a target zoom factor, and adjust the initial range to be displayed according to the target zoom factor to obtain the target display range.
Further, the first obtaining subunit 122 is further configured to: determining a midpoint of the initial display range; adjusting the initial scale of the coordinate axis of the coordinate system according to the zoom factor to obtain a target scale; and acquiring the number of scales of the coordinate axis, and acquiring the target display range according to the numerical value of the midpoint, the target scale and the number of the scales.
In yet another possible implementation manner, the scaling factor includes a target reduction factor, and the first obtaining subunit 122 is further configured to: determining a maximum zooming multiple according to the quantity of the data to be displayed, wherein the maximum zooming multiple comprises a maximum zooming multiple; and the target operation is a zoom-out operation, and when the target zoom-out multiple is smaller than the maximum zoom-out multiple, the initial scale is multiplied by the target zoom-out multiple to obtain the target scale.
In yet another possible implementation manner, the zoom factor further includes a target magnification factor, the maximum zoom factor further includes a maximum magnification factor, and the maximum zoom factor is equal to the maximum magnification factor, and the first obtaining subunit 122 is further configured to: and when the target magnification is smaller than the maximum magnification, taking the quotient of the initial scale and the target magnification as the target scale.
In yet another possible implementation manner, the first obtaining subunit 122 is further configured to: and when the target zoom factor is larger than or equal to the maximum zoom factor, taking the initial scale as a target scale.
In yet another possible implementation manner, the first obtaining subunit 122: the maximum scaling factor is obtained according to the following formula: [ log ]2N]M; wherein M is the maximum zoom factor and is a positive integer; and N is the number of the data to be displayed.
In another possible implementation manner, the obtaining unit 11 includes: a second obtaining subunit 111, configured to obtain S pieces of data, and store the S pieces of data, where S is equal to N, where N is the number of the data to be displayed, and the data includes a timestamp; a storage subunit 112, configured to, in a case where a new data is obtained, remove data with a smallest timestamp, and store the new data; and a second determining subunit 113, configured to use the stored S data as the data to be displayed.
In yet another possible implementation manner, the first determining subunit 121 is further configured to: taking the difference value between the maximum value and the minimum value of the data to be displayed as the initial span of the coordinate axis; acquiring the number of scales of a coordinate axis of the coordinate system, and taking a numerical value with the minimum difference with the initial span in multiples of the number of the scales as a target span of the coordinate axis; determining the initial display range by taking the minimum value of the data to be displayed as the starting point of the coordinate axis and according to the target span of the coordinate axis; or determining the initial display range according to the target span of the coordinate axis by taking the maximum value of the data to be displayed as the end point of the coordinate axis.
In yet another possible implementation manner, the display unit 13 includes: and the display subunit 131 is configured to sequentially arrange the data to be displayed according to the sequence of the timestamps from large to small, and display the data under the coordinate.
Fig. 7 is a schematic diagram of a hardware structure of an image data display device according to an embodiment of the present disclosure. The display device 2 comprises a processor 21 and may further comprise an input device 22, an output device 23 and a memory 24. The input device 22, the output device 23, the memory 24 and the processor 21 are connected to each other via a bus.
The memory includes, but is not limited to, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), which is used for storing instructions and data.
The input means are for inputting data and/or signals and the output means are for outputting data and/or signals. The output means and the input means may be separate devices or may be an integral device.
The processor may include one or more processors, for example, one or more Central Processing Units (CPUs), and in the case of one CPU, the CPU may be a single-core CPU or a multi-core CPU.
The memory is used to store program codes and data of the network device.
The processor is used for calling the program codes and data in the memory and executing the steps in the method embodiment. Specifically, reference may be made to the description of the method embodiment, which is not repeated herein.
It will be appreciated that fig. 7 only shows a simplified design of a graphical data display device. In practical applications, the graphic data display device may further include other necessary components, including but not limited to any number of input/output devices, processors, controllers, memories, etc., and all graphic data display devices that can implement the embodiments of the present application are within the scope of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)), or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media that can store program codes, such as a read-only memory (ROM) or a Random Access Memory (RAM), a magnetic disk, or an optical disk.

Claims (7)

1. A method of displaying graphical data, comprising:
acquiring data to be displayed;
taking the difference value between the maximum value and the minimum value of the data to be displayed as the initial span of the coordinate axis;
acquiring the number of scales of a coordinate axis of a coordinate system, and taking a numerical value with the minimum difference with the initial span in multiples of the number of the scales as a target span of the coordinate axis;
determining an initial display range by taking the minimum value of the data to be displayed as a starting point of the coordinate axis and according to a target span of the coordinate axis, wherein the span of the initial display range is a multiple of the scale; or determining an initial display range by taking the maximum value of the data to be displayed as the end point of the coordinate axis and according to the target span of the coordinate axis, wherein the span of the initial display range is a multiple of the scale;
determining a midpoint of the initial display range;
adjusting the initial scale of the coordinate axis of the coordinate system according to the target scaling multiple to obtain a target scale;
acquiring the number of scales of the coordinate axis, and acquiring a target display range according to the numerical value of the midpoint, the target scale and the number of the scales;
drawing a graph of the data to be displayed under a coordinate system according to the data to be displayed;
and displaying the content in the target display range in the graph of the data to be displayed.
2. The method of claim 1, wherein the target zoom factor comprises a target zoom factor, and the adjusting the initial scale of the coordinate axes of the coordinate system according to the target zoom factor to obtain the target scale comprises:
determining a maximum zooming multiple according to the quantity of the data to be displayed, wherein the maximum zooming multiple comprises a maximum zooming multiple;
and the target operation is a zoom-out operation, and when the target zoom-out multiple is smaller than the maximum zoom multiple, the initial scale is multiplied by the target zoom-out multiple to obtain the target scale.
3. The method of claim 2, wherein the target zoom factor further comprises a target magnification factor, wherein the maximum zoom factor further comprises a maximum magnification factor, and wherein the maximum zoom factor is equal to the maximum magnification factor, the method further comprising:
and when the target magnification is smaller than the maximum magnification, taking the quotient of the initial scale and the target magnification as the target scale.
4. The method according to claim 2, wherein the determining a maximum zoom factor according to the amount of the data to be displayed comprises:
the maximum scaling factor is obtained according to the following formula:
[
Figure 500439DEST_PATH_IMAGE001
and M is the maximum zoom multiple and is a positive integer, and N is the number of the data to be displayed.
5. The method of claim 4, wherein the obtaining data to be displayed comprises:
s data are obtained and stored, wherein S is equal to N, N is the number of the data to be displayed, and the data comprise time stamps;
under the condition of acquiring a new data, removing the data with the minimum time stamp, and storing the new data;
and taking the stored S data as the data to be displayed.
6. A graphic data display device, comprising: a processor and a memory, the processor and the memory; wherein the memory stores program instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 5.
7. A computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions which, when executed by a processor of a batch processing device, cause the processor to carry out the method according to any one of claims 1 to 5.
CN201910208625.XA 2019-03-19 2019-03-19 Graphic data display method and device Active CN109933264B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910208625.XA CN109933264B (en) 2019-03-19 2019-03-19 Graphic data display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910208625.XA CN109933264B (en) 2019-03-19 2019-03-19 Graphic data display method and device

Publications (2)

Publication Number Publication Date
CN109933264A CN109933264A (en) 2019-06-25
CN109933264B true CN109933264B (en) 2022-01-04

Family

ID=66987632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910208625.XA Active CN109933264B (en) 2019-03-19 2019-03-19 Graphic data display method and device

Country Status (1)

Country Link
CN (1) CN109933264B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765184A (en) * 2019-11-08 2020-02-07 深圳微品致远信息科技有限公司 Parking lot data display method and system, computer equipment and storage medium
CN112347183B (en) * 2020-11-30 2024-04-09 杭州安恒信息技术股份有限公司 Data display device, method, equipment and medium
CN112967418B (en) * 2021-01-29 2023-01-06 惠州市大圣和乘科技有限公司 Vehicle-mounted data record display method and device, computer equipment and storage medium
CN113284584B (en) * 2021-05-31 2022-10-11 青岛海信医疗设备股份有限公司 DICOM standard curve verification method, device and equipment
CN115543518B (en) * 2022-10-21 2023-05-12 北京世冠金洋科技发展有限公司 Image coordinate display method, device, equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104181365A (en) * 2013-05-24 2014-12-03 苏州普源精电科技有限公司 Measurement device with zoom display function
CN107248192A (en) * 2017-06-27 2017-10-13 广州视源电子科技股份有限公司 Solid figure method for drafting, device, equipment and storage medium
CN108170350A (en) * 2017-12-28 2018-06-15 努比亚技术有限公司 Realize method, terminal and the computer readable storage medium of Digital Zoom
CN108961318A (en) * 2018-05-04 2018-12-07 上海芯仑光电科技有限公司 A kind of data processing method and calculate equipment
CN109242929A (en) * 2018-08-16 2019-01-18 东软集团股份有限公司 Conversion method, device, storage medium and the equipment of path coordinate figure

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104181365A (en) * 2013-05-24 2014-12-03 苏州普源精电科技有限公司 Measurement device with zoom display function
CN107248192A (en) * 2017-06-27 2017-10-13 广州视源电子科技股份有限公司 Solid figure method for drafting, device, equipment and storage medium
CN108170350A (en) * 2017-12-28 2018-06-15 努比亚技术有限公司 Realize method, terminal and the computer readable storage medium of Digital Zoom
CN108961318A (en) * 2018-05-04 2018-12-07 上海芯仑光电科技有限公司 A kind of data processing method and calculate equipment
CN109242929A (en) * 2018-08-16 2019-01-18 东软集团股份有限公司 Conversion method, device, storage medium and the equipment of path coordinate figure

Also Published As

Publication number Publication date
CN109933264A (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN109933264B (en) Graphic data display method and device
CN110458294B (en) Model operation method, device, terminal and storage medium
CN107204023B (en) Method and apparatus for avoiding distortion of graphics drawn in canvas
CN107315729B (en) Data processing method, medium, device and computing equipment for chart
CN108388509B (en) Software testing method, computer readable storage medium and terminal equipment
US20160349964A1 (en) Method and computing device for performing operation on icon cell
CN106168959B (en) Webpage layout method and device
CN108198125A (en) A kind of image processing method and device
EP4191478A1 (en) Method and apparatus for compressing neural network model
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN115185904A (en) Cloud storage data processing method and device, electronic equipment and readable storage medium
CN106649205B (en) The resampling device of statistical information
CN112286808B (en) Application program testing method and device, electronic equipment and medium
CN112084086B (en) Information collection method, device, medium and electronic equipment
CN108108220A (en) Character string animation effect implementation method and device based on text control
CN109783745B (en) Method, device and computer equipment for personalized typesetting of pages
CN112905090A (en) Spreadsheet processing method, device, terminal and storage medium
CN108415981B (en) Data dimension generation method, device, equipment and computer readable storage medium
CN112632309A (en) Image display method and device, electronic equipment and storage medium
CN112328351A (en) Animation display method, animation display device and terminal equipment
CN109215095B (en) Data display method, device, storage medium and processor
CN112801082B (en) Image sampling method and device and electronic equipment
CN117193668B (en) High-frequency vibration data dilution method and device and electronic equipment
CN116302897B (en) Data set establishing method and device, electronic equipment and storage medium
CN115456892B (en) 2.5-dimensional visual image automatic geometric correction method, device, equipment and 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