Curve graph generation method and device, electronic equipment and readable medium
By obtaining and converting the operating point coordinates of curve graphics, the problem of coordinate confirmation when curve graphics are displayed on different terminals is solved, the user experience is improved, and the complete display of graphics is ensured.
Patent Information
- Application Number
- CN202310323193.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2024-09-24
AI Technical Summary
During data analysis, when the curve graphics drawn by the user are displayed on terminals of different sizes, the data of some operating points exceeds the display range of the data curve, resulting in the inability to confirm the coordinates and reducing the user experience.
By obtaining the graphical information of the target curve, including the relative offset and position data of the first operating point and the second operating point, determining the coordinates of the first operating point, and converting the temporary coordinates of the second operating point into the second coordinates, To ensure that the graphics fall into the display area to achieve a complete display of curve graphics.
It effectively solves the problem of coordinate confirmation when curve graphics are displayed on different terminals, improves user experience, and ensures complete information display of graphics.
Smart Images

Figure CN118691706A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and readable medium for generating a curve graph. Background Art
[0002] In data analysis scenarios, it is often necessary to draw various graphics on the data curve to assist in data analysis. With the development of mobile terminal technology, how to display user-drawn graphics on terminals of different sizes has become a key issue.
[0003] In the related art, when displaying a graphic drawn by a user, the position of each operating point is determined according to the corresponding data of multiple operating points in the graphic in the data coordinate system of the data curve, so as to draw the graphic on the curve.
[0004] However, in such solutions, the data range to be displayed by the data curve often changes. When the data corresponding to some operating points in the graph exceeds the data range to be displayed by the data curve, the coordinates of some operating points cannot be confirmed, resulting in failure of graph drawing and reducing the user experience. Summary of the invention
[0005] Based on the above technical problems, the present application provides a method, device, electronic device and readable medium for generating a curve graphic to enhance the user experience.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of an embodiment of the present application, a method for generating a curve graph is provided, comprising:
[0008] Acquire graphic information corresponding to a target curve, the graphic information including a relative offset between a first operating point and a second operating point of the target graph and position data of the first operating point and the second operating point in the data coordinate system, the position data of the first operating point being within a value range of the target curve in a display area, and the position data of the second operating point being outside the value range of the display area;
[0009] Determine a first coordinate of the first operating point in the display area according to the position data of the first operating point and the correspondence between the value range and the coordinates in the display area;
[0010] determining temporary coordinates of the second operating point according to the position data of the second operating point;
[0011] Converting the temporary coordinates of the second operating point into the second coordinates of the second operating point according to the first coordinates and the relative offset between the first operating point and the second operating point;
[0012] A portion of the target graphic that falls within the display area is drawn according to the first coordinates and the second coordinates.
[0013] According to one aspect of an embodiment of the present application, there is provided a device for generating a curve graph, comprising:
[0014] a graphics information acquisition module, configured to acquire graphics information corresponding to a target curve, wherein the graphics information includes a relative offset between a first operating point and a second operating point of the target graph and position data of the first operating point and the second operating point in the data coordinate system, wherein the position data of the first operating point is within a value range of the target curve in a display area, and the position data of the second operating point is outside the value range of the display area;
[0015] A first coordinate determination module, used to determine a first coordinate of the first operating point in the display area according to the position data of the first operating point and the correspondence between the value range and the coordinates in the display area;
[0016] a temporary coordinate determination module, configured to determine the temporary coordinates of the second operating point according to the position data of the second operating point;
[0017] A second coordinate conversion module, configured to convert the temporary coordinates of the second operating point into second coordinates of the second operating point according to the first coordinates and a relative offset between the first operating point and the second operating point;
[0018] A graphics drawing module is used to draw a portion of the target graphic that falls into the display area according to the first coordinates and the second coordinates.
[0019] In some embodiments of the present application, based on the above technical solution, the target curve includes a plurality of rectangles in the display area, and the graphic information further includes a display offset of the first operating point; the first coordinate determination module includes:
[0020] a rectangle selection unit, configured to select a positioning rectangle corresponding to the first operating point from a plurality of rectangles of the target curve according to horizontal axis data in the position data of the first operating point and horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system;
[0021] The first coordinate determining unit is used to determine the first coordinates of the first operating point in the display area according to the position data of the first operating point, the coordinates of the boundary of the positioning rectangle in the display area, and the display offset of the first operating point.
[0022] In some embodiments of the present application, based on the above technical solution, the first coordinate determination unit includes:
[0023] A first ordinate calculation subunit, configured to calculate the ordinate of the first operating point in the display area according to the ordinate data in the position data of the first operating point and the maximum and minimum values of the value range of the target curve on the ordinate of the data coordinate system;
[0024] The first horizontal coordinate calculation subunit is used to sum the horizontal coordinate of the boundary of the positioning rectangle in the display area and the display offset of the first operating point as the horizontal coordinate of the first operating point in the display area to obtain a first coordinate.
[0025] In some embodiments of the present application, based on the above technical solution, the temporary coordinate determination module includes:
[0026] a temporary ordinate calculation unit, configured to calculate the ordinate of the second operating point in the display area according to the ordinate data in the position data of the second operating point and the maximum and minimum values of the value range of the target curve on the ordinate of the data coordinate system;
[0027] A temporary horizontal coordinate calculation unit is used to use the preset horizontal coordinate as the horizontal coordinate of the second operating point to obtain a temporary coordinate based on the comparison result of the horizontal axis data in the position data of the second operating point and the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system, wherein the comparison result indicates that there is no positioning rectangle corresponding to the horizontal axis data of the second operating point among the multiple rectangles.
[0028] In some embodiments of the present application, based on the above technical solution, the second coordinate conversion module includes:
[0029] A second ordinate calculation unit, configured to calculate the ordinate of the second operating point in the display area according to the ordinate data in the position data of the second operating point and the maximum and minimum values of the value range of the target curve on the ordinate of the data coordinate system;
[0030] an offset difference calculation unit, configured to calculate an offset difference of the second operating point relative to the first operating point according to a relative offset of the second operating point and a relative offset of the first operating point;
[0031] The second horizontal coordinate calculation unit is used to calculate the horizontal coordinate of the second operating point in the display area according to the offset difference and the horizontal coordinate of the first coordinate to obtain a second coordinate.
[0032] In some embodiments of the present application, based on the above technical solution, the curve graph generating device further includes:
[0033] A generating instruction receiving module, used for receiving a graphic generating instruction for the target curve, wherein the graphic generating instruction includes position information of a specified position of the target graphic in the display area;
[0034] A display coordinate determination module, used to determine the coordinates of each operating point in the target graphic in the display area according to the position information of the designated position;
[0035] A position data determination module, used for mapping the coordinates of each operating point in the target graph to the data coordinate system of the target curve, and obtaining the position data of each operating point in the data coordinate system as the graphic information of the target graph;
[0036] The graphic information uploading module is used to upload the graphic information and draw the target graphic at a designated position in the display area according to the coordinates of each operating point in the display area.
[0037] In some embodiments of the present application, based on the above technical solution, the target curve includes a plurality of rectangles in the display area, each rectangle having corresponding horizontal axis data in the data coordinate system; the position data determination module includes:
[0038] a horizontal axis information determination unit, configured to determine, for each operation point, horizontal axis position information of the operation point according to horizontal axis data of a rectangle corresponding to the operation point in the display area;
[0039] a vertical axis information determining unit, configured to use the vertical axis data corresponding to the vertical coordinate of the operating point in the data coordinate system as the vertical axis position information of the operating point;
[0040] A relative offset determination unit is used to use the coordinate difference between the coordinates of the operating point and the coordinates of the target graphic anchor point as the relative offset of the operating point to obtain the position data of the operating point in the data coordinate system, wherein the target graphic anchor point is one of the operating points of the target graphic.
[0041] In some embodiments of the present application, based on the above technical solution, each rectangle of the target curve corresponds to a different horizontal axis coordinate range in the display area; the horizontal axis information determination unit includes:
[0042] a corresponding rectangle determining subunit, configured to determine a corresponding rectangle of the operating point according to a horizontal axis coordinate range within which the horizontal coordinate of the operating point in the display area falls;
[0043] The horizontal axis position determination subunit is used to use the horizontal axis data of the corresponding rectangle in the data coordinate system and the display offset between the operating point and the boundary of the corresponding rectangle in the display area as the horizontal axis position information of the operating point.
[0044] In some embodiments of the present application, based on the above technical solution, the curve graph generating device further includes:
[0045] A movement designation receiving module, configured to receive a movement instruction for the first operating point, wherein the movement instruction includes displacement information of the first operating point;
[0046] A first coordinate updating module, used for updating the first coordinate of the first operating point in the display area according to the displacement information in the movement instruction;
[0047] a position data updating module, configured to determine updated position data of the first operating point in the data coordinate system according to the updated first coordinate;
[0048] The update data uploading module is used to upload the updated position data of the first operating point and redraw the target graphic in the display area according to the updated first coordinates.
[0049] In some embodiments of the present application, based on the above technical solution, the graphic information includes a plurality of the first operating points and a plurality of the second operating points; the second coordinate conversion module includes:
[0050] an operating point selection unit, configured to select a first operating point from a plurality of the first operating points as a target operating point for converting temporary coordinates;
[0051] An operation point traversal unit is used to traverse the multiple second operation points to convert the temporary coordinates of the second operation point into the second coordinates of the second operation point according to the first coordinates of the target operation point and the relative offset between the target operation point and the second operation point.
[0052] In some embodiments of the present application, based on the above technical solution, the graphic information acquisition module includes:
[0053] An information acquisition unit, configured to acquire and save graphic information of the target account for a plurality of data curves according to login information of the target account;
[0054] The information query unit is used to query the graphic information of the target graph corresponding to the target curve from the saved graphic information according to the target curve browsed by the target account.
[0055] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute a method for generating a curve graphic as in the above technical solution by executing the executable instructions.
[0056] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating a curve graph in the above technical solution is implemented.
[0057] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for generating a curve graph provided in the above-mentioned various optional implementations.
[0058] In an embodiment of the present application, the coordinates of the operating points are determined by the relative positions between the operating points. Therefore, as long as the coordinates of one point are determined, the coordinates of all the operating points can be calculated. When the data corresponding to some operating points in the graph exceed the data range to be displayed by the data curve, the graph drawn on the curve is displayed, which is conducive to complete information display and improves the user experience.
[0059] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0061] In the attached picture:
[0062] Figure 1 A network architecture diagram of the graphics drawing system in the embodiment of the present application;
[0063] Figure 2 A diagram of a graphics drawing process architecture provided in an embodiment of the present application;
[0064] Figure 3 A schematic flow chart of a method for generating a curve graph provided in an embodiment of the present application;
[0065] Figure 4 The figure in the figure is a schematic diagram of drawing a graph on the target curve;
[0066] Figure 5 A schematic diagram showing the offset in an embodiment of the present application;
[0067] Figure 6 A schematic diagram of a process for creating a graphic scene in an embodiment of the present application;
[0068] Figure 7 A schematic diagram showing a flow chart of a graphic scene in an embodiment of the present application;
[0069] Figure 8 A schematic diagram showing the process of modifying a graphic in an embodiment of the present application;
[0070] Fig. 9 The following schematically shows a block diagram of a device for generating a curve graph in an embodiment of the present application;
[0071] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0072] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0073] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0074] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0075] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0076] It should be understood that the scheme of the present application can be applied to the scene where the graphics drawn by the user on the data curve are drawn in the display area of the terminal application, and is specifically applied to the graphics drawing system of such scenes. In such a scene, the user draws a graphic on a data curve through the client, such as a rectangle, a line segment or a ray, and these graphics usually serve as prompts and auxiliary analysis data. Each graphic will have some operation points, which are points used to determine the position of the graphic. The position of the graphic can be uniquely determined by these points. For example, the operation points of a rectangle can be two points at the diagonal corners of the rectangle. The graphic will be recorded in the server. When the user browses the data curve on other terminals, the terminal will obtain the information of the corresponding graphic from the server and draw the graphic on the displayed data curve. The graphic will be drawn according to the data corresponding to each operation point on the graphic in the data curve. For example, the operation point of a graphic corresponds to the value 100 on the horizontal axis in the data curve. On other terminals, the operation point will also be at the position corresponding to the value 100 on the horizontal axis. However, for terminals with different display sizes or resolutions, the specific position where the value 100 is displayed on the horizontal axis may be different.
[0077] Specifically, taking a candlestick chart as an example, a user can browse a candlestick chart on a terminal application and draw a graphic on the candlestick chart. After drawing a rectangle on the candlestick chart, the X-axis and Y-axis coordinates of the two operating points of the rectangle on the display can be converted into data in the candlestick chart according to the displayed candlestick chart, and these corresponding data in the candlestick chart will be recorded and uploaded to the server. In the data coordinate system of the candlestick chart, the horizontal axis is usually the time value, and the vertical axis is usually the data value. Then an operating point will record its corresponding time value and data value as the position data of the operating point in the candlestick chart. When the user browses the candlestick chart on another terminal, the client will obtain the data of the corresponding graphic of the candlestick chart from the server. The X-axis and Y-axis coordinates to be on the display are converted according to the position of the time value and data value of the operating point on the candlestick chart of the current terminal, so as to draw the corresponding rectangle on the displayed candlestick chart.
[0078] Specifically, the solution of this application can be run on Figure 1 In the network architecture shown, Figure 1 This is a network architecture diagram of the graphics drawing system running in the embodiment of the present application, such as Figure 1As shown, in the graphics drawing system, a terminal device 110, a terminal device 130 and a data server 120 are included. The user can browse the data curve provided by the data server 120 through the terminal device 110, and draw a graph on the data curve through the terminal device 110. The terminal device 110 will record the data corresponding to the graphic operation point according to the position of the graph and send it to the data server 120. When the user browses the data curve on another terminal device 130, the terminal device 130 will obtain the data of the graphic operation point uploaded by the terminal device 110 from the data server 120. The terminal device 130 determines the display position of each operation point of the graph on the terminal device 130 according to the operation point data and the data displayed on the data curve on the terminal device 130, and draws the graph on the terminal device 130 according to the display position. Figure 1 The terminal device shown in the figure may be a computer device. In actual scenarios, there may be more or fewer types of terminal devices participating in the graphics drawing process. The specific number and type depend on the actual scenario and are not limited here. In addition, Figure 1 One server is shown in the figure, but in actual scenarios, the data server 120 can be one server or multiple servers can be involved. The data curve and graphic data can be stored on different servers respectively. The specific number of servers depends on the actual scenario.
[0079] The above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and basic cloud computing services such as big data and artificial intelligence platforms. This is not limited here. The above-mentioned servers can be actually deployed on the same physical server, and the functions of each server constitute the various functional modules of the management system. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. Terminal devices and servers can be directly or indirectly connected through wired or wireless communication. Terminals and servers can be connected to form a blockchain network, which is not limited in this application. The number of terminal devices and servers is also not limited.
[0080] It can be understood that the above-mentioned graphics drawing system can run on a personal mobile terminal, for example: as a graphics drawing module application in a data curve application, it can also run on a server, and it can also run on a third-party device to provide graphics drawing services; the specific graphics drawing system can be run in the above-mentioned device in the form of a program, it can also be run as a system component in the above-mentioned device, and it can also be used as a cloud service program. The specific operation mode depends on the actual scenario and is not limited here.
[0081] In today's data analysis applications, it is often necessary to draw various graphics on the data curve to assist in data analysis. With the development of mobile terminal technology, how to display user-drawn graphics on terminals of different sizes has become a key issue.
[0082] In the related art, when displaying a graphic drawn by a user, the position of each operating point is determined according to the corresponding data of multiple operating points in the graphic in the data coordinate system of the data curve, so as to draw the graphic on the curve.
[0083] However, in such solutions, the data range to be displayed by the data curve often changes. When the data corresponding to some operating points in the graph exceeds the data range to be displayed by the data curve, the coordinates of some operating points cannot be confirmed, resulting in failure of graph drawing and reducing the user experience.
[0084] Based on such problems, this application proposes a method for generating curve graphics. The specific graphics drawing process framework of this method is as follows Figure 2 shown. Figure 2 This is a diagram of a graphics drawing process architecture provided by an embodiment of the present application. Figure 2As shown, in this architecture, there are mainly five stages, namely, new graph 210, physical operation point conversion 220, data acquisition 230, logical operation point conversion 240 and graph editing 250. Specifically, after the user browses the data curve on device A, a new graph can be created on the page displaying the data curve in the new graph 210 stage. The user can specify the location of the new graph and the shape of the new graph on the page. The physical coordinates of each operation point of the new graph will be generated during the creation process, and the point determined according to the coordinate position on the page can become a physical operation point. In the physical operation point conversion 220 stage, the client will convert the physical operation point into a logical operation point according to the conversion logic. The logical operation point is an operation point determined according to the data in the data curve, that is, its position in the data coordinate system of the data curve. The operation point determined according to the position in the data coordinate system can be called a logical operation point. The logical operation point and the physical operation point are different representations of the same operation point. The logical operation point is in the data coordinate system of the data curve, and the physical operation point is in the display coordinate system of the screen display area. The converted data is sent to the server for recording together with the data of the graph itself as graphic data. In the data acquisition 230 stage, when the user browses the data curve on device B, the client will obtain the data curve and graphic data from the database. The data curve can be displayed directly on the terminal. The logical operation points in the graphic data will be converted into physical operation points in the logical operation point conversion 240 stage. The converted physical operation points are the physical positions corresponding to the logical operation points on the new terminal. Device B draws a graph on the data curve according to the converted physical operation points. In the graphic editing 250 stage, the user can edit the graph on device B, for example, by modifying the position of the physical operation point. The physical operation point with modified position will be converted into a logical operation point in the data coordinate system. The updated data is sent to the server for subsequent browsing.
[0085] It is understandable that the method provided by the present application can be written as a program as a processing logic in a hardware system, or as a curve graph generating device, and the above processing logic is implemented in an integrated or external manner. As an implementation method, in the process of drawing a graph, the coordinates of the operating point are determined by the relative position between the operating points. Therefore, as long as the coordinates of a point are determined, the coordinates of all operating points can be calculated. When the data corresponding to some operating points in the graph exceeds the data range to be displayed by the data curve, the graph drawn on the curve is displayed, which is conducive to complete information display and improves user experience.
[0086] The following is a description of the technical solution provided by the present application in conjunction with a specific embodiment. In conjunction with the above process architecture, the following is a description of the method for generating a curve graph in the present application. Figure 3 , Figure 3A schematic flow chart of a method for generating a curve graph provided in an embodiment of the present application. The method for generating a curve graph can be executed by a terminal, or by a server, or by a terminal and a server together. The following description is made by taking the execution of the terminal as an example. The embodiment of the present application at least includes the following steps S310 to S350:
[0087] Step S310, obtaining graphic information corresponding to the target curve, the graphic information including a relative offset between a first operating point and a second operating point of the target graphic and position data of the first operating point and the second operating point in the data coordinate system, the position data of the first operating point being within a value range of the target curve in a display area, and the position data of the second operating point being outside a value range of the display area.
[0088] The target curve is a data curve that has been displayed on the display of the terminal device, which is located in the data coordinate system. The horizontal axis and the vertical axis of the data coordinate system are the value ranges of the data in the target curve in the display area, and the local data of the target curve usually does not contain data outside the value range of the display area, or although it contains data, it will not be displayed in the display area. For example, the target curve is a curve between time and price, where the horizontal axis is time data and the vertical axis is price data. Then in the data coordinate system, the horizontal axis is the time value range displayed in the display area, such as the date of each day in a month, and the vertical axis is the price data range in this month. The maximum value of the range is usually greater than or equal to the maximum price in this month, and the minimum value is usually less than or equal to the minimum price in this month. The target graph is to display a graph on the target curve. The graph is usually a graph drawn by the user. The graph records its position relative to the target curve through the data in the data coordinate system. The graphic information includes the relative offset of the first operating point and the second operating point of the target graph and the position data in the data coordinate system. The relative offset refers to the offset of the first operating point and the second operating point relative to an operating point in the target graph that serves as an anchor point. The target graph may include multiple operating points, and the anchor point may be any of these operating points, that is, it may also be the first operating point and the second operating point. The position data of the first operating point and the second operating point in the data coordinate system usually include the data corresponding to the operating point on the horizontal axis and the data corresponding to the vertical axis. Still taking the horizontal axis as time data and the vertical axis as price data as an example, the position data of an operating point in the data coordinate system usually includes a time value as the horizontal axis and a price value as the vertical axis. In the display area of the data curve, the value range of the data coordinate system on the horizontal axis and the vertical axis will also be displayed. The position data of the first operating point is within the value range, that is, in the position data of the first operating point, the data of the horizontal axis and the data of the vertical axis are both within the display range, while the position data of the second operating point is outside the value range, that is, in the position data of the second operating point, the data of the horizontal axis or the data of the vertical axis are not within the display range. For example, in the display area of the data curve, the horizontal axis range of the data coordinate system is from March 1 to March 30, and the vertical axis range is from 100 to 300. In the position data of the first operating point, its horizontal axis data and vertical axis data are both within the corresponding range, such as March 15 and 200, while in the position data of the second operating point, at least one of the horizontal axis data and the vertical axis data is not within the corresponding range, such as the horizontal axis data is April 10 or the vertical axis data is 310. It can be understood that the position data of the first operating point is within the displayed value range, so the first operating point can be considered to be located in the display area of the target curve, and the position data of the second operating point is outside the displayed value range, so the second operating point can be considered to be outside the display area of the target curve.It is understandable that a graph may include multiple operating points, and the first operating point may be a set of all operating points whose position data is within the displayed value range, while the second operating point is a set of all operating points whose position data is outside the displayed value range.
[0089] Step S320: determining the first coordinates of the first operating point in the display area according to the position data of the first operating point and the correspondence between the value range and the coordinates in the display area.
[0090] The first coordinate is the physical coordinate position of the first operating point in the display area. In the case where the display area is positioned by pixel points, the first coordinate can be the pixel point position in the display area. The first coordinate usually includes a horizontal coordinate and a vertical coordinate. The position data of the first operating point will be converted into the first coordinate according to a certain logic. For example, a display coordinate system is established according to the origin of the data coordinate system, and the position data can be mapped to the display coordinate system according to the corresponding position in the data coordinate system. For example, for the horizontal axis, each date from March 1 to March 30 in the horizontal coordinate corresponds to a pixel position in the display area. According to the time value of the first operating point, the pixel position corresponding to the date is used as the horizontal coordinate in the first coordinate of the first operating point, and the vertical coordinate can also be processed similarly. It can be understood that since the position data of the first operating point is within the value range displayed in the display area, the corresponding first coordinate can also be directly located in the display area.
[0091] Step S330: determining temporary coordinates of the second operating point according to the position data of the second operating point.
[0092] The temporary coordinates of the second operating point are usually physical coordinate positions that are not in the display area. The position data of the second operating point will be processed in the same way as the first operating point. However, during the processing, since the position data of the second operating point exceeds the value range displayed in the display area, the corresponding physical coordinates cannot be determined for the second operating point. For example, for the horizontal axis, the value range of the data coordinate system is from March 1 to March 30, but the horizontal axis data of the second operating point is April 10, and April 10 will not be displayed in the display area, and naturally there is no pixel position corresponding to April 10. The temporary coordinates are usually determined according to a predetermined value. For example, for data that exceeds the value range, the corresponding physical coordinates are directly set to an unreasonable temporary data, such as -10. It can be understood that in the temporary coordinates of the second operating point, even if the horizontal coordinate is set to temporary data, when the vertical axis data is within the value range, the converted vertical coordinate can still be a normal legal vertical coordinate. For example, in the position data of the second operating point, the vertical axis data is 200, and the vertical axis range in the data coordinate system is 100 to 300, then for the data 200, there will be a corresponding pixel position, and the corresponding vertical coordinate will also be obtained.
[0093] Step S340: Convert the temporary coordinates of the second operating point into second coordinates of the second operating point according to the first coordinates and the relative offset between the first operating point and the second operating point.
[0094] For the second operating point, the curve graph generating device will calculate the position of the second operating point relative to the first operating point according to the offset between the two operating points and the first coordinate of the first operating point, thereby obtaining the second coordinate of the second operating point, but the second coordinate will be located outside the display area. Specifically, the relative offset of the first operating point and the second operating point is usually the offset of the two operating points relative to the anchor point in the target graph. The anchor point can be any operating point in the target graph. The offset usually includes the offset of the horizontal axis and the offset of the vertical axis. According to whether the coordinates in the temporary coordinates of the second operating point need to be converted into horizontal coordinates or vertical coordinates, the offset between the first operating point and the second operating point is determined by using the offset on the corresponding horizontal axis or vertical axis, and then the coordinates in the second coordinates are calculated in combination with the coordinate values in the first coordinates. It can be understood that the offset is usually the physical offset between the operating points, that is, the pixel difference between the display positions of the two operating points. The offset is usually recorded when a new or updated graph is created. In some embodiments, the offset is determined by the data difference in the data coordinate system. When performing the conversion, it is necessary to calculate the pixel corresponding to one unit on the horizontal axis based on the first coordinate and the horizontal axis data of the first operating point, and then calculate the physical pixel offset based on the offset. For example, the origin of the data coordinate system is 0 days, the horizontal axis data of the first operating point is 15 days, and the horizontal axis is 150, then the number of pixels corresponding to each day can be calculated to be 10. Assuming that the offset between the second operating point and the first operating point is -20 days, the physical offset can be calculated to be -200 pixels, that is, the horizontal coordinate of the second operating point is -50. When the lower left corner of the screen is the origin, the position of -50 on the horizontal axis is obviously not within the display range.
[0095] Step S350: Draw the portion of the target graphic that falls within the display area according to the first coordinates and the second coordinates.
[0096] The curve graph generating device determines the position of the target graph according to the first coordinate and the second coordinate, and can determine the part of the target graph that falls into the display area according to the positional relationship between the position of the graph and the display area. For example, if the target graph is a rectangle, the first coordinate is (20,40), and the second coordinate is (-20,20), then it can be determined that the part of the rectangle that falls into the display area is (0,20), (0,40), (20,20) and (20,40) as the four points of the rectangular part in the display area. For example, see Figure 4 . Figure 4 The figure below is a schematic diagram of drawing a graph on the target curve. Figure 4As shown, the data of the local target curve does not contain data earlier than September 2000, so the coordinates of the two points on the left side of the self-drawn rectangle in the figure cannot be calculated based on the relative position with the rectangle in the data curve, but the self-drawn rectangle can still be determined and drawn based on the coordinates of the two operating points falling in the display area, and in the rectangular frame, the part not in the display area will not be displayed, and only the part falling in the display area will be displayed in the display area. It can be understood that, depending on the target graph, the first operating point and the second operating point can specifically include multiple operating points, and corresponding multiple coordinates will also be obtained.
[0097] In an embodiment of the present application, the coordinates of the operating points are determined by the relative positions between the operating points. Therefore, as long as the coordinates of one point are determined, the coordinates of all the operating points can be calculated. When the data corresponding to some operating points in the graph exceed the data range to be displayed by the data curve, the graph drawn on the curve is displayed, which is conducive to complete information display and improves the user experience.
[0098] In an embodiment of the present application, based on the above technical solution, the target curve is composed of multiple rectangles in the display area, and the graphic information also includes the display offset of the first operating point; the above step S320, according to the position data of the first operating point and the corresponding relationship between the value range and the coordinates in the display area, determines the first coordinates of the first operating point in the display area, specifically including the following steps:
[0099] Selecting a positioning rectangle corresponding to the first operating point from a plurality of rectangles of the target curve according to the horizontal axis data in the position data of the first operating point and the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system;
[0100] The first coordinates of the first operating point in the display area are determined according to the position data of the first operating point, the coordinates of the boundary of the positioning rectangle in the display area, and the display offset of the first operating point.
[0101] In this embodiment, the target curve is composed of a plurality of rectangles in the display area. When determining the horizontal coordinate of the first operating point, the first coordinate thereof is generated according to the rectangle corresponding to the horizontal axis data of the first operating point and the distance of the first operating point relative to the rectangle boundary. Specifically, each rectangle of the target curve corresponds to one or a group of horizontal axis data in the horizontal axis of the data coordinate system and corresponds to a group of vertical axis data in the vertical axis. Still taking the curve of time and value as an example, a rectangle of the target curve may correspond to a date on the horizontal axis and to the numerical span within the date on the vertical axis. According to the horizontal axis data in the position data of the first operating point and the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system, a positioning rectangle corresponding to the first operating point may be selected from the plurality of rectangles of the target curve. For example, in the case where the horizontal axis is a date, the rectangle corresponding to the same date as the first operating point among the plurality of rectangles of the target curve is selected as the positioning rectangle. After determining the positioning rectangle, the curve graph generating device determines the first coordinate of the first operating point in the display area according to the position data of the first operating point, the coordinates of the boundary of the positioning rectangle in the display area and the display offset of the first operating point. Specifically, the boundary of the positioning rectangle can be any one or more sides of the rectangle. The coordinates of the boundary can be directly obtained after the target curve is displayed in the display area. The display offset of the first operating point is usually the offset between the first operating point and the boundary of the positioning rectangle. For ease of introduction, please refer to Figure 5 , Figure 5 Schematic diagram showing the offset in the embodiment of the present application. Figure 5 As shown, the display offset 501 is the distance between the first operating point 502 and the side of the positioning rectangle 503. The distance can be directly determined by the distance of physical coordinates, such as the number of pixels in the interval. According to the coordinates of the side of the positioning rectangle 503 and the display offset 501 between the first operating point 502 and the side of the positioning rectangle 503, the horizontal coordinate of the first operating point 502 can be determined. The vertical coordinate is similar to the horizontal coordinate. The display offset can include a horizontal axis offset and a vertical axis offset. Figure 5 Only an example of the horizontal axis offset is shown, and the vertical axis offset can be the distance between the operating point and the top or bottom of the positioning rectangle. In some embodiments, when the value range is a continuous range, the vertical coordinate of the first operating point can also be determined according to the ratio between the vertical axis data of the first operating point and the vertical axis value range displayed in the display area. The two methods of generating coordinates, namely, determining the vertical coordinate according to the offset and determining the vertical coordinate according to the vertical axis data, can be used in combination. For example, the horizontal coordinate is calculated by the horizontal axis offset and the coordinates of the positioning rectangle boundary, while the vertical coordinate is determined according to the ratio between the vertical axis data of the first operating point and the value range.
[0102] It is understandable that in the above-mentioned embodiment, the widths of the multiple rectangles of the target curve are usually equal. In the case of different rectangle widths, the width of the rectangle is further recorded in the graphic data, and when the horizontal axis offset is used to determine the coordinates, the size of the horizontal axis offset is adjusted according to the ratio between the recorded rectangle width and the width of the current positioning rectangle. In general, the origin of the horizontal and vertical coordinates in the display area is the same point as the origin of the data coordinate system of the target curve, for example, both are in the lower left corner of the display area. In the case of different origins, the coordinate system deviation between the two coordinate systems is further recorded in the graphic information, and the coordinate is corrected according to the coordinate system deviation when determining the first coordinate.
[0103] In an embodiment of the present application, the corresponding positioning rectangle is found through the operating point, and the coordinates of the operating point are determined according to the deviation between the operating point and the boundary of the positioning rectangle, which is beneficial to the accuracy of the position of the coordinates of the operating point relative to the target curve.
[0104] In an embodiment of the present application, based on the above technical solution, the above steps, according to the position data of the first operating point, the coordinates of the boundary of the positioning rectangle in the display area, and the display offset of the first operating point, determine the first coordinates of the first operating point in the display area, and specifically include the following steps:
[0105] Calculate the vertical coordinate of the first operating point in the display area according to the vertical axis data in the position data of the first operating point and the maximum value and the minimum value of the value range of the target curve on the vertical axis of the data coordinate system;
[0106] The horizontal coordinate of the boundary of the positioning rectangle in the display area and the display offset of the first operating point are summed as the horizontal coordinate of the first operating point in the display area to obtain a first coordinate.
[0107] In this embodiment, the ordinate of the first operating point can be determined according to the position information of the first operating point, and the abscissa is determined according to the coordinates of the positioning rectangle. Specifically, for the ordinate, the curve graph generating device calculates the ordinate of the first operating point in the display area according to the ratio between the ordinate data in the position data of the first operating point and the maximum and minimum values of the value range of the target curve on the ordinate of the data coordinate system. Specifically, after the target curve is displayed in the display area, the maximum and minimum values of the value range of the target curve on the ordinate are also determined to have corresponding ordinates, so as to determine the ordinate of the first operating point according to the ratio of the position data to the value range. For example, the value range of the ordinate limited in the display area is 0 to 100, and the coordinate range in the display area is 100 to 300, that is, the ordinate data 0 corresponds to the ordinate 100, and the ordinate data 100 corresponds to the ordinate 300. If the ordinate data of the first operating point is 50, the ordinate corresponding to the first operating point is (300-100 / 100-0)*50=200. It is understandable that the calculation method of the ordinate can be performed according to other calculation methods, depending on the distribution relationship between the ordinate data and the ordinate.
[0108] For the horizontal coordinate, the curve graph generating device will sum the horizontal coordinate of the boundary of the positioning rectangle in the display area and the display offset of the first operating point, so as to obtain the horizontal coordinate of the first operating point in the display area. Depending on the positional relationship between the first operating point and the boundary of the positioning rectangle, the display offset can be a positive number or a negative number. For example, when the left boundary of the positioning rectangle is used as a reference, the display offset is usually positive, that is, the coordinates of the boundary of the positioning rectangle plus the display offset are used to obtain the horizontal coordinate of the first operating point, and if the right boundary of the positioning rectangle is used as a reference, the display offset is usually negative, that is, the coordinates of the boundary of the positioning rectangle minus the display offset. After obtaining the horizontal coordinate and the vertical coordinate of the first operating point, the first coordinate of the first operating point can be obtained.
[0109] In this embodiment, the coordinates of the operating point are determined by the offset and the position data, and a specific solution for calculating the coordinate position is provided, which is conducive to further improving the accuracy of the relative position between the coordinate position and the rectangle in the target curve.
[0110] In an embodiment of the present application, based on the above technical solution, the above steps, according to the position data of the second operating point, determine the temporary coordinates of the second operating point, specifically include the following steps:
[0111] Calculate the vertical coordinate of the second operating point in the display area according to the vertical axis data in the position data of the second operating point and the maximum value and the minimum value of the value range of the target curve on the vertical axis of the data coordinate system;
[0112] According to the comparison result of the horizontal axis data in the position data of the second operation point and the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system, the preset horizontal coordinate is used as the horizontal coordinate of the second operation point to obtain a temporary coordinate, and the comparison result indicates that there is no positioning rectangle corresponding to the horizontal axis data of the second operation point among the multiple rectangles.
[0113] In this embodiment, the ordinate of the second operating point can be determined according to the position information of the second operating point, and the abscissa is determined according to the coordinates of the positioning rectangle. Specifically, for the ordinate, the curve graph generating device calculates the ordinate of the second operating point in the display area according to the ratio between the ordinate data in the position data of the second operating point and the maximum value and the minimum value of the value range of the target curve on the ordinate of the data coordinate system. The specific method of determining the ordinate is the same as that of the ordinate of the first operating point.
[0114] For the horizontal coordinate of the second operating point, the curve graphic generation device will compare the horizontal axis data in the position data of the second operating point with the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system to obtain a comparison result. Since the position data of the second operating point is outside the value range displayed in the display area, the comparison result will indicate that there is no positioning rectangle corresponding to the horizontal axis data of the second operating point in the multiple rectangles of the target curve. The curve graphic generation device will set the horizontal coordinate of the second operating point to a preset horizontal coordinate based on the absence of the positioning rectangle indicated by the comparison result. The preset horizontal coordinate is usually a special value that is not in the display area, for example, it is set to -1. The coordinates of the special value together with the vertical coordinate constitute the temporary coordinates of the second operating point. The temporary coordinate means that the position marked by the coordinate is not the correct position of the operating point in the target graph.
[0115] In an embodiment of the present application, the coordinates of the operating point that is not in the display area are set to preset horizontal coordinates, so that corresponding coordinate values can be generated for the operating point that is not in the display area, which is conducive to improving the operability of the solution.
[0116] In an embodiment of the present application, based on the above technical solution, the above step S340, according to the first coordinates and the relative offset between the first operating point and the second operating point, converts the temporary coordinates of the second operating point into the second coordinates of the second operating point, specifically includes the following steps:
[0117] Calculate the vertical coordinate of the second operating point in the display area according to the vertical axis data in the position data of the second operating point and the maximum value and the minimum value of the value range of the target curve on the vertical axis of the data coordinate system;
[0118] Calculating an offset difference of the second operating point relative to the first operating point according to a relative offset of the second operating point and a relative offset of the first operating point;
[0119] The horizontal coordinate of the second operating point in the display area is calculated according to the offset difference and the horizontal coordinate of the first coordinate to obtain a second coordinate.
[0120] In this embodiment, the drawing device uses the offset of the second operating point relative to the first operating point to determine the second coordinate of the second operating point according to the first coordinate of the first operating point and the temporary coordinate of the second operating point. Specifically, in the temporary coordinate of the second operating point, the ordinate is determined according to the position information of the second operating point, and the coordinate is the correct coordinate of the target graphic in the pixel position coordinate system of the target display area, so it can be directly used as the ordinate of the second operating point. The abscissa in the temporary coordinate of the second operating point is a temporarily set predetermined coordinate value, such as -1. The drawing device can determine that the coordinate is not the actual coordinate of the operating point according to the predetermined coordinate value, so the offset difference of the second operating point relative to the first operating point is calculated according to the relative offset of the second operating point and the relative offset of the first operating point. As described above, the relative offset of the operating point is the offset relative to the anchor point. The anchor point is one of the operating points of the target graphic, so the difference of the offsets of the two operating points is the offset difference between the two operating points. For example, if the relative offset of the first operating point is 10 and the relative offset of the second operating point is 50, the offset difference is 40. If the first operating point is an anchor point, its relative offset is 0, and the offset of the second operating point can be directly used as the offset difference. Finally, based on the offset difference and the horizontal coordinate of the first coordinate, the horizontal coordinate of the second operating point in the display area can be calculated to obtain the second coordinate. The relative position of the second operating point and the first operating point on the horizontal coordinate determines the specific calculation method. For example, if the second operating point is closer to the origin than the first operating point, the horizontal coordinate of the second operating point is the horizontal coordinate of the first operating point minus the offset difference. If the second operating point is farther from the origin than the first operating point, the horizontal coordinate of the second operating point is the horizontal coordinate of the first operating point plus the offset difference. The converted horizontal coordinate is the actual coordinate of the second operating point of the target graphic in the display area. This horizontal coordinate is usually outside the display area.
[0121] In some embodiments, the ordinate of the second operating point can be determined according to the position information of the second operating point, and the abscissa is determined according to the coordinates of the positioning rectangle. Specifically, for the ordinate, the curve graph generating device calculates the ordinate of the second operating point in the display area according to the ratio between the ordinate data in the position data of the second operating point and the maximum value and the minimum value of the value range of the target curve on the ordinate of the data coordinate system. The specific method of determining the ordinate is the same as the method of determining the ordinates of the first operating point and the second operating point in the above embodiment.
[0122] It can be understood that in some embodiments, other situations may also exist. For example, in the temporary coordinates, the horizontal coordinate is the real coordinate, and the vertical coordinate is a predetermined special coordinate value. In this case, the deviation value on the vertical coordinate will be calculated based on the deviation value, and the vertical coordinate of the second operation point in the display area will be calculated based on the vertical coordinate of the first coordinate.
[0123] In this embodiment, the temporary coordinates are converted into the actual coordinates of the second operating point through the offset between the operating points, so that the coordinates of the second operating point can be mapped to a position outside the display area, which is conducive to correctly drawing the target graphics in the display area of the target curve and improving the integrity of information display.
[0124] In an embodiment of the present application, based on the above technical solution, before the above step S310, obtaining the graphic information corresponding to the target curve, the solution of the present application further includes the following steps:
[0125] receiving a graphic generation instruction for the target curve, wherein the graphic generation instruction includes position information of a specified position of the target graphic in the display area;
[0126] Determining the coordinates of each operating point in the target graphic in the display area according to the position information of the designated position;
[0127] Mapping the coordinates of each operating point in the target graph to the data coordinate system of the target curve to obtain position data of each operating point in the data coordinate system as the graphic information of the target graph;
[0128] The graphic information is uploaded, and the target graphic is drawn at a designated position in the display area according to the coordinates of each operating point in the display area.
[0129] In this embodiment, the graphics on the target curve are drawn according to the generation instruction. Specifically, the curve graphics generation device receives the graphics generation instruction for the target curve. The target curve is the target curve that has been displayed in the display area. The graphics generation instruction is usually an instruction generated by the user through the graphics generation operation when browsing the target curve. The user specifies the location of the generated graphics in the display area, and the terminal device adds the location information of the specified location of the target graphics in the display area to the graphics generation instruction according to the location selected by the user. The location information is usually the pixel coordinates in the display area. Subsequently, the curve graphics generation device determines the coordinates of each operating point in the target graphics in the display area according to the location information of the specified location. The shape of the target graphics is different, and the determination method of the coordinates of its operating points is different. For example, for a rectangle, it is necessary to determine the positions of at least two operating points, that is, the coordinates of the two end points of the diagonal line of the rectangle. If it is a circle, it is necessary to confirm the coordinates of the center of the circle and the coordinates of the radius end points. The method of determining the coordinates in the display area can be confirmed according to the preset data of the graphics. For example, the data of the newly generated graphics is a preset value. Specifically, for example, for a rectangle, the specified position in the display area is preset as the endpoint of the lower left corner of the newly generated rectangle, and the length and width values of the newly generated rectangle are preset values, then the coordinates of each operating point can be directly determined according to the preset data of the rectangle. After determining the coordinates, it is necessary to map the coordinates of each operating point in the target graph to the data coordinate system of the target curve, and obtain the position data of each operating point in the data coordinate system as the graphic information of the target graph. The specific mapping method can usually be a direct correspondence relationship, by setting the origin of the data coordinate system and the coordinate system of the pixel in the display area at the same position, so that the pixel position and the data coordinate system have a direct correspondence relationship, so that the position data of each operating point in the data coordinate system is directly converted according to the coordinates of each operating point in the target graph. The obtained graphic information will be uploaded to the server, so that when the user browses the target curve on other devices, the graphic information can be obtained from the server to display the target graph. The curve graphic generation device will also draw the target graph at the specified position in the display area according to the coordinates of each operating point in the display area.
[0130] In an embodiment of the present application, a target graphic is drawn at a specified position according to a graphic generation instruction, and graphic data of the target graphic is generated, so that the physical coordinates of the target graphic in the display area can be mapped to a data coordinate system, which is conducive to accurately recording the position of the target graphic.
[0131] In an embodiment of the present application, based on the above technical solution, the target curve is composed of a plurality of rectangles in the display area, and each rectangle has corresponding horizontal axis data in the data coordinate system; the above step maps the coordinates of each operating point in the target graph to the data coordinate system of the target curve to obtain the position data of each operating point in the data coordinate system, and specifically includes the following steps:
[0132] For each operating point, determining the horizontal axis position information of the operating point according to the horizontal axis data of the rectangle corresponding to the operating point in the display area;
[0133] Using the longitudinal axis data corresponding to the longitudinal coordinate of the operating point in the data coordinate system as the longitudinal axis position information of the operating point;
[0134] The coordinate difference between the coordinates of the operating point and the coordinates of the target graphic anchor point is used as the relative offset of the operating point to obtain the position data of the operating point in the data coordinate system, wherein the target graphic anchor point is one of the operating points of the target graphic.
[0135] In this embodiment, when determining the position data of each operating point, the corresponding horizontal axis data and vertical axis data are determined according to the physical coordinates of each operating point in the display area. Specifically, the target curve is composed of a plurality of rectangles in the display area, and each rectangle has corresponding horizontal axis data in the data coordinate system. For example, when the horizontal axis in the data coordinate system is a date, each rectangle of the target curve can correspond to a specific date. For each operating point, the curve graph generating device determines the horizontal axis position information of the operating point according to the horizontal axis data of the rectangle corresponding to the operating point in the display area. According to the position of the rectangle of the target curve in the display area and the coordinates of the operating point, the corresponding relationship between the two can be determined. For example, the rectangle closest to the nearest operating point in the horizontal axis direction can be used as the rectangle corresponding to the operating point. For the vertical axis position information of the operating point, the vertical axis data corresponding to the vertical coordinate in the data coordinate system can be used as the vertical axis position information of the operating point. The data coordinate system has a corresponding value range in the display area of the target curve. Therefore, each coordinate point in the display area can be converted into a corresponding value in the data coordinate system, and the value can be directly used as the vertical axis position information of the operating point. The graphics information also records the anchor point of the target graphics and the relative offset of the operating point relative to the anchor point. The anchor point is any operating point selected from the operating points of the target graphics. The relative offset of the operating point can be directly calculated based on the coordinates of the operating point in the display area and the coordinates of the anchor point in the display area. The relative offset can include the offset of the horizontal coordinate and the offset of the vertical coordinate, depending on the data content in the data coordinate system and the display logic of the target curve, or it can only include the offset of the horizontal coordinate or the vertical coordinate.
[0136] In an embodiment of the present application, the position data of each operating point in the data coordinate system is determined by mapping the coordinates of the operating point with the data on the horizontal and vertical axes in the data coordinate system, which simplifies the calculation process of the position data and helps to improve the calculation efficiency of the solution.
[0137] In an embodiment of the present application, based on the above technical solution, each rectangle of the target curve corresponds to a different horizontal axis coordinate range in the display area; the above step, according to the horizontal axis data of the rectangle corresponding to the operation point in the display area, determines the horizontal axis position information of the operation point, specifically including the following steps:
[0138] Determining a corresponding rectangle of the operating point according to a horizontal axis coordinate range within which the horizontal coordinate of the operating point in the display area falls;
[0139] The horizontal axis data of the corresponding rectangle in the data coordinate system and the display offset between the operating point and the boundary of the corresponding rectangle in the display area are used as the horizontal axis position information of the operating point.
[0140] In this embodiment, each rectangle of the target curve corresponds to a different horizontal axis coordinate range in the display area. According to the horizontal axis coordinate range in which the horizontal coordinate of the operating point in the display area falls, the rectangle closest to the operating point can be determined as the corresponding rectangle of the operating point. The width of each rectangle of the target curve is usually the same, and the rectangles are arranged adjacently and without overlap. Therefore, after the position of an operating point in the display area is determined, it usually only falls into the horizontal axis coordinate range of a rectangle. The curve graph generation device records the display offset between the operating point and the boundary of the corresponding rectangle in the display area. The selection of the rectangle boundary is usually carried out according to a predetermined unified rule, for example, all the left boundaries are selected or all the right boundaries are selected. The horizontal axis data of the corresponding rectangle in the data coordinate system is determined when the target curve is displayed in the display area. For example, if the target curve is a daily data change amount with time as the horizontal axis, each rectangle can correspond to the date of one day when displayed. The horizontal axis position information will include the horizontal axis data and the display offset, so that the horizontal axis data and the display offset can convert the horizontal axis position information into the horizontal axis coordinate when displayed.
[0141] In an embodiment of the present application, the horizontal axis position of the operating point is recorded by the horizontal axis data corresponding to the operating point and the display offset, thereby avoiding the influence of different sizes and graphic resolutions of the display area on the coordinates and improving the accuracy of the recorded position.
[0142] In an embodiment of the present application, based on the above technical solution, after the above steps of drawing the partial graphics of the target graphics falling into the display area according to the first coordinates and the second coordinates, the solution of the present application further includes the following steps:
[0143] receiving a movement instruction for the first operating point, wherein the movement instruction includes displacement information of the first operating point;
[0144] updating the first coordinate of the first operating point in the display area according to the displacement information in the movement instruction;
[0145] Determining updated position data of the first operating point in the data coordinate system according to the updated first coordinates;
[0146] The updated position data of the first operating point is uploaded, and the target graphic is redrawn in the display area according to the updated first coordinates.
[0147] After drawing the part of the graphics falling into the display area, the drawn graphics can be further modified by changing the position of the operation point in the display area. Specifically, the curve graphics generating device receives a moving instruction for the first operation point, and the moving instruction includes the displacement information of the first operation point. The displacement information is usually determined according to the user operation, for example, the displacement information is determined according to the result of the dragging operation on the operation point in the display area. The displacement information can directly include the new coordinates of the first operation point in the display area or the relative position of the moving result and other information. After receiving the moving instruction, the curve graphics generating device updates the first coordinates of the first operation point in the display area according to the displacement information in the moving instruction. For example, the new coordinates in the displacement information can be directly used to replace the original coordinates of the first operation point to become the updated first coordinates, or the new coordinates of the first operation point can be calculated according to the relative position and other information contained in the displacement information. Subsequently, according to the updated first coordinates, the curve graphics generating device can determine the updated position data of the first operation point in the data coordinate system. The specific determination method is the same as the determination method in the above embodiment. Subsequently, the curve graphics generating device uploads the updated position data of the first operation point to the server, and redraws the target graphics in the display area according to the updated first coordinates. In some embodiments, after the first operating point is displaced, it will also affect the positions of other operating points, and the curve graph generating device will also calculate the updated position data of the affected operating points and upload them to the server. For example, for a rectangle, when the position of the operating point on the diagonal line changes, it will affect one or two other operating points, and the new coordinates of the other two operating points can be calculated based on the relationship of the rectangle and the coordinates of the updated operating point and the operating point on the diagonal line that is not affected.
[0148] In the embodiment of the present application, the position data of the operating point is updated by the updated coordinates of the operating point, thereby allowing the position of the operating point to be flexibly changed, thereby improving the flexibility of the solution.
[0149] In an embodiment of the present application, based on the above technical solution, the graphic information includes multiple first operation points and multiple second operation points; the above step S340, according to the first coordinates and the relative offset between the first operation point and the second operation point, converts the temporary coordinates of the second operation point into the second coordinates of the second operation point, specifically including the following steps:
[0150] Selecting a first operating point from the plurality of first operating points as a target operating point for converting temporary coordinates;
[0151] The plurality of second operation points are traversed to convert the temporary coordinates of the second operation point into the second coordinates of the second operation point according to the first coordinates of the target operation point and the relative offset between the target operation point and the second operation point.
[0152] In this embodiment, for a scene with multiple first operating points and multiple second operating points, the curve graph generating device selects a point from the multiple first operating points as a reference point, and all the second operating points calculate their second coordinates relative to the reference point. Specifically, the curve graph generating device selects a first operating point from the multiple first operating points as the target operating point for converting temporary coordinates. The selection method can be a random selection or a predetermined regular order to select the first operating point located in the display area as the target operating point. Subsequently, the curve graph generating device traverses multiple second operating points. Corresponding to each second operating point, the multiple second operating points convert the temporary coordinates of the second operating point into the second coordinates of the second operating point according to the first coordinates of the target operating point and the relative offset between the target operating point and the second operating point. The specific conversion method is the same as that in the above embodiment.
[0153] In the embodiments of the present application, in the scenario of multiple first operating points and multiple second operating points, a specific implementation method for coordinate transformation is provided, which is conducive to the diversity of solutions.
[0154] In the embodiment of the present application, based on the above technical solution, the above step S310, obtaining the graphic information corresponding to the target curve, specifically includes the following steps:
[0155] According to the login information of the target account, obtaining and saving the graphic information of the target account for multiple data curves;
[0156] According to the target curve browsed by the target account, graphic information of the target graphic corresponding to the target curve is queried from the saved graphic information.
[0157] In this embodiment, the curve graphics generating device will download and save the graphic information in advance for use. Specifically. The curve graphics generating device obtains and saves the graphic information of the target account for multiple data curves according to the login information of the target account. The target account will draw graphics for multiple data curves, so there will be multiple data curve graphic information on the server. The curve graphics generating device will download all the graphic information from the server and save it locally, and the saving method uses the key-value pair method to associate the data curve with the graphic information. Subsequently, when the user browses the target curve in the data curve, the curve graphics generating device will query the graphic information of the target graphic corresponding to the target curve from the saved graphic information according to the target curve browsed by the target account, and then draw the corresponding graphic in the display area of the target curve according to the graphic information.
[0158] In this embodiment, by downloading and saving the graphic information, the time for drawing the graphics is shortened and the drawing efficiency is improved.
[0159] The following will introduce the overall process of the present application scheme in conjunction with specific embodiments. The overall process of the scheme includes three scenarios: creating a graph, displaying a graph, and modifying a graph. Specifically, the user clicks a button to create a certain graph in the terminal application to display the generated new graph on the application interface. For ease of introduction, please refer to Figure 6 , Figure 6 Schematic diagram of the process of creating a graphic scene in the embodiment of the present application. Figure 6As shown, in step 601, the user creates a graph by clicking the Create Graph button on the application. The client creates an incubator object of the corresponding graph, and the incubator object is responsible for generating the coordinates of the graph. Subsequently, the incubator object generates the physical coordinates of all operation points of the graph in the specified area in step 602. Subsequently, in step 603, according to the generated physical coordinates, the client generates the logical operation point object corresponding to the physical operation point. Specifically, taking the candlestick chart as an example, the date corresponding to a candlestick on the horizontal axis of the corresponding candlestick chart is calculated according to the physical X coordinate, and the offset relative to the left boundary of this candlestick (because the operation point is not necessarily aligned with the left boundary of this candlestick). The price value of the vertical axis of the corresponding candlestick chart is calculated according to the physical Y coordinate. At the same time, a certain operation point will be set as an anchor point, and the offset of other operation points relative to the anchor point will be calculated. The data of the generated logical point object will be uploaded to the server in step 604. Among them, the client will arrange the logical operation point as the first according to the anchor point, and the other operation points will generate data storage objects according to the set order and upload them to the server. At the same time, after the physical operation points are generated, in step 605, the client will draw a graph on the application interface according to the coordinate information of all physical operation points. After creating the graph, when the user logs in to the account application software and enters a curve browsing page where a graph has been drawn before, the application software will automatically display the previously drawn graph. For ease of introduction, please refer to Figure 7 , Figure 7 Schematic diagram showing the flow of graphic scenes in the embodiment of the present application. Figure 7As shown, after the application software is started in step 701, in step 702, it sends a request to the server to pull account settings (including self-drawn graphic data), and writes the graphic information fed back by the server into local storage. When the application software enters the details page of a certain curve in step 703, the self-drawn graphic information (logical operation point information) of the curve is read and converted into a physical operation point in step 704. Specifically, taking the candlestick chart as an example, the candlestick chart closest to the logical operation point can be located according to the date information of the logical operation point and the local candlestick chart information, and then the physical X coordinate of the operation point can be obtained according to the left boundary coordinates of this candlestick column and the offset data of the left boundary of the nearest candlestick in the logical operation point information. When the nearest candlestick cannot be found in the local candlestick chart, the physical X coordinate of the operation point is marked as a special value -1. According to the price information of the logical operation, and the maximum and minimum values of the price scale of the vertical axis of the candlestick chart, the physical Y coordinate of the operation point can be calculated. After all the operation points of a certain graph have calculated their X and Y coordinates using the above method, select an operation point with a valid X coordinate (not equal to -1), and traverse the X coordinates of all other operation points of the graph. If there is an operation point with an X coordinate equal to the special value -1, it means that the operation point falls in the K-line data that does not exist locally. At this time, the relative anchor point offset of the operation point and the relative anchor point offset of the previously selected operation point with a valid X coordinate are used for difference calculation, and then the X coordinate of the operation point is added to calculate the X coordinate of the operation point. Finally, in step 705, the graph can be drawn based on the physical coordinates of all the operation points. After the graph is displayed, the user can drag the operation point in the application interface to change the position of the operation point, and the graph will change accordingly. For ease of introduction, please refer to Figure 8 , Figure 8 Schematic diagram showing the process of modifying a graphic in the embodiment of the present application. Figure 8 As shown, in step 801, the details page of the curve is entered to display the self-drawn graph. In step 802, the user can drag the operation point by operating on the touch screen. The application obtains the physical coordinates of the operation point based on the coordinate information of the end point of the gesture event. Subsequently, in step 803, the coordinate information of the gesture event is updated to the coordinates of the physical operation point object of the operation point. In step 804, the logical operation point object is updated according to the latest physical operation point to generate the latest logical operation point and upload it to the server in step 805. The generation process is the same as the process in the above embodiment. At the same time, in step 806, a new graph is drawn on the application interface according to the updated physical operation point.
[0160] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0161] The following introduces the device implementation of the present application, which can be used to execute the method for generating curve graphics in the above-mentioned embodiments of the present application. Fig. 9 The following schematically shows a block diagram of a device for generating a curve graph in an embodiment of the present application. Fig. 9 As shown, the curve graph generating device 900 may mainly include:
[0162] A graphic information acquisition module 910 is used to acquire graphic information corresponding to a target curve, wherein the graphic information includes a relative offset between a first operating point and a second operating point of the target graphic and position data of the first operating point and the second operating point in the data coordinate system, wherein the position data of the first operating point is within a value range of the target curve in a display area, and the position data of the second operating point is outside the value range of the display area;
[0163] A first coordinate determination module 920, configured to determine a first coordinate of the first operating point in the display area according to the position data of the first operating point and the correspondence between the value range and the coordinates in the display area;
[0164] A temporary coordinate determination module 930, configured to determine the temporary coordinates of the second operation point according to the position data of the second operation point;
[0165] A second coordinate conversion module 940, configured to convert the temporary coordinates of the second operating point into second coordinates of the second operating point according to the first coordinates and the relative offset between the first operating point and the second operating point;
[0166] The graphics drawing module 950 is used to draw the part of the target graphics that falls into the display area according to the first coordinates and the second coordinates.
[0167] In some embodiments of the present application, based on the above technical solution, the target curve includes a plurality of rectangles in the display area, and the graphic information further includes a display offset of the first operating point; the first coordinate determination module 920 includes:
[0168] a rectangle selection unit, configured to select a positioning rectangle corresponding to the first operating point from a plurality of rectangles of the target curve according to horizontal axis data in the position data of the first operating point and horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system;
[0169] The first coordinate determining unit is used to determine the first coordinates of the first operating point in the display area according to the position data of the first operating point, the coordinates of the boundary of the positioning rectangle in the display area, and the display offset of the first operating point.
[0170] In some embodiments of the present application, based on the above technical solution, the first coordinate determination unit includes:
[0171] A first ordinate calculation subunit, configured to calculate the ordinate of the first operating point in the display area according to the ordinate data in the position data of the first operating point and the maximum and minimum values of the value range of the target curve on the ordinate of the data coordinate system;
[0172] The first horizontal coordinate calculation subunit is used to sum the horizontal coordinate of the boundary of the positioning rectangle in the display area and the display offset of the first operating point as the horizontal coordinate of the first operating point in the display area to obtain a first coordinate.
[0173] In some embodiments of the present application, based on the above technical solution, the temporary coordinate determination module 930 includes:
[0174] a temporary ordinate calculation unit, configured to calculate the ordinate of the second operating point in the display area according to the ordinate data in the position data of the second operating point and the maximum and minimum values of the value range of the target curve on the ordinate of the data coordinate system;
[0175] A temporary horizontal coordinate calculation unit is used to use the preset horizontal coordinate as the horizontal coordinate of the second operating point to obtain a temporary coordinate based on the comparison result of the horizontal axis data in the position data of the second operating point and the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system, wherein the comparison result indicates that there is no positioning rectangle corresponding to the horizontal axis data of the second operating point among the multiple rectangles.
[0176] In some embodiments of the present application, based on the above technical solution, the second coordinate conversion module 940 includes:
[0177] A second ordinate calculation unit, configured to calculate the ordinate of the second operating point in the display area according to the ordinate data in the position data of the second operating point and the maximum and minimum values of the value range of the target curve on the ordinate of the data coordinate system;
[0178] an offset difference calculation unit, configured to calculate an offset difference of the second operating point relative to the first operating point according to a relative offset of the second operating point and a relative offset of the first operating point;
[0179] The second horizontal coordinate calculation unit is used to calculate the horizontal coordinate of the second operating point in the display area according to the offset difference and the horizontal coordinate of the first coordinate to obtain a second coordinate.
[0180] In some embodiments of the present application, based on the above technical solution, the curve graph generating device 900 further includes:
[0181] A generating instruction receiving module, used for receiving a graphic generating instruction for the target curve, wherein the graphic generating instruction includes position information of a specified position of the target graphic in the display area;
[0182] A display coordinate determination module, used to determine the coordinates of each operating point in the target graphic in the display area according to the position information of the designated position;
[0183] A position data determination module, used for mapping the coordinates of each operating point in the target graph to the data coordinate system of the target curve, and obtaining the position data of each operating point in the data coordinate system as the graphic information of the target graph;
[0184] The graphic information uploading module is used to upload the graphic information and draw the target graphic at a designated position in the display area according to the coordinates of each operating point in the display area.
[0185] In some embodiments of the present application, based on the above technical solution, the target curve includes a plurality of rectangles in the display area, each rectangle having corresponding horizontal axis data in the data coordinate system; the position data determination module includes:
[0186] a horizontal axis information determination unit, configured to determine, for each operation point, horizontal axis position information of the operation point according to horizontal axis data of a rectangle corresponding to the operation point in the display area;
[0187] a vertical axis information determining unit, configured to use the vertical axis data corresponding to the vertical coordinate of the operating point in the data coordinate system as the vertical axis position information of the operating point;
[0188] A relative offset determination unit is used to use the coordinate difference between the coordinates of the operating point and the coordinates of the target graphic anchor point as the relative offset of the operating point to obtain the position data of the operating point in the data coordinate system, wherein the target graphic anchor point is one of the operating points of the target graphic.
[0189] In some embodiments of the present application, based on the above technical solution, each rectangle of the target curve corresponds to a different horizontal axis coordinate range in the display area; the horizontal axis information determination unit includes:
[0190] a corresponding rectangle determining subunit, configured to determine a corresponding rectangle of the operating point according to a horizontal axis coordinate range within which the horizontal coordinate of the operating point in the display area falls;
[0191] The horizontal axis position determination subunit is used to use the horizontal axis data of the corresponding rectangle in the data coordinate system and the display offset between the operating point and the boundary of the corresponding rectangle in the display area as the horizontal axis position information of the operating point.
[0192] In some embodiments of the present application, based on the above technical solution, the curve graph generating device 900 further includes:
[0193] A movement designation receiving module, configured to receive a movement instruction for the first operating point, wherein the movement instruction includes displacement information of the first operating point;
[0194] A first coordinate updating module, used for updating the first coordinate of the first operating point in the display area according to the displacement information in the movement instruction;
[0195] a position data updating module, configured to determine updated position data of the first operating point in the data coordinate system according to the updated first coordinate;
[0196] The update data uploading module is used to upload the updated position data of the first operating point and redraw the target graphic in the display area according to the updated first coordinates.
[0197] In some embodiments of the present application, based on the above technical solution, the graphic information includes a plurality of the first operating points and a plurality of the second operating points; the second coordinate conversion module 940 includes:
[0198] an operating point selection unit, configured to select a first operating point from a plurality of the first operating points as a target operating point for converting temporary coordinates;
[0199] An operation point traversal unit is used to traverse the multiple second operation points to convert the temporary coordinates of the second operation point into the second coordinates of the second operation point according to the first coordinates of the target operation point and the relative offset between the target operation point and the second operation point.
[0200] In some embodiments of the present application, based on the above technical solution, the graphic information acquisition module includes:
[0201] An information acquisition unit, configured to acquire and save graphic information of the target account for a plurality of data curves according to login information of the target account;
[0202] The information query unit is used to query the graphic information of the target graph corresponding to the target curve from the saved graphic information according to the target curve browsed by the target account.
[0203] It should be noted that the apparatus provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0204] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0205] It should be noted that Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0206] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003. Various programs and data required for system operation are also stored in the RAM 1003. The CPU 1001, the ROM 1002 and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0207] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0208] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.
[0209] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0210] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0211] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0212] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0213] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0214] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for generating a curve graph, characterized in that: include: Acquire graphic information corresponding to a target curve, the graphic information including a relative offset between a first operating point and a second operating point of the target graph and position data of the first operating point and the second operating point in the data coordinate system, the position data of the first operating point being within a value range of the target curve in a display area, and the position data of the second operating point being outside the value range of the display area; Determine a first coordinate of the first operating point in the display area according to the position data of the first operating point and the correspondence between the value range and the coordinates in the display area; Determining temporary coordinates of the second operating point according to the position data of the second operating point and the preset coordinates corresponding to the data outside the value range; Converting the temporary coordinates of the second operating point into the second coordinates of the second operating point according to the first coordinates and the relative offset between the first operating point and the second operating point; A portion of the target graphic that falls within the display area is drawn according to the first coordinates and the second coordinates.
2. The method according to claim 1, characterized in that The target curve includes a plurality of rectangles in the display area, and the graphic information further includes a display offset of the first operating point; and determining the first coordinate of the first operating point in the display area according to the position data of the first operating point and the correspondence between the value range and the coordinates in the display area includes: Selecting a positioning rectangle corresponding to the first operating point from a plurality of rectangles of the target curve according to the horizontal axis data in the position data of the first operating point and the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system; The first coordinates of the first operating point in the display area are determined according to the position data of the first operating point, the coordinates of the boundary of the positioning rectangle in the display area, and the display offset of the first operating point.
3. The method according to claim 2, characterized in that The determining, according to the position data of the first operating point, the coordinates of the boundary of the positioning rectangle in the display area, and the display offset of the first operating point, the first coordinates of the first operating point in the display area includes: Calculate the vertical coordinate of the first operating point in the display area according to the vertical axis data in the position data of the first operating point and the maximum value and the minimum value of the value range of the target curve on the vertical axis of the data coordinate system; The horizontal coordinate of the boundary of the positioning rectangle in the display area and the display offset of the first operating point are summed as the horizontal coordinate of the first operating point in the display area to obtain a first coordinate.
4. The method according to claim 2, characterized in that: The determining the temporary coordinates of the second operating point according to the position data of the second operating point includes: Calculate the vertical coordinate of the second operating point in the display area according to the vertical axis data in the position data of the second operating point and the maximum value and the minimum value of the value range of the target curve on the vertical axis of the data coordinate system; According to the comparison result of the horizontal axis data in the position data of the second operation point and the horizontal axis data corresponding to each rectangle of the target curve in the data coordinate system, the preset horizontal coordinate is used as the horizontal coordinate of the second operation point to obtain a temporary coordinate, and the comparison result indicates that there is no positioning rectangle corresponding to the horizontal axis data of the second operation point among the multiple rectangles.
5. The method according to claim 1, characterized in that The converting the temporary coordinates of the second operating point into the second coordinates of the second operating point according to the first coordinates and the relative offset between the first operating point and the second operating point includes: Calculate the vertical coordinate of the second operating point in the display area according to the vertical axis data in the position data of the second operating point and the maximum value and the minimum value of the value range of the target curve on the vertical axis of the data coordinate system; Calculating an offset difference of the second operating point relative to the first operating point according to a relative offset of the second operating point and a relative offset of the first operating point; The horizontal coordinate of the second operating point in the display area is calculated according to the offset difference and the horizontal coordinate of the first coordinate to obtain a second coordinate.
6. The method according to claim 1, characterized in that Before obtaining the graphic information corresponding to the target curve, the method further includes: receiving a graphic generation instruction for the target curve, wherein the graphic generation instruction includes position information of a specified position of the target graphic in the display area; Determining the coordinates of each operating point in the target graphic in the display area according to the position information of the designated position; Mapping the coordinates of each operating point in the target graph to the data coordinate system of the target curve to obtain position data of each operating point in the data coordinate system as the graphic information of the target graph; The graphic information is uploaded, and the target graphic is drawn at a designated position in the display area according to the coordinates of each operating point in the display area.
7. The method according to claim 6, characterized in that The target curve includes a plurality of rectangles in the display area, each rectangle having corresponding horizontal axis data in the data coordinate system; mapping the coordinates of each operating point in the target graph to the data coordinate system of the target curve to obtain the position data of each operating point in the data coordinate system includes: For each operating point, determining the horizontal axis position information of the operating point according to the horizontal axis data of the rectangle corresponding to the operating point in the display area; Using the longitudinal axis data corresponding to the longitudinal coordinate of the operating point in the data coordinate system as the longitudinal axis position information of the operating point; The coordinate difference between the coordinates of the operating point and the coordinates of the target graphic anchor point is used as the relative offset of the operating point to obtain the position data of the operating point in the data coordinate system, wherein the target graphic anchor point is one of the operating points of the target graphic.
8. The method according to claim 7, characterized in that Each rectangle of the target curve corresponds to a different horizontal axis coordinate range in the display area; The determining the horizontal axis position information of the operating point according to the horizontal axis data of the rectangle corresponding to the operating point in the display area includes: Determining a corresponding rectangle of the operating point according to a horizontal axis coordinate range within which the horizontal coordinate of the operating point in the display area falls; The horizontal axis data of the corresponding rectangle in the data coordinate system and the display offset between the operating point and the boundary of the corresponding rectangle in the display area are used as the horizontal axis position information of the operating point.
9. The method according to claim 1, characterized in that: After drawing the portion of the target graphic that falls into the display area according to the first coordinate and the second coordinate, the method further includes: receiving a movement instruction for the first operating point, wherein the movement instruction includes displacement information of the first operating point; updating the first coordinate of the first operating point in the display area according to the displacement information in the movement instruction; Determining updated position data of the first operating point in the data coordinate system according to the updated first coordinates; The updated position data of the first operating point is uploaded, and the target graphic is redrawn in the display area according to the updated first coordinates.
10. The method according to claim 1, wherein the graphic information comprises a plurality of the first operating points and a plurality of the second operating points; and the converting the temporary coordinates of the second operating point into the second coordinates of the second operating point according to the first coordinates and the relative offset between the first operating point and the second operating point comprises: Selecting a first operating point from the plurality of first operating points as a target operating point for converting temporary coordinates; The plurality of second operation points are traversed to convert the temporary coordinates of the second operation point into the second coordinates of the second operation point according to the first coordinates of the target operation point and the relative offset between the target operation point and the second operation point.
11. The method according to any one of claims 1 to 10, wherein obtaining graphic information corresponding to the target curve comprises: According to the login information of the target account, obtaining and saving the graphic information of the target account for multiple data curves; According to the target curve browsed by the target account, graphic information of the target graphic corresponding to the target curve is queried from the saved graphic information.
12. A device for generating a curve graph, characterized in that: include: a graphics information acquisition module, configured to acquire graphics information corresponding to a target curve, wherein the graphics information includes a relative offset between a first operating point and a second operating point of the target graph and position data of the first operating point and the second operating point in the data coordinate system, wherein the position data of the first operating point is within a value range of the target curve in a display area, and the position data of the second operating point is outside the value range of the display area; A first coordinate determination module, used to determine a first coordinate of the first operating point in the display area according to the position data of the first operating point and the correspondence between the value range and the coordinates in the display area; a temporary coordinate determination module, configured to determine the temporary coordinates of the second operating point according to the position data of the second operating point; A second coordinate conversion module, configured to convert the temporary coordinates of the second operating point into second coordinates of the second operating point according to the first coordinates and a relative offset between the first operating point and the second operating point; A graphics drawing module is used to draw a portion of the target graphic that falls into the display area according to the first coordinates and the second coordinates.
13. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to execute the method for generating a curve graph as described in any one of claims 1 to 11 by executing the executable instructions.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a curve graph according to any one of claims 1 to 11 is implemented.
15. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads and executes the computer instructions from the computer-readable storage medium, so that the computer device executes the method for generating a curve graph as described in any one of claims 1 to 11.
Citation Information
Cited By
Design curved surface data processing method, device and equipment and computer readable medium
CN118864773A
Design surface data processing method, device, equipment and computer readable medium
CN118864773B
