CN117608457A - Legend moving method and device, electronic equipment and storage medium - Google Patents

Legend moving method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117608457A
CN117608457A CN202311573175.7A CN202311573175A CN117608457A CN 117608457 A CN117608457 A CN 117608457A CN 202311573175 A CN202311573175 A CN 202311573175A CN 117608457 A CN117608457 A CN 117608457A
Authority
CN
China
Prior art keywords
legend
coordinate position
axis
canvas area
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311573175.7A
Other languages
Chinese (zh)
Inventor
顾鹏云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Green Zhixing Science And Technology Innovation Co ltd
Zhejiang Geely Holding Group Co Ltd
Original Assignee
Zhejiang Green Zhixing Science And Technology Innovation Co ltd
Zhejiang Geely Holding Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Green Zhixing Science And Technology Innovation Co ltd, Zhejiang Geely Holding Group Co Ltd filed Critical Zhejiang Green Zhixing Science And Technology Innovation Co ltd
Priority to CN202311573175.7A priority Critical patent/CN117608457A/en
Publication of CN117608457A publication Critical patent/CN117608457A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a legend moving method, a legend moving device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: when a mouse marker bit used for representing an operation legend is set to be in a selected state, a first coordinate position where the mouse marker bit is currently located is obtained; determining a second coordinate position of the current upper left corner of the legend according to the canvas area where the legend is located, and determining a relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position; when the legend is moved based on the mouse, a third coordinate position of the moved mouse marker bit is obtained, subtraction is carried out on the third coordinate position and the relative coordinate position, and a fourth coordinate position of the left upper corner of the legend after the movement is obtained; and determining the target coordinate position of the upper left corner of the legend according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis, so as to improve the flexibility of legend movement.

Description

Legend moving method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for moving a legend, an electronic device, and a storage medium.
Background
QConstamplot is a powerful, flexible and easy-to-use drawing library, is widely applied to various fields, and can meet various data visualization requirements. Whether static data presentation or dynamic data detection, it provides a rich set of functions and options. Through custom styles, interactive operations, statistical analysis and the like, the data can be displayed on a user interface more intuitively and clearly.
In addition to the canvas area for displaying the data curve, a legend for displaying information such as the name, color pattern, etc. of the data curve also emerges in the canvas area. The legend obscures the data curve in the canvas area due to the variability and complexity of the curve data. In view of this, the need to have legends movable also arose.
Currently, the legend is made movable mainly by: by clicking the right-click mouse, a menu bar is provided in which a selection is made to move the legend to any one of the upper left, lower left, upper right, lower right region positions of the canvas area. However, in this moving manner, the position of the region where the legend is movable is relatively fixed, and if the position cannot be flexibly adjusted, there may be a problem that the data curve in the canvas area is blocked, and the operation manner is not convenient enough.
Disclosure of Invention
The application provides a legend moving method, a legend moving device, electronic equipment and a storage medium, which are used for improving flexibility of legend moving.
In a first aspect, a legend movement method is provided, including:
when a mouse marker bit used for representing an operation legend is set to be in a selected state, a first coordinate position where the mouse marker bit is currently located is obtained;
determining a second coordinate position of a current upper left corner of the legend according to a canvas area where the legend is located, and determining a relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position;
when the legend is moved, a third coordinate position of the moved mouse marker bit is obtained, subtraction operation is carried out on the third coordinate position and the relative coordinate position, and a fourth coordinate position of the left upper corner of the moved legend is obtained;
and determining the target coordinate position of the upper left corner after the legend moves according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis.
In the embodiment of the application, the beneficial effects are as follows:
when a mouse marker bit used for representing an operation legend is set to be in a selected state, a first coordinate position where the mouse marker bit is currently located is obtained; determining a second coordinate position of the current upper left corner of the legend according to the canvas area where the legend is located, and determining a relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position, so that the legend position can be refreshed at the position after the subsequent legends move;
when the legend is moved based on the mouse, a third coordinate position after the movement of the mouse marker bit is obtained, and subtraction is carried out on the third coordinate position and the relative coordinate position to obtain a fourth coordinate position of the upper left corner after the movement of the legend, compared with the prior art, the legend can be moved in a canvas area at will, and the flexibility of the legend movement is improved;
further, according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis, the target coordinate position of the upper left corner of the legend is determined, and the fact that the moved fourth coordinate position possibly exceeds the boundary of the canvas area is considered, so that the fourth coordinate position of the legend after movement can be corrected, the fact that the legend does not exceed the boundary of the canvas area after movement is guaranteed, and user experience is met.
Optionally, the determining, according to the canvas area where the legend is located, the second coordinate position of the current upper left corner of the legend includes:
multiplying the first position proportion of the left upper corner point in the canvas area occupied by the X axis by the width of the canvas area, and multiplying the second position proportion of the left upper corner point in the canvas area occupied by the Y axis by the height of the canvas area, so as to obtain the second coordinate position of the current left upper corner point of the legend.
Optionally, the determining the target coordinate position of the upper left corner after the legend moves according to the fourth coordinate position, and the width of the canvas area in the X axis and the height of the canvas area in the Y axis includes:
if the coordinate values of the X axis and the Y axis in the fourth coordinate position are both greater than or equal to 0, determining whether the boundary of the canvas area is exceeded or not according to the coordinate values of the X axis and the Y axis in the fourth coordinate position and the width of the legend on the X axis and the height of the legend on the Y axis;
if yes, performing difference operation on the width of the canvas area on the X axis and the width of the legend on the X axis to obtain a first difference value, performing difference operation on the height of the canvas area on the Y axis and the height of the legend on the Y axis to obtain a second difference value, and taking the first difference value and the second difference value as target coordinate positions of upper left corner points of the legend;
and if not, taking the fourth coordinate value as the target coordinate position of the upper left corner of the legend.
Optionally, the method further comprises:
and if the coordinate value in the fourth coordinate position is less than 0, assigning the coordinate value in the fourth coordinate position as a set value.
Optionally, before the obtaining the first coordinate position where the mouse flag bit is currently located, the method further includes:
setting the pattern of the mouse zone bit; or setting the moving state of the canvas area.
Optionally, the method further comprises:
when the release of the legend is detected, setting the mouse zone bit to be in an unselected state; or resetting the pattern of the mouse marker bit; or resetting the moving state of the canvas area.
In a second aspect, a legend mobile device is provided, where the device includes a setting module, an obtaining module, a relative position calculating module, and a mobile position calculating module;
the acquisition module is used for acquiring a first coordinate position where the mouse marker bit is currently located when the setting module sets the mouse marker bit used for representing the operation legend to be in a selected state;
the relative position calculation module is used for determining a second coordinate position of the current upper left corner of the legend according to a canvas area where the legend is located, and determining the current relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position;
the moving position calculating module is used for obtaining a third coordinate position of the moved mouse marker bit after the legend is moved, and performing subtraction operation on the third coordinate position and the relative coordinate position to obtain a fourth coordinate position of the upper left corner of the moved legend; and determining the target coordinate position of the upper left corner after the legend moves according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis.
Optionally, the relative position calculating module is specifically configured to:
and multiplying the first position proportion of the left upper corner point in the canvas area by the width of the canvas area, and obtaining the second coordinate position of the current left upper corner point of the legend according to the second position proportion of the left upper corner point in the canvas area, which is occupied by the Y axis, and the height of the canvas area.
Optionally, the mobile position calculating module is specifically configured to:
if the coordinate values of the X axis and the Y axis in the fourth coordinate position are both greater than or equal to 0, determining whether the boundary of the canvas area is exceeded or not according to the coordinate values of the X axis and the Y axis in the fourth coordinate position and the width of the legend on the X axis and the height of the legend on the Y axis;
if yes, performing difference operation on the width of the canvas area on the X axis and the width of the legend on the X axis to obtain a first difference value, performing difference operation on the height of the canvas area on the Y axis and the height of the legend on the Y axis to obtain a second difference value, and taking the first difference value and the second difference value as target coordinate positions of upper left corner points of the legend;
and if not, taking the fourth coordinate value as the target coordinate position of the upper left corner of the legend.
Optionally, the mobile position calculating module is further configured to:
and if the coordinate value in the fourth coordinate position is less than 0, assigning the coordinate value in the fourth coordinate position as a set value.
Optionally, the setting module is further configured to:
setting the pattern of the mouse zone bit; or setting the moving state of the canvas area.
Optionally, the setting module is further configured to:
when the release of the legend is detected, setting the mouse zone bit to be in an unselected state; or resetting the pattern of the mouse marker bit; or resetting the moving state of the canvas area.
In a third aspect, there is provided an electronic device comprising:
a memory for storing a computer program; a processor for implementing the method steps of any one of the first aspects when executing a computer program stored on the memory.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method steps of any of the first aspects.
The technical effects of each of the second to fourth aspects and the technical effects that may be achieved by each aspect are referred to above for the technical effects that may be achieved by the first aspect or each possible aspect in the first aspect, and the detailed description is not repeated here.
Drawings
FIG. 1 is a flowchart of a legend movement method according to an embodiment of the present application;
FIG. 2 is an interface diagram of a canvas area and legend for use with embodiments of the present application;
FIG. 3 is a flowchart of a complete legend movement method according to the embodiments of the present application;
fig. 4 is a schematic structural diagram of an illustration mobile device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to the accompanying drawings. The specific method of operation in the method embodiment may also be applied to the device embodiment or the system embodiment. It should be noted that "a plurality of" is understood as "at least two" in the description of the present application. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. A is connected with B, and can be represented as follows: both cases of direct connection of A and B and connection of A and B through C. In addition, in the description of the present application, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not be construed as indicating or implying a relative importance or order.
In order to further explain the technical solutions provided in the embodiments of the present application, the following details are described with reference to the accompanying drawings and the detailed description. Although the embodiments of the present application provide the method operational steps as shown in the following embodiments or figures, more or fewer operational steps may be included in the method, either on a routine or non-inventive basis. In steps where there is logically no necessary causal relationship, the execution order of the steps is not limited to the execution order provided by the embodiments of the present application. The method may be performed sequentially or and in accordance with the method shown in the embodiments or drawings when the actual process or apparatus is performed.
Fig. 1 is a flowchart of a legend moving method according to an embodiment of the present application. The flow may be performed by a legend mobile device, which may be implemented in a combination of software and/or hardware. As shown in fig. 1, the process includes the steps of:
101: when the mouse zone bit used for representing the operation legend is set to be in a selected state, a first coordinate position where the mouse zone bit is currently located is obtained.
In this step, when the legend is operated by clicking a pen with a mouse or a screen, a mouse flag bit for representing the operation legend is set to be in a selected state, so that the legend is prevented from being moved when a user touches the legend by mistake, and then a local Pos function is called to obtain a first coordinate position where the mouse flag bit is currently located.
In some embodiments, the canvas area where the legend is located is generally movable, and in order to ensure visual effect, the set Interaction function may be called to set the movement state of the canvas area to be non-draggable, so that when the subsequent legend moves, the canvas area can be prevented from moving together with the legend.
In other embodiments, the set Cursor function may be called to set the pattern (e.g., arrow shape, palm shape, triangle shape, etc.) of the mouse marker bit, so that the visual effect is better during the moving process.
102: and determining a second coordinate position of the current upper left corner of the legend according to the canvas area where the legend is located, and determining the current relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position.
In this step, the second coordinate position of the current upper left corner of the legend is determined, which may specifically be: multiplying the first position proportion of the left upper corner point occupied by the X axis in the canvas area by the width of the canvas area, and multiplying the second position proportion of the left upper corner point occupied by the Y axis in the canvas area by the height of the canvas area to obtain the second coordinate position of the current left upper corner point of the legend, so that the legend position can be refreshed at the position after the subsequent legend moves.
FIG. 2 is an interface diagram of a canvas area and a legend, as applicable to embodiments of the present application. The legend 201 in the interface diagram floats on the upper layer of the canvas area 202, the width of the canvas area 202 in the X axis is K, the height in the Y axis is H, and assuming that the first position proportion of the legend in the canvas area in the X axis is 1/3 and the second position proportion in the canvas area in the Y axis is 1/2, the second coordinate position of the current upper left corner of the legend is (1/3×k, 1/2*H) which is obtained through an instrect function.
103: and when the legend is moved, acquiring a third coordinate position of the moved mouse marker bit, and performing subtraction operation on the third coordinate position and the relative coordinate position to obtain a fourth coordinate position of the upper left corner of the moved legend.
In the step, after the legend is moved, a local Pos function can be called to obtain a third coordinate position of the moved mouse marker bit, and then the third coordinate position and the relative coordinate position are subtracted to obtain a fourth coordinate position of the left upper corner of the moved legend, so that the legend can be moved in a canvas area at will, and the flexibility of the legend movement is improved.
104: and determining the target coordinate position of the upper left corner after the legend moves according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis.
Optionally, determining the target coordinate position of the upper left corner after the legend is moved may include the following cases:
case 1: if the coordinate value in the fourth coordinate position is less than 0, which indicates that the fourth coordinate position at this time would cause the legend to exceed the boundary of the canvas area, the coordinate values in the fourth coordinate position are assigned as set values (for example, all values are assigned as 0), and the set values are used as the target coordinate positions of the upper left corner after the legend is moved, so that the legend is moved to the boundary of the canvas area.
Case 2: if the coordinate value of the X axis and the coordinate value of the Y axis in the fourth coordinate position are both greater than or equal to 0, determining whether the boundary of the canvas area is exceeded or not according to the coordinate value of the X axis and the coordinate value of the Y axis in the fourth coordinate position and the width of the legend on the X axis and the height of the Y axis; if yes, indicating that a part of the fourth coordinate position can cause the illustration to exceed the boundary of the canvas area, performing difference operation on the width of the canvas area on the X axis and the width of the illustration on the X axis to obtain a first difference value, performing difference operation on the height of the illustration on the Y axis and the height of the illustration on the Y axis to obtain a second difference value, and taking the first difference value and the second difference value as target coordinate positions of left upper corner points of the illustration; if not, the fourth coordinate position is indicated to be ensured to be in the canvas area, and the fourth coordinate position can be directly used as the target coordinate position of the upper left corner of the legend.
Optionally, determining that the boundary of the canvas area is exceeded if one of the following conditions is met:
when the coordinate value of the X-axis in the fourth coordinate position is added with the width of the legend on the X-axis, the width of the canvas area on the X-axis is larger than the width of the canvas area on the X-axis.
The Y-axis coordinate value in the fourth coordinate position plus the legend height in the Y-axis is greater than the canvas area height in the Y-axis.
When the coordinate value of the X axis plus the legend in the fourth coordinate position is greater than the width of the canvas area in the X axis, and the coordinate value of the Y axis plus the legend in the fourth coordinate position is greater than the height of the canvas area in the Y axis.
In some embodiments, after determining the target coordinate position of the upper left corner after the legend is moved, the ratio of the coordinate value of the X axis to the width of the canvas area and the ratio of the coordinate value of the Y axis to the height of the canvas area in the target coordinate position can be calculated, and then the legend position is reinserted by calling the setInsetRect function.
In the step, according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis, the fourth coordinate position can be corrected, and the situation that the boundary of the canvas area is not exceeded in the process of moving the legend is ensured, so that incomplete content displayed by the legend after moving is prevented, and the user experience is met.
In other embodiments, when the release of the legend (the legend release event) is detected, the legend movement event is characterized to be completed, at this time, the originally set mouse flag bit may be set to an unselected state to ensure that the legend position is not refreshed any more when the mouse is moved.
In the embodiment of the application, the beneficial effects are as follows:
when a mouse marker bit used for representing an operation legend is set to be in a selected state, a first coordinate position where the mouse marker bit is currently located is obtained; determining a second coordinate position of the current upper left corner of the legend according to the canvas area where the legend is located, and determining a relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position, so that the legend position can be refreshed at the position after the subsequent legends move;
when the legend is moved based on the mouse, a third coordinate position after the movement of the mouse marker bit is obtained, and subtraction is carried out on the third coordinate position and the relative coordinate position to obtain a fourth coordinate position of the upper left corner after the movement of the legend, compared with the prior art, the legend can be moved in a canvas area at will, and the flexibility of the legend movement is improved;
further, according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis, the target coordinate position of the upper left corner of the legend is determined, and the fact that the moved fourth coordinate position possibly exceeds the boundary of the canvas area is considered, so that the fourth coordinate position of the legend after movement can be corrected, the fact that the legend does not exceed the boundary of the canvas area after movement is guaranteed, and user experience is met.
Based on the method shown in fig. 1, fig. 3 is a flowchart of a complete legend moving method according to an embodiment of the present application. As shown in fig. 3, the process includes the steps of:
301: when the legend is operated through the mouse, the mouse flag bit for representing the operation legend is set to a selected state.
302: and determining a second coordinate position of the current upper left corner of the legend according to the canvas area where the legend is located, and determining the current relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position.
303: determining an event of an operation legend, if the event is a legend movement event, turning to 304, and if the event is a legend release event, turning to 310.
304: and obtaining a third coordinate position of the moved mouse marker bit, and performing subtraction operation on the third coordinate position and the relative coordinate position to obtain a fourth coordinate position of the left upper corner of the moved legend.
305: whether the coordinate value in the fourth coordinate position is greater than or equal to 0 is determined, if so, the process proceeds to 306, and if not, the process proceeds to 309.
306: and determining whether the boundary of the canvas area is exceeded according to the coordinate value of the X axis and the coordinate value of the Y axis in the fourth coordinate position, the width of the legend on the X axis and the height of the Y axis, if so, turning to 307, and if not, turning to 308.
307: and performing difference operation on the width of the canvas area on the X axis and the width of the legend on the X axis to obtain a first difference value, performing difference operation on the height of the canvas area on the Y axis and the height of the legend on the Y axis to obtain a second difference value, and taking the first difference value and the second difference value as target coordinate positions of upper left corner points of the legend.
308: and taking the fourth coordinate position as the target coordinate position of the upper left corner of the legend.
309: and assigning the coordinate value in the fourth coordinate position as a set value.
310: and setting the originally set mouse zone bit into an unselected state, resetting the pattern of the mouse zone bit if the pattern of the mouse zone bit is set in the early stage, and resetting the moving state of the canvas area if the moving state of the canvas area is set in the early stage.
Based on the same technical concept, the embodiment of the application also provides a legend moving device, which can realize the legend moving method flow in the embodiment of the application.
Fig. 4 is a schematic structural diagram of an illustration mobile device according to an embodiment of the present application. The device comprises: a setting module 401, an acquisition module 402, a relative position calculation module 403, and a mobile position calculation module 404.
The obtaining module 402 is configured to obtain a first coordinate position where a mouse flag bit used to characterize an operation legend is currently located when the setting module 401 sets the mouse flag bit to a selected state.
The relative position calculating module 403 is configured to determine, according to a canvas area where the legend is located, a second coordinate position of a current upper left corner of the legend, and determine, according to the first coordinate position and the second coordinate position, a relative coordinate position of the legend in the canvas area.
The moving position calculating module 404 is configured to obtain a third coordinate position of the moved mouse marker bit after the legend is moved, and perform subtraction operation on the third coordinate position and the relative coordinate position to obtain a fourth coordinate position of the upper left corner of the moved legend; and determining the target coordinate position of the upper left corner after the legend moves according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis.
Optionally, the relative position calculating module 403 is specifically configured to:
and multiplying the first position proportion of the left upper corner point in the canvas area by the width of the canvas area, and obtaining the second coordinate position of the current left upper corner point of the legend according to the second position proportion of the left upper corner point in the canvas area, which is occupied by the Y axis, and the height of the canvas area.
Optionally, the mobile location calculation module 404 is specifically configured to:
if the coordinate values of the X axis and the Y axis in the fourth coordinate position are both greater than or equal to 0, determining whether the boundary of the canvas area is exceeded or not according to the coordinate values of the X axis and the Y axis in the fourth coordinate position and the width of the legend on the X axis and the height of the legend on the Y axis;
if yes, performing difference operation on the width of the canvas area on the X axis and the width of the legend on the X axis to obtain a first difference value, performing difference operation on the height of the canvas area on the Y axis and the height of the legend on the Y axis to obtain a second difference value, and taking the first difference value and the second difference value as target coordinate positions of upper left corner points of the legend;
and if not, taking the fourth coordinate value as the target coordinate position of the upper left corner of the legend.
Optionally, the mobile location calculation module 404 is further configured to:
and if the coordinate value in the fourth coordinate position is less than 0, assigning the coordinate value in the fourth coordinate position as a set value.
Optionally, the setting module 401 is further configured to:
setting the pattern of the mouse zone bit; or setting the moving state of the canvas area.
Optionally, the setting module 401 is further configured to:
when the release of the legend is detected, setting the mouse zone bit to be in an unselected state; or resetting the pattern of the mouse marker bit; or resetting the moving state of the canvas area.
It should be noted that, the above device provided in the embodiment of the present application can implement all the method steps in the embodiment of the method and achieve the same technical effects, and the details of the same parts and the advantages as those of the embodiment of the method in the embodiment are not described here.
Based on the same technical concept, the embodiment of the application also provides electronic equipment, which can realize the functions of the legend mobile device.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
The embodiment of the present application does not limit the specific connection medium between the processor 501 and the memory 502, but the connection between the processor 501 and the memory 502 through the bus 500 is exemplified in fig. 5. The connection between the other components of bus 500 is shown in bold lines in fig. 5, and is merely illustrative and not limiting. Bus 500 may be divided into an address bus, a data bus, a control bus, etc., and is represented by only one thick line in fig. 5 for ease of illustration, but does not represent only one bus or one type of bus. Alternatively, the processor 501 may be referred to as a controller, and the names are not limited.
In the embodiment of the present application, the memory 502 stores instructions executable by the at least one processor 501, and the at least one processor 501 may execute a legend moving method as described above by executing the instructions stored in the memory 502. The processor 501 may implement the functions of the various modules in the apparatus shown in fig. 4.
The processor 501 is a control center of the device, and various interfaces and lines can be used to connect various parts of the entire control device, and by executing or executing instructions stored in the memory 502 and invoking data stored in the memory 502, various functions of the device and processing data can be performed to monitor the device as a whole.
In one possible design, processor 501 may include one or more processing units, and processor 501 may integrate an application processor and a modem processor, where the application processor primarily processes operating systems, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 501. In some embodiments, processor 501 and memory 502 may be implemented on the same chip, or they may be implemented separately on separate chips in some embodiments.
The processor 501 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, and may implement or perform the methods, steps and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method for moving a legend disclosed in connection with the embodiments of the present application may be directly embodied as a hardware processor or may be performed by a combination of hardware and software modules in the processor.
The memory 502, as a non-volatile computer readable storage medium, may be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The Memory 502 may include at least one type of storage medium, and may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory), magnetic Memory, magnetic disk, optical disk, and the like. Memory 502 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 502 in the present embodiment may also be circuitry or any other device capable of implementing a memory function for storing program instructions and/or data.
By programming the processor 501, code corresponding to one of the legend movement methods described in the previous embodiments may be solidified into the chip, thereby enabling the chip to perform one of the legend movement methods of the embodiment shown in fig. 1 at run-time. How to design and program the processor 501 is a technique well known to those skilled in the art, and will not be described in detail herein.
It should be noted that, the above power-on electronic device provided in the embodiment of the present application can implement all the method steps implemented in the embodiment of the method, and can achieve the same technical effects, and specific details of the same parts and beneficial effects as those of the embodiment of the method in the embodiment are not described herein.
Embodiments of the present application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform one of the legend movement methods of the above embodiments.
Embodiments of the present application also provide a computer program product which, when invoked by a computer, causes the computer to perform one of the legend movement methods of the above embodiments.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (14)

1. A legend movement method, comprising:
when a mouse marker bit used for representing an operation legend is set to be in a selected state, a first coordinate position where the mouse marker bit is currently located is obtained;
determining a second coordinate position of a current upper left corner of the legend according to a canvas area where the legend is located, and determining a relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position;
when the legend is moved, a third coordinate position of the moved mouse marker bit is obtained, subtraction operation is carried out on the third coordinate position and the relative coordinate position, and a fourth coordinate position of the left upper corner of the moved legend is obtained;
and determining the target coordinate position of the upper left corner after the legend moves according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis.
2. The method of claim 1, wherein determining the second coordinate location of the current upper left corner of the legend based on the canvas area in which the legend is located comprises:
multiplying the first position proportion of the left upper corner point in the canvas area occupied by the X axis by the width of the canvas area, and multiplying the second position proportion of the left upper corner point in the canvas area occupied by the Y axis by the height of the canvas area, so as to obtain the second coordinate position of the current left upper corner point of the legend.
3. The method of claim 1, wherein determining the target coordinate position of the upper left corner after the legend movement based on the fourth coordinate position and the width of the canvas area in the X-axis and the height in the Y-axis comprises:
if the coordinate values of the X axis and the Y axis in the fourth coordinate position are both greater than or equal to 0, determining whether the boundary of the canvas area is exceeded or not according to the coordinate values of the X axis and the Y axis in the fourth coordinate position and the width of the legend on the X axis and the height of the legend on the Y axis;
if yes, performing difference operation on the width of the canvas area on the X axis and the width of the legend on the X axis to obtain a first difference value, performing difference operation on the height of the canvas area on the Y axis and the height of the legend on the Y axis to obtain a second difference value, and taking the first difference value and the second difference value as target coordinate positions of upper left corner points of the legend;
and if not, taking the fourth coordinate value as the target coordinate position of the upper left corner of the legend.
4. The method of claim 1, wherein the method further comprises:
and if the coordinate value in the fourth coordinate position is less than 0, assigning the coordinate value in the fourth coordinate position as a set value.
5. The method of claim 1, wherein before the step of obtaining the first coordinate position where the mouse flag bit is currently located, further comprises:
setting the pattern of the mouse zone bit; or alternatively
Setting the moving state of the canvas area.
6. The method of any one of claims 1-5, further comprising:
when the release of the legend is detected, setting the mouse zone bit to be in an unselected state; or alternatively
Resetting the pattern of the mouse marker bit; or alternatively
And resetting the moving state of the canvas area.
7. The legend mobile device is characterized by comprising a setting module, an acquisition module, a relative position calculation module and a mobile position calculation module;
the acquisition module is used for acquiring a first coordinate position where the mouse marker bit is currently located when the setting module sets the mouse marker bit used for representing the operation legend to be in a selected state;
the relative position calculation module is used for determining a second coordinate position of the current upper left corner of the legend according to a canvas area where the legend is located, and determining the current relative coordinate position of the legend in the canvas area according to the first coordinate position and the second coordinate position;
the moving position calculating module is used for obtaining a third coordinate position of the moved mouse marker bit after the legend is moved, and performing subtraction operation on the third coordinate position and the relative coordinate position to obtain a fourth coordinate position of the upper left corner of the moved legend; and determining the target coordinate position of the upper left corner after the legend moves according to the fourth coordinate position, the width of the canvas area on the X axis and the height of the canvas area on the Y axis.
8. The apparatus of claim 7, wherein the relative position calculation module is configured to:
and multiplying the first position proportion of the left upper corner point in the canvas area by the width of the canvas area, and obtaining the second coordinate position of the current left upper corner point of the legend according to the second position proportion of the left upper corner point in the canvas area, which is occupied by the Y axis, and the height of the canvas area.
9. The apparatus of claim 7, wherein the mobile location calculation module is specifically configured to:
if the coordinate values of the X axis and the Y axis in the fourth coordinate position are both greater than or equal to 0, determining whether the boundary of the canvas area is exceeded or not according to the coordinate values of the X axis and the Y axis in the fourth coordinate position and the width of the legend on the X axis and the height of the legend on the Y axis;
if yes, performing difference operation on the width of the canvas area on the X axis and the width of the legend on the X axis to obtain a first difference value, performing difference operation on the height of the canvas area on the Y axis and the height of the legend on the Y axis to obtain a second difference value, and taking the first difference value and the second difference value as target coordinate positions of upper left corner points of the legend;
and if not, taking the fourth coordinate value as the target coordinate position of the upper left corner of the legend.
10. The apparatus of claim 7, wherein the mobile location calculation module is further to:
and if the coordinate value in the fourth coordinate position is less than 0, assigning the coordinate value in the fourth coordinate position as a set value.
11. The apparatus of claim 7, wherein the setup module is further to:
setting the pattern of the mouse zone bit; or alternatively
Setting the moving state of the canvas area.
12. The apparatus of any of claims 7-11, wherein the setup module is further to:
when the release of the legend is detected, setting the mouse zone bit to be in an unselected state; or alternatively
Resetting the pattern of the mouse marker bit; or alternatively
And resetting the moving state of the canvas area.
13. An electronic device, comprising:
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-6 when executing a computer program stored on said memory.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-6.
CN202311573175.7A 2023-11-22 2023-11-22 Legend moving method and device, electronic equipment and storage medium Pending CN117608457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311573175.7A CN117608457A (en) 2023-11-22 2023-11-22 Legend moving method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311573175.7A CN117608457A (en) 2023-11-22 2023-11-22 Legend moving method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117608457A true CN117608457A (en) 2024-02-27

Family

ID=89950816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311573175.7A Pending CN117608457A (en) 2023-11-22 2023-11-22 Legend moving method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117608457A (en)

Similar Documents

Publication Publication Date Title
US7415676B2 (en) Visual field changing method
US9361009B2 (en) Methods and systems for setting parameter values via radial input gestures
US20070209017A1 (en) Controlling Scroll Speed To Improve Readability
US8843892B2 (en) Visual representations of code in application development environments
US8576230B2 (en) Graph display apparatus, recording medium on which program is recorded, and graph display method
US20180121076A1 (en) Drawing processing method, drawing program, and drawing device
CN104978739A (en) Image object selection method and apparatus
US20200050349A1 (en) Electronic device and screenshot capturing method
JP2014182531A (en) Graph display device and graph display program
CN113010162A (en) Page construction method, device and equipment
CN110471700B (en) Graphic processing method, apparatus, storage medium and electronic device
CN106201255B (en) Information processing method and electronic equipment
WO2016081280A1 (en) Method and system for mouse pointer to automatically follow cursor
CN115081384B (en) EDA-based data dynamic visualization system
CN117608457A (en) Legend moving method and device, electronic equipment and storage medium
CN109407955B (en) User interface interaction method, computer device and computer readable storage medium
CN113902841A (en) Image drawing method and device, electronic equipment and readable storage medium
CN113064535A (en) Vernier display method and device for two-dimensional chart, electronic equipment and storage medium
JP6149916B2 (en) Display method, display device, and program
CN113268301A (en) Animation generation method, device, equipment and storage medium
CN112685279B (en) Script recording method, script recording device and terminal equipment
CN114063859A (en) Method for erasing graph, electronic equipment and storage medium
US9128613B2 (en) Positioning clickable hotspots on a touchscreen display
JP6369601B2 (en) Display control apparatus, display control method, and program
CN111813408A (en) View display processing method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination