[go: up one dir, main page]

CN107016710B - Coordinate axis drawing method and device - Google Patents

Coordinate axis drawing method and device Download PDF

Info

Publication number
CN107016710B
CN107016710B CN201611124503.5A CN201611124503A CN107016710B CN 107016710 B CN107016710 B CN 107016710B CN 201611124503 A CN201611124503 A CN 201611124503A CN 107016710 B CN107016710 B CN 107016710B
Authority
CN
China
Prior art keywords
scale
vector
coordinate
drawn
mark
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611124503.5A
Other languages
Chinese (zh)
Other versions
CN107016710A (en
Inventor
章伟星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201611124503.5A priority Critical patent/CN107016710B/en
Publication of CN107016710A publication Critical patent/CN107016710A/en
Application granted granted Critical
Publication of CN107016710B publication Critical patent/CN107016710B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Generation (AREA)

Abstract

The application provides a coordinate axis drawing method and device, wherein the method comprises the following steps: receiving the coordinates of a starting point and an end point of a coordinate axis to be drawn and the distance between scale marks; drawing a vector pointing from the start point coordinate to the end point coordinate; calculating the scale point coordinates of each scale mark in the coordinate axis to be drawn on the vector according to the scale mark intervals; and drawing scale marks perpendicular to the vector according to the scale point coordinates, thereby finishing the drawing of the coordinate axis. By applying the embodiment of the application, the coordinate axis is drawn based on the vector, so that the drawn coordinate axis and the coordinate system are unbound, any change of the coordinate system does not need to be considered, corresponding codes do not need to be configured, and the code amount of the drawn coordinate axis is reduced.

Description

Coordinate axis drawing method and device
Technical Field
The application relates to the technical field of internet, in particular to a coordinate axis drawing method and device.
Background
Website programmers often need to draw some images, tables, etc. in the design of web pages. A web page chart rendering engine (hereinafter simply referred to as an engine) provides such a function.
Next, take an HTML 5 Canvas, i.e., Canvas, as an example. The canvas refers to a rectangular area, and each pixel on the canvas can be controlled by a user. Generally, a canvas may have a variety of ways to draw paths, rectangles, circles, characters, and add images. To implement the above-described drawing method, the coordinate axes must first be drawn in the canvas before something else can be drawn.
In the prior art, the drawing of coordinate axes is generally based on a coordinate system. Since the coordinate system can be varied widely, e.g. transpose, reflect, rotate, translate, zoom, etc.; therefore, each time the coordinate system is changed, the corresponding coordinate axis needs to be changed, so that a code for recalculating the coordinate axis and the position of the scale mark needs to be configured for each change when the coordinate axis is drawn.
However, the coordinate system varies, and the code cannot cover all the cases, and even if the code covers all the cases, the code for drawing the coordinate axes is too large and redundant, and the maintenance is difficult.
Disclosure of Invention
The application provides a coordinate axis drawing method and device, which aim to solve the problem that codes for drawing coordinate axes are too huge and redundant in order to deal with coordinate system change in the prior art.
According to the coordinate axis drawing method provided by the embodiment of the application, the method comprises the following steps:
receiving the coordinates of a starting point and an end point of a coordinate axis to be drawn and the distance between scale marks;
drawing a vector pointing from the start point coordinate to the end point coordinate;
calculating the scale point coordinates of each scale mark in the coordinate axis to be drawn on the vector according to the scale mark intervals;
and drawing scale marks perpendicular to the vector according to the scale point coordinates, thereby finishing the drawing of the coordinate axis.
Optionally, according to the distance between the scale marks, calculating a scale point coordinate of each scale mark in the coordinate axis to be drawn on the vector, specifically including:
equally dividing the vector according to the distance between the scale marks;
and calculating the coordinate of each scale point on the averaged vector.
Optionally, according to the coordinate of the scale point, a scale line perpendicular to the vector is drawn, which specifically includes:
acquiring the length of a preset scale line;
and drawing a scale mark which is perpendicular to the vector and has the length of the scale mark by taking the scale mark coordinate as a starting point coordinate.
Optionally, according to the coordinate of the scale point, a scale line perpendicular to the vector is drawn, which specifically includes:
calculating a unit vertical vector according to the vector;
calculating the end point coordinate of the other end corresponding to the scale point coordinate in the scale line to be drawn according to the unit vertical vector and the length of the preset scale line;
and drawing a line segment of which the scale point coordinates are connected with the corresponding endpoint coordinates to obtain a scale line to be drawn and which is perpendicular to the vector.
Optionally, the drawn scale line is perpendicular to the direction of the vector, and is determined by:
acquiring a preset mark value; the marking value is used for indicating the direction of the drawn scale mark perpendicular to the vector;
and determining the direction of the scale mark perpendicular to the vector according to the mark value.
According to the device for drawing the coordinate axis provided by the embodiment of the application, the device comprises:
the receiving unit is used for receiving the coordinates of the starting point and the end point of the coordinate axis to be drawn and the distance between the scale marks;
a vector drawing unit that draws a vector pointing from the start point coordinate to the end point coordinate;
the calculating unit is used for calculating the scale point coordinates of each scale mark in the coordinate axis to be drawn on the vector according to the scale mark intervals;
and the scale mark drawing unit is used for drawing the scale marks vertical to the vector according to the scale point coordinates, so that the drawing of the coordinate axis is completed.
Optionally, the computing unit specifically includes:
the equipartition unit is used for equipartiting the vector according to the scale mark interval;
and the calculating subunit calculates the coordinates of each scale point on the averaged vector.
Optionally, the scale line drawing unit specifically includes:
the acquisition subunit acquires the length of a preset scale line;
and the drawing subunit draws the scale mark which is perpendicular to the vector and has the length of the scale mark by taking the scale mark coordinate as the starting point coordinate.
Optionally, the scale line drawing unit specifically includes:
a first calculation subunit that calculates a unit vertical vector from the vector;
the second calculating subunit calculates the end point coordinate of the other end corresponding to the scale point coordinate in the scale line to be drawn according to the unit vertical vector and the preset scale line length;
and the drawing subunit is used for drawing a line segment of which the scale point coordinates are connected with the corresponding end point coordinates to obtain a scale line to be drawn and which is perpendicular to the vector.
Optionally, the drawn scale line is perpendicular to the direction of the vector, and is determined by the following subunits:
a second obtaining subunit, for obtaining a preset mark value; the marking value is used for indicating the direction of the drawn scale mark perpendicular to the vector;
and the determining subunit determines the direction of the scale mark perpendicular to the vector according to the mark value.
In the embodiment of the application, the coordinate axis is drawn based on the vector, so that the drawn coordinate axis and the coordinate system are unbound, any change of the coordinate system does not need to be considered, corresponding codes do not need to be configured, and the code amount of the drawn coordinate axis is reduced.
Drawings
FIG. 1 is a schematic diagram of coordinate axes provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of coordinate axes in a coordinate system according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of FIG. 2 after reflection along the Y-axis;
fig. 4 is a flowchart of a coordinate axis drawing method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a vector provided by an embodiment of the present application;
FIG. 6 is a schematic view of a vector drawn from a start coordinate to an end coordinate according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a scale point on a vector provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of coordinate axes for completing the drawing according to an embodiment of the present disclosure;
FIG. 9 is a schematic view of the end point C0 at the other end of the scale point B0 provided by an embodiment of the present application;
FIG. 10 is a diagram of a canvas provided by an embodiment of the present application;
FIG. 11 is a schematic diagram of a parallel coordinate system provided by an embodiment of the present application;
fig. 12 is a hardware configuration diagram of a device in which a coordinate axis drawing apparatus provided in the present application is located;
fig. 13 is a block diagram of a coordinate axis drawing apparatus according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a schematic diagram of coordinate axes provided in the present application. The coordinate axis may generally consist of a coordinate axis 11, a number of graduation marks 12.
The graduation marks 12 are perpendicular to the coordinate axis 11 and divide the coordinate axis 11 into several segments uniformly.
As previously mentioned, the rendering of coordinate axes is generally based on a coordinate system. Since the coordinate system can be varied widely, e.g. transpose, reflect, rotate, translate, zoom, etc.; therefore, each time the coordinate system is changed, the corresponding coordinate axis also needs to be changed.
For example, a schematic diagram of coordinate axes in a coordinate system as shown in fig. 2. The coordinate system is a rectangular coordinate system, and is provided with two coordinate axes which are respectively a right horizontal coordinate axis: + X axis; upward vertical coordinate system: + Y axis. After the coordinate system in fig. 2 is reflected by the Y-axis, the coordinate system is changed to the coordinate axis after reflection as shown in fig. 3. As can be seen from the change from fig. 2 to fig. 3, since the coordinate system is changed, the horizontal coordinate axis originally from the right: + X axis, changed to the horizontal coordinate axis to the left: -an X-axis; the scale lines on the coordinate axes and the images also change correspondingly.
This requires that the coordinate axes be re-coded for each change when the coordinate axes are plotted.
However, the coordinate system varies, the code cannot cover all the conditions, and even if the code covers all the conditions, the code for drawing coordinate axes is too large and redundant, and the maintenance is difficult
In order to solve the above problem, a flowchart of a coordinate axis drawing method according to an embodiment of the present application shown in fig. 4 is described below.
The method and the device can be applied to any equipment provided with the webpage chart drawing engine. The device may be, for example, a desktop computer, a laptop computer, a tablet computer, a smart phone, a handheld computer, a personal digital assistant ("PDA"), or any other wired or wireless processor driven device.
The method may comprise the steps of:
step 210: and receiving the coordinates of the starting point and the end point of the coordinate axis to be drawn and the distance between the scale marks.
In this embodiment, in the process of drawing the coordinate axis, after the user inputs the start point coordinate, the end point coordinate, and the scale line interval of the coordinate axis to be drawn, the device may automatically draw the coordinate axis to be drawn.
Step 220: a vector is drawn from the start point coordinate to the end point coordinate.
In the related art, a vector (also referred to as a vector) may refer to a directional line segment having a magnitude and a direction.
In the vector diagram shown in fig. 5, the arrow point B is the end of the vector, and the arrow tail point a is the beginning of the vector, i.e. the vector AB, points from the point a to the point B and is marked as
Figure BDA0001175010490000061
The size of a vector is the length of the vector, i.e. the modulus of the vector, noted
Figure BDA0001175010490000062
In this embodiment, after receiving the coordinates of the start point and the end point of the coordinate axis to be drawn, the device may draw a vector pointing from the coordinate of the start point to the coordinate of the end point according to the coordinates of the start point and the end point.
For example, assume the start point coordinates are (x0, y0) and the end point coordinates are (x1, y 1);
from these two points, the corresponding vector pointing from the starting point a to the end point B can be calculated:
Figure BDA0001175010490000063
step 230: and calculating the scale point coordinates of each scale mark in the coordinate axis to be drawn on the vector according to the scale mark intervals.
As previously mentioned, the coordinate axis has graduation marks perpendicular to the coordinate axis and evenly divides the coordinate axis into several segments.
Therefore, the graduation line spacing can represent the length of each section of the coordinate axis after the division.
In this embodiment, after the vector pointing from the start coordinate to the end coordinate is drawn and the inter-scale distance of the coordinate axis to be drawn is received, the device may calculate the coordinate of the scale point of each scale line in the coordinate axis to be drawn on the vector according to the inter-scale distance.
Specifically, the step 130 may include:
a1: equally dividing the vector according to the distance between the scale marks;
a2: and calculating the coordinate of each scale point on the averaged vector.
The example in the previous step is carried forward, namely the vector is drawn with the coordinates of the starting point being (x0, y0) and the coordinates of the ending point being (x1, y1)
Figure BDA0001175010490000071
As shown in fig. 6, assume that the tick mark spacing is value.
According to the scale mark interval, the scales can be equally divided
Figure BDA0001175010490000072
The scale points on this vector can be derived as shown in fig. 7: b0, B1, B2, B3, B4, B5, B6.
Specifically, the coordinates of each scale point are calculated as follows:
calculate scale point B0 coordinate:
B0:(x0+rangeX*value,y0+rangeY*value);
wherein x0 and y0 are coordinates of the starting point A; range x is given by the following equation 1, and range y is given by the following equation 2:
var ranging x-x 1-x0 formula 1
var ranging y1-y0 equation 2
On the basis of the calculated coordinates of the scale point B0, assuming that the coordinates of the scale point B0 are (x2, y2), the coordinates of the scale point B1 are calculated:
B1:(x2+rangeX*value,y2+rangeY*value);
on the basis of the calculated coordinates of the scale point B1, assuming that the coordinates of the scale point B1 are (x3, y3), the coordinates of the scale point B2 are calculated:
B2:(x3+rangeX*value,y3+rangeY*value);
on the basis of the calculated coordinates of the scale point B2, assuming that the coordinates of the scale point B2 are (x4, y4), the coordinates of the scale point B3 are calculated:
B3:(x4+rangeX*value,y4+rangeY*value)。
after the coordinates of the scale point B2 are calculated to be (x5, y5), the coordinates of all scale points, i.e., B0(x2, y2), B2(x3, y3), B2(x4, y4), and B3(x5, y5), are obtained.
Step 240: and drawing scale marks perpendicular to the vector according to the scale point coordinates, thereby finishing the drawing of the coordinate axis.
As previously mentioned, the graduation marks are perpendicular to the coordinate axis. Therefore, after the coordinates of the scale points of each scale line on the vector are obtained through calculation, the scale lines perpendicular to the vector can be drawn according to the coordinates of the scale points, and accordingly the drawing of the coordinate axis is completed.
In this embodiment, the step 240 may specifically include:
acquiring the length of a preset scale line;
and drawing a scale mark which is perpendicular to the vector and has the length of the scale mark by taking the scale mark coordinate as a starting point coordinate.
In this embodiment, the length of the calibration line may be an empirical value preset by a human. Or may be input by the user before drawing the coordinate axes.
After the device obtains the preset length of the scale line, for each scale line coordinate, the scale line coordinate can be used as a starting point coordinate to draw the scale line which is perpendicular to the vector and has the length of the scale line length. As shown in fig. 8, the coordinate axis diagram is a schematic drawing of a coordinate axis, a drawn vector is a coordinate axis of the coordinate axis, and a drawn scale line is perpendicular to the vector.
In this embodiment, the step 240 may specifically include
Calculating a unit vertical vector according to the vector;
calculating the end point coordinate of the other end corresponding to the scale point coordinate in the scale line to be drawn according to the unit vertical vector and the length of the preset scale line;
and connecting the scale point coordinates with the corresponding end point coordinates to obtain the scale mark to be drawn, which is perpendicular to the vector.
In this embodiment, when the scale lines are drawn, after the scale point on the vector of each scale line is calculated, the end point coordinate of the other end corresponding to the scale point needs to be calculated.
Since the scale mark is perpendicular to the vector, when the scale mark is drawn, the vector can be converted into a unit vector, and the unit perpendicular vector of the vector can be calculated according to vector multiplication; and multiplying the unit vertical vector by the length of the preset scale line to obtain a vector from the scale point to the end point of the other end, wherein the vector is assumed to be an offset vector. With the vector and the coordinates of either end of the vector known, the coordinates of the other end of the vector can be obtained.
In this embodiment, taking the scale point B0 as an example, the coordinate of the end point C0 at the other end of the scale point B0 shown in fig. 9 is:
C0:(B0.x+offsetVector.x,B0.y+offsetVector.y);
wherein b0.x represents the abscissa of the scale point B0, i.e., x 2; x denotes the abscissa of the vector offsetVector;
b0.y represents the ordinate of the scale point B0, i.e. y 2; offset vector.y represents the ordinate of the vector offset vector.
In a similar manner, the first and second substrates are,
end point coordinate C1 of the other end of scale point B1: (b1.x + offset vector. x, b1.y + offset vector. y);
end point coordinate C1 of the other end of scale point B2: (b2.x + offset vector. x, b2.y + offset vector. y);
end point coordinate C1 of the other end of scale point B3: (b2.x + offset vector. x, b2.y + offset vector. y).
After calculating the end point coordinates corresponding to all the scale points, each pair of scale point coordinates and the corresponding end point coordinates can be connected to obtain the scale mark to be drawn, which is perpendicular to the vector.
According to the method and the device, the coordinate axis is drawn based on the vector, so that the drawn coordinate axis and the coordinate system are unbound, any change of the coordinate system does not need to be considered, corresponding codes do not need to be configured, and the code amount of the drawn coordinate axis is reduced.
In the above embodiment, the scale lines drawn perpendicular to the direction of the vector are determined by:
acquiring a preset mark value; the marking value is used for indicating the direction of the drawn scale mark perpendicular to the vector
And determining the direction of the scale mark perpendicular to the vector according to the mark value.
The marker value is used to indicate the direction in which the drawn tick mark is perpendicular to the vector.
In practice, the tick marks are perpendicular to the vector, and as shown, it is not certain whether the tick marks are above or below the vector. Of course, a default value may be set. For example by default, to be positioned below the vector.
In the present embodiment, a mark value for indicating a direction in which a drawn scale line is perpendicular to a vector is proposed. The marker value may be entered by a user prior to drawing the coordinate axis.
The direction of the graduation mark perpendicular to the vector can be controlled by the marking value. For example, the value 1 indicates upward, the value 2 indicates downward, and after the device acquires the preset mark value, the device can determine the direction of the graduation mark perpendicular to the vector according to the mark value.
In the prior art, the drawing of the coordinate axes depends on the position, such as the canvas schematic diagram shown in fig. 10, and the user can only draw the coordinate axes at the positions of top, bottom, left, and right of the canvas. However, for the drawing of the parallel coordinate system shown in fig. 11, since a plurality of parallel coordinate axes need to be drawn in a horizontal position, the position-based drawing method in the related art cannot draw the plurality of parallel coordinate axes at the same time.
The coordinate axis drawing method provided by the embodiment of the application does not need to depend on positions, so that the requirement of drawing a plurality of parallel coordinate axes can be met.
In the prior art, because the coordinate axes are drawn depending on the position, the coordinate axes can only be drawn at the positions of top, bottom, left, and right of the canvas, and therefore the tilted coordinate axes cannot be drawn.
In the coordinate axis drawing method provided in the embodiment of the present application, since there is no need to rely on a position or a coordinate system, as in the examples provided in the embodiments shown in fig. 6 to 9, after the user inputs the start point coordinate, the end point coordinate, and the distance between the scale lines, the drawing of an oblique coordinate axis can be completed at one time.
Corresponding to the embodiment of the coordinate axis drawing method, the application also provides an embodiment of a coordinate axis drawing device. The embodiment of the apparatus may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the device where the software implementation is located as a logical means. In terms of hardware, as shown in fig. 12, the hardware structure diagram of the device where the drawing apparatus of the present application coordinate axis is located is shown, except for the processor, the network interface, the memory, and the nonvolatile memory shown in fig. 12, the device where the apparatus is located in the embodiment may generally include other hardware according to the actual drawing function of the coordinate axis, which is not described again.
Referring to fig. 13, a block diagram of an apparatus for plotting coordinate axes provided in an embodiment of the present application includes: a receiving unit 310, a vector drawing unit 320, a calculating unit 330, and a scale line drawing unit 340.
The receiving unit 310 receives coordinates of a starting point and an end point of a coordinate axis to be drawn and a scale line interval;
a vector drawing unit 320 that draws a vector pointing from the start point coordinate to the end point coordinate;
the calculating unit 330 is configured to calculate a scale point coordinate of each scale line in the coordinate axis to be drawn on the vector according to the scale line interval;
and the scale mark drawing unit 340 draws the scale marks perpendicular to the vector according to the scale point coordinates, thereby completing the drawing of the coordinate axis.
In an alternative implementation:
the calculating unit 330 specifically includes:
the equipartition unit is used for equipartiting the vector according to the scale mark interval;
and the calculating subunit calculates the coordinates of each scale point on the averaged vector.
In an alternative implementation:
the scale line drawing unit 340 specifically includes:
the acquisition subunit acquires the length of a preset scale line;
and the drawing subunit draws the scale mark which is perpendicular to the vector and has the length of the scale mark by taking the scale mark coordinate as the starting point coordinate.
In an alternative implementation:
the scale line drawing unit 340 specifically includes:
a first calculation subunit that calculates a unit vertical vector from the vector;
the second calculating subunit calculates the end point coordinate of the other end corresponding to the scale point coordinate in the scale line to be drawn according to the unit vertical vector and the preset scale line length;
and the drawing subunit is used for drawing a line segment of which the scale point coordinates are connected with the corresponding end point coordinates to obtain a scale line to be drawn and which is perpendicular to the vector.
In an alternative implementation:
the drawn scale lines are perpendicular to the direction of the vector, and are determined by the following subunits:
a second obtaining subunit, for obtaining a preset mark value; the marking value is used for indicating the direction of the drawn scale mark perpendicular to the vector;
and the determining subunit determines the direction of the scale mark perpendicular to the vector according to the mark value.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
In summary, in the embodiment of the present application, the training platform enables at least two customer service staff to solve the problem that the customer service robot cannot solve together through a training mode, automatically determines the answer of the corresponding problem according to the fed back multiple pieces of solution information, and sends the answer and the problem to the customer service robot system after being associated. Therefore, a plurality of experts are not needed to deal with the problem which cannot be solved by the customer service robot, and extra cost is not generated due to the fact that the training personnel answer, so that the overall answer cost is reduced. On the other hand, since the problems are the latest problems and generally reflect the current hot spot problems, the answers of the problems are returned to the customer service robot system, so that the knowledge base of the customer service robot system is perfected, and the success rate of answering the questions is improved. On the other hand, for the training platform, problems which cannot be solved by the customer service robot can be used for setting questions, the problem that the question bank is slow to update is solved, and the problems sent by the customer service robot system are all problems closely related to real users, so that the service processing capacity of customer service personnel can be effectively improved, and the training effect is improved.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements 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 application is limited only by the appended claims.

Claims (8)

1. A coordinate axis drawing method is applied to equipment provided with a webpage chart drawing engine, and comprises the following steps:
a webpage chart drawing engine installed on the equipment receives the coordinates of a starting point and an end point of a coordinate axis to be drawn in a webpage canvas and the distance between scale lines;
the webpage chart drawing engine draws a vector pointing from the start point coordinate to the end point coordinate;
the webpage chart drawing engine calculates the scale point coordinates of each scale mark in the coordinate axis to be drawn on the vector according to the scale mark intervals;
the webpage chart drawing engine draws a scale mark perpendicular to the vector according to the scale point coordinate;
the webpage chart drawing engine takes the drawn vector as a coordinate axis of a coordinate axis, and adds a scale mark of the drawn vector as a scale mark of the coordinate axis into the webpage canvas, so that the drawing of the coordinate axis in the webpage canvas is completed;
wherein the drawn scale line is perpendicular to the direction of the vector, determined by:
acquiring a preset mark value; the marking value is used for indicating the direction of the drawn scale mark perpendicular to the vector;
and determining the direction of the scale mark perpendicular to the vector according to the mark value.
2. The method according to claim 1, wherein calculating coordinates of scale points of each scale line in the coordinate axis to be drawn on the vector according to the distance between the scale lines specifically comprises:
equally dividing the vector according to the distance between the scale marks;
and calculating the coordinate of each scale point on the averaged vector.
3. The method of claim 1, wherein drawing a tick mark perpendicular to the vector based on the tick mark coordinates comprises:
acquiring the length of a preset scale line;
and drawing a scale mark which is perpendicular to the vector and has the length of the scale mark by taking the scale mark coordinate as a starting point coordinate.
4. The method of claim 1, wherein drawing a tick mark perpendicular to the vector based on the tick mark coordinates comprises:
calculating a unit vertical vector according to the vector;
calculating the end point coordinate of the other end corresponding to the scale point coordinate in the scale line to be drawn according to the unit vertical vector and the length of the preset scale line;
and drawing a line segment of which the scale point coordinates are connected with the corresponding endpoint coordinates to obtain a scale line to be drawn and which is perpendicular to the vector.
5. An apparatus for drawing coordinate axes, applied to a device equipped with a web page graph drawing engine, the apparatus comprising:
the receiving unit is used for receiving the coordinates of a starting point and an end point of a coordinate axis to be drawn in the webpage canvas and the distance between scale lines by a webpage chart drawing engine installed on the equipment;
a vector drawing unit that draws a vector pointing from the start point coordinate to the end point coordinate;
the calculation unit is used for calculating the scale point coordinates of each scale mark in the coordinate axis to be drawn on the vector by the webpage chart drawing engine according to the scale mark intervals;
the webpage chart drawing engine draws a scale mark perpendicular to the vector according to the scale point coordinate;
the webpage chart drawing engine takes the drawn vector as a coordinate axis of a coordinate axis, and adds a scale mark of the drawn vector as a scale mark of the coordinate axis into the webpage canvas so as to finish drawing the coordinate axis in the webpage canvas;
wherein the drawn scale lines are perpendicular to the direction of the vector, and are determined by the following subunits:
a second obtaining subunit, for obtaining a preset mark value; the marking value is used for indicating the direction of the drawn scale mark perpendicular to the vector;
and the determining subunit determines the direction of the scale mark perpendicular to the vector according to the mark value.
6. The apparatus according to claim 5, wherein the computing unit specifically includes:
the equipartition unit is used for equipartiting the vector according to the scale mark interval;
and the calculating subunit calculates the coordinates of each scale point on the averaged vector.
7. The apparatus according to claim 5, wherein the graduation mark drawing unit specifically comprises:
the acquisition subunit acquires the length of a preset scale line;
and the drawing subunit draws the scale mark which is perpendicular to the vector and has the length of the scale mark by taking the scale mark coordinate as the starting point coordinate.
8. The apparatus according to claim 5, wherein the graduation mark drawing unit specifically comprises:
a first calculation subunit that calculates a unit vertical vector from the vector;
the second calculating subunit calculates the end point coordinate of the other end corresponding to the scale point coordinate in the scale line to be drawn according to the unit vertical vector and the preset scale line length;
and the drawing subunit is used for drawing a line segment of which the scale point coordinates are connected with the corresponding end point coordinates to obtain a scale line to be drawn and which is perpendicular to the vector.
CN201611124503.5A 2016-12-08 2016-12-08 Coordinate axis drawing method and device Active CN107016710B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611124503.5A CN107016710B (en) 2016-12-08 2016-12-08 Coordinate axis drawing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611124503.5A CN107016710B (en) 2016-12-08 2016-12-08 Coordinate axis drawing method and device

Publications (2)

Publication Number Publication Date
CN107016710A CN107016710A (en) 2017-08-04
CN107016710B true CN107016710B (en) 2021-05-18

Family

ID=59439608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611124503.5A Active CN107016710B (en) 2016-12-08 2016-12-08 Coordinate axis drawing method and device

Country Status (1)

Country Link
CN (1) CN107016710B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2918090Y (en) * 2006-05-29 2007-07-04 张鑫 Multifunctional ruler for student
CN101038153A (en) * 2007-01-15 2007-09-19 中国北方车辆研究所 Three-point scaling measuring method
WO2012132090A1 (en) * 2011-03-25 2012-10-04 株式会社日立ハイテクノロジーズ Device and method for detecting angle of rotation from normal position of image
CN103036741A (en) * 2012-12-19 2013-04-10 北京神州绿盟信息安全科技股份有限公司 Determination method and determination device of flow monitoring base line
CN104065798A (en) * 2013-03-21 2014-09-24 华为技术有限公司 Sound signal processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2918090Y (en) * 2006-05-29 2007-07-04 张鑫 Multifunctional ruler for student
CN101038153A (en) * 2007-01-15 2007-09-19 中国北方车辆研究所 Three-point scaling measuring method
WO2012132090A1 (en) * 2011-03-25 2012-10-04 株式会社日立ハイテクノロジーズ Device and method for detecting angle of rotation from normal position of image
CN103036741A (en) * 2012-12-19 2013-04-10 北京神州绿盟信息安全科技股份有限公司 Determination method and determination device of flow monitoring base line
CN104065798A (en) * 2013-03-21 2014-09-24 华为技术有限公司 Sound signal processing method and device

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
【实例】html5在canvas上绘制坐标轴:画布 绘制坐标轴 减少代码;_Slience_;《【实例】html5在canvas上绘制坐标轴:画布 绘制坐标轴 减少代码,https://blog.csdn.net/u010513756/article/details/47727047》;20150817;1-5 *
HTML5 Canvas 画图;charles_wang888;《https://blog.51cto.com/supercharles888/853611》;20120505;1-8 *
monfera .Parallel coordinates chart - design.《https://github.com/plotly/plotly.js/issues/1071》.2016, *
几何画板任意方向的坐标系怎样制作;几何画板网站;《https://www.jihehuaban.com.cn/shiyongjiqiao/renyifangxiang-zuobiaoxi.html》;20150906;1-5 *
精确绘制曲线的多功能实用程序;吴心刚;《武汉造船(武汉造船工程学会会刊)》;19890630(第3期);29-34 *

Also Published As

Publication number Publication date
CN107016710A (en) 2017-08-04

Similar Documents

Publication Publication Date Title
CN108830900B (en) Method and device for processing jitter of key point
CN110348412B (en) Key point positioning method and device, electronic equipment and storage medium
US7756364B2 (en) Digital pen and paper system
US8203576B2 (en) Method for aligning objects
CN109146932A (en) Determine the methods, devices and systems of the world coordinates of target point in image
CN111459269B (en) Augmented reality display method, system and computer readable storage medium
CN111135561A (en) Game role display method, device, storage medium and electronic equipment
CN111951348B (en) Method and device for determining frame selection area and electronic equipment
US20210064160A1 (en) Method, system and non-transitory computer-readable recording medium for supporting object control by using a 2d camera
CN106157347B (en) Resource exchange data processing method, device and system
CN107016710B (en) Coordinate axis drawing method and device
US10599322B2 (en) Display control system, display control method, and display control program for displaying content to user in consideration of position relationship with user terminal
CN110415196A (en) Method for correcting image, device, electronic equipment and readable storage medium storing program for executing
CN117669494A (en) Text line height adjusting method and device and electronic equipment
CN112801869B (en) Method, system, terminal and computer equipment for zooming map
CN110188688B (en) Posture evaluation method and device
CN115546012A (en) Mapping method, device and equipment from three-dimensional space to two-dimensional plane and storage medium
KR102399852B1 (en) Pattern correction amount calculation device, Pattern correction amount calculation method, and recording medium
CN108122240B (en) Method, device and equipment for determining target area in three-dimensional image
CN112308868B (en) A method, device, equipment and storage medium for determining jagged points on image edges
CN109410304B (en) Projection determination method, device and equipment
JP7333932B2 (en) Foundation pile bearing layer depth estimation device and method
US9342906B2 (en) Connecting method for drawing
JP2017078915A (en) Information specification device, method, and program
KR20150007824A (en) Service apparatus for providing discourse comment and method thereof

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
TA01 Transfer of patent application right

Effective date of registration: 20200922

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200922

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant