CN112966484A - Chart typesetting method and device, electronic equipment and readable storage medium - Google Patents

Chart typesetting method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112966484A
CN112966484A CN202110223340.0A CN202110223340A CN112966484A CN 112966484 A CN112966484 A CN 112966484A CN 202110223340 A CN202110223340 A CN 202110223340A CN 112966484 A CN112966484 A CN 112966484A
Authority
CN
China
Prior art keywords
chart
target
value
charts
type
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.)
Granted
Application number
CN202110223340.0A
Other languages
Chinese (zh)
Other versions
CN112966484B (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202110223340.0A priority Critical patent/CN112966484B/en
Publication of CN112966484A publication Critical patent/CN112966484A/en
Application granted granted Critical
Publication of CN112966484B publication Critical patent/CN112966484B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/183Tabulation, i.e. one-dimensional positioning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a chart typesetting method and device, electronic equipment and a readable storage medium, and belongs to the technical field of computers. The chart typesetting method comprises the following steps: receiving a first input; creating at least one target graph in response to the first input; receiving a second input; in response to the second input, typesetting the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation order of the at least one target chart and the chart type of each target chart. Through the embodiment of the application, the billboard developer can quickly typeset the chart billboard, the conditions that the typesetting efficiency is low and the effect is poor due to the unskilled typesetting of the billboard developer are avoided, and the development efficiency of the chart billboard is improved.

Description

Chart typesetting method and device, electronic equipment and readable storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a chart typesetting method and device, an electronic device and a readable storage medium.
Background
Currently, although the visualization configuration brings great convenience to the user, there are some places to be improved. In the related technology, the chart typesetting in the billboard of the visual configuration platform is basically realized by adopting the following two modes, one mode is that a billboard developer adds charts line by line, and then the size of the chart is set by inputting the length and the width, and the mode is not flexible enough and has low typesetting efficiency; the other is that the billboard developer drags and stretches the chart through a mouse to realize the typesetting of the chart, and the method is flexible to operate, but has higher requirements on the proficiency of the billboard developer, and the billboard developer with insufficient proficiency is difficult to adjust the position and the size of the chart and has lower typesetting efficiency.
Disclosure of Invention
An embodiment of the present application provides a method and an apparatus for composing a chart, an electronic device, and a readable storage medium, which can solve the problem of low efficiency of composing a chart in the related art.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a method for composing a diagram, where the method includes:
receiving a first input;
creating at least one target graph in response to the first input;
receiving a second input;
in response to the second input, typesetting the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation order of the at least one target chart and the chart type of each target chart.
In a second aspect, an embodiment of the present application provides a diagram typesetting apparatus, including:
a first receiving unit for receiving a first input;
a creation unit for creating at least one target chart in response to a first input;
a second receiving unit for receiving a second input;
and the typesetting unit is used for responding to the second input and typesetting the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation sequence of the at least one target chart and the chart type of each target chart.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, where the program or instructions, when executed by the processor, implement the steps of the chart layout method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the chart layout method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method for composing a diagram according to the first aspect.
In an embodiment of the present application, a first input is received, and at least one target chart is created in a chart drawing area in response to the first input. Further, receiving a second input, responding to the second input, and automatically typesetting the target charts in the chart drawing area according to the total number of at least one target chart in the chart drawing area, the chart type of each target chart and the creation sequence of the target charts by a certain rule, so that a billboard developer can quickly typeset the chart billboard, the situations of low typesetting efficiency and poor effect caused by unskilled typesetting of the billboard developer are avoided, and the development efficiency of the chart billboard is improved.
Drawings
FIG. 1 is a flowchart illustrating a method for composing a chart according to an embodiment of the present application;
FIG. 2 is a second flowchart illustrating a chart layout method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a rectangular plane coordinate system of a billboard rendering area according to an embodiment of the application;
FIG. 4 is a third schematic flowchart of a chart layout method according to an embodiment of the present application;
FIG. 5 is a schematic block diagram of a chart layout apparatus according to an embodiment of the present application;
fig. 6 is a block diagram schematically illustrating a structure of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The chart layout method, the chart layout device, the electronic device and the readable storage medium provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings by specific embodiments and application scenarios thereof.
An embodiment of the present application provides a method for typesetting a diagram, as shown in fig. 1, the method for typesetting a diagram includes:
step 102, receiving a first input;
104, in response to a first input, creating at least one target chart;
step 106, receiving a second input;
and 108, responding to the second input, and typesetting the at least one target chart in the chart drawing area according to the first quantity of the at least one target chart, the creation sequence of the at least one target chart and the chart type of each target chart.
In this embodiment, a first input is received, and at least one target chart is created in a chart drawing area (i.e., a kanban of a visual configuration platform) in response to the first input. Further, receiving a second input, responding to the second input, and automatically typesetting the target charts in the chart drawing area according to the total number (namely the first number) of at least one target chart in the chart drawing area, the chart type of each target chart and the creation sequence of the target charts by a certain rule, so that a kanban developer can quickly typeset the chart kanban, the situations of low typesetting efficiency and poor effect caused by unskilled typesetting of the kanban developer are avoided, and the development efficiency of the chart kanban is improved.
It should be noted that the first input and the second input may be long press input, slide input, click input, double-click input, hover input (input by a user near the touch screen), and the like, and in particular, the manner of the first input and the second input is not particularly limited in this embodiment of the application, and may be any realizable manner.
In an embodiment of the present application, the step of typesetting the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation order of the at least one target chart, and the chart type of each target chart includes: determining a second number of target graphs corresponding to each graph type according to the graph types and the first number; grouping the target charts according to the chart types and the second quantity, and respectively setting a length value and a width value for each group of target charts; and in the chart drawing area, typesetting the grouped at least one target chart according to the set length value and the set width value.
In this embodiment, a second number of the target charts corresponding to each chart type is determined, and then the target charts are grouped and labeled according to the chart types and the second number, for example, the target charts of the same type are divided into a group, and the chart type corresponding to the group and the chart number (i.e., the second number) under the group are labeled, where it is to be noted that the chart number under the group is the chart number of the chart type. Further, a length value and a width value are set for each group, that is, the length value and the width value of the target chart in the same group are the same. For example, all the target images are classified into three groups by chart type, 3 charts in the first group, 5 charts in the second group, and 4 charts in the third group, the target images in the first group are each set to the first length value a1 and the first width value b1, the second group is set to the second length value a2 and the second width value b2, and the third group is set to the third length value a3 and the third width value b 3. And finally, typesetting the grouped target charts according to the set length value and the set width value. By the mode, the same length value and the same width value are set for the charts of the same type, and then automatic typesetting is carried out, so that the typesetting efficiency is higher, and the typesetting layout of the finally obtained charts is clearer.
It should be noted that the chart types include filters, indicator cards, and other types of charts, and the other types of charts include pie charts, radar charts, bar charts, line charts, and the like.
In an embodiment of the present application, the step of grouping the target charts according to the chart types and the second number includes: determining whether the target graph has a transverse coordinate axis classification array or not according to the graph type; under the condition that the target chart has the transverse coordinate axis classification arrays, acquiring the number of the transverse coordinate axis classification arrays, and grouping the target chart according to the chart type, the second number and the number of the transverse coordinate axis classification arrays; and under the condition that the target charts do not have the transverse coordinate axis classification arrays, grouping the target charts according to the chart types and the second quantity.
In this embodiment, when the target chart has the horizontal coordinate axis classification arrays, for example, the target chart is a pie chart, a radar chart, a bar chart, a line chart, or the like, the target charts are grouped according to the chart type, the second number, and the number of the horizontal coordinate axis classification arrays, taking into consideration the number of the horizontal coordinate axis classification arrays of the target chart; when the target graphs do not have the horizontal axis classification arrays, for example, the target graphs are filters or indicator cards, the target graphs may be directly grouped according to the graph type and the second number.
By the mode, the typesetting modes of different types of target charts are distinguished according to whether the target charts have the horizontal coordinate axis classification arrays or not, so that the target charts are typeset more accurately, and the typesetting flexibility is improved.
In this embodiment of the present application, before classifying the number of arrays according to the chart type, the second number, and the horizontal coordinate axis, the method further includes: and according to a preset number threshold value, grouping the number of the horizontal coordinate axis classification arrays.
In this embodiment, when the target chart has the horizontal coordinate axis classification arrays, usually, three charts are displayed by default in each row of a billboard page, and if the target chart has a horizontal coordinate axis, the chart display effect is better when the number of the horizontal coordinate axis classification arrays of each target chart is within a preset number threshold. If the number of the charts is larger than the preset number threshold value, if three charts are displayed in each row of the billboard page, the data display of the horizontal coordinate axis of the charts is too crowded, and the viewing effect is affected. Therefore, the number of the horizontal coordinate axis classification arrays is limited to be grouped according to the preset number threshold, the situation that graphs displayed in each row are too crowded is avoided, and the viewing effect is improved.
In some embodiments, the preset number threshold may be set according to the billboard length.
In the embodiment of the present application, in the chart drawing area, the step of typesetting the at least one target chart according to the set length value and the set width value includes: determining a length value and a width value corresponding to the target chart according to the chart type or the quantity of the classification arrays according to the chart type and the transverse coordinate axis; establishing a chart coordinate array for each target chart by using the creation sequence labels, chart types, length values and width values of the target charts; and typesetting the at least one target chart in the chart drawing area according to the chart coordinate array.
In this embodiment, when typesetting a target chart, if the target chart does not have a horizontal coordinate axis classification array, determining a group corresponding to the target chart according to the chart type of the target chart, and further determining a corresponding length value and a width value of the group, that is, determining the length value and the width value of the target chart; if the target chart has the transverse coordinate axis classification arrays, determining the corresponding groups of the target chart according to the chart type of the target chart and the number of the transverse coordinate axis classification arrays, and further determining the corresponding length values and width values of the groups, namely determining the length values and the width values of the target chart. Further, after the length value and the width value of the target chart are determined, a chart coordinate array is established for each target chart by using the sequence labels of the target chart (the sequence labels of the target chart are marked when the chart is created), the chart type, the length value and the width value, that is, the coordinates of each target chart on a chart drawing area are determined, and then the target charts are typeset in the chart drawing area according to the chart coordinate array. According to the method and the device, the target chart in the chart drawing area is automatically typeset through a certain rule, so that the billboard developer can quickly typeset the chart billboard, the conditions of low typesetting efficiency and poor effect caused by unskilled typesetting of the billboard developer are avoided, and the development efficiency of the chart billboard is improved.
In the embodiment of the application, the step of establishing a chart coordinate array for each target chart by using the creation sequence labels, the chart types, the length values and the width values of the target charts comprises the following steps: for a first target chart with the sequence number as the first, recording the chart coordinates of the first target chart as first coordinates (0, 0); and forming a chart coordinate array of the first target chart by using the sequence label, the length value, the width value and the first coordinate of the first target chart.
In this embodiment, the chart coordinates of the first created first target chart are recorded as the first coordinates, that is, (0, 0), and then the sequence number, the length value, the width value, and the chart coordinates of the first target chart are combined to form the chart coordinate array of the first target chart, for example, the chart coordinate array arr of the first target chart is [ id1, L1, W1,0,0], where id1 is the sequence number of the first target chart, L1 is the length value of the first target chart, W1 is the width value of the first target chart, 0 is the abscissa of the first target chart, and 0 is the ordinate of the first target chart. By the method, the chart coordinate array of the first target chart is determined, a basis is provided for subsequent typesetting, and typesetting efficiency and accuracy are improved.
In the embodiment of the application, the step of establishing a chart coordinate array for each target chart by using the creation sequence labels, the chart types, the length values and the width values of the target charts comprises the following steps: for a second target chart sequentially numbered as Nth, under the condition that the chart type of the second target chart is the same as that of an Nth-1 th target chart, enabling the abscissa of the second target chart to be equal to the sum of the abscissa of the Nth-1 th target chart and the length value of the second target chart, and enabling the ordinate of the second target chart to be equal to the ordinate of the Nth-1 th target chart, wherein N is a positive integer greater than 1; and under the condition that the abscissa of the second target chart is less than or equal to the maximum length of the chart drawing area, forming a chart coordinate array of the second target chart by using the sequence number, the length value, the width value and the chart coordinates of the second target chart.
In this embodiment, for the second target diagram, which is not the first created target diagram, it should be noted that the second target diagram is not limited to the second created target diagram, but all the non-first created target diagrams, for example, the second created target diagram, the third created target diagram, and the like, can be defined as the second target diagram. And comparing the chart type of the second target chart with the chart type of the previous target chart of the second target chart, and if the chart types of the second target chart and the previous target chart are the same, typesetting the second target chart and the previous target chart to the same row, specifically, making the abscissa of the second target chart equal to the sum of the abscissa of the previous target chart and the length value thereof, and making the ordinate of the second target chart equal to the ordinate of the previous target chart thereof. Further, in the case that the abscissa of the second target chart is less than or equal to the maximum length of the chart drawing area, that is, the second target chart does not exceed the chart drawing area after being laid out, the sequence number, the length value, the width value, and the chart coordinates of the second target chart are combined into a chart coordinate array of the second target chart, for example, the chart coordinate array arr of the second target chart is [ id2, L2, W2, x2, y2], where id2 is the sequence number of the second target chart, L2 is the length value of the second target chart, W2 is the width value of the second target chart, x2 is the abscissa of the second target chart, and y2 is the ordinate of the second target chart. By the method, the chart coordinate array of the target chart which is not established for the first time is determined, a basis is provided for subsequent typesetting, and the typesetting efficiency and accuracy are improved.
In an embodiment of the present application, the method for composing a chart further includes: under the condition that the abscissa of the second target chart is larger than the maximum length of the chart drawing area, calculating the difference value between the maximum length of the chart drawing area and the abscissa of the (N-1) th target chart, and updating the length value of the (N-1) th target chart into the sum of the difference value and the length value of the (N-1) th target chart; the abscissa of the second target chart is made equal to 0, and the ordinate of the second target chart is made equal to the sum of the width value of the (N-1) th target chart and the width value of the second target chart.
In this embodiment, after the abscissa and the ordinate of the second target diagram are determined, if the abscissa of the second target diagram is greater than the maximum length of the diagram drawing area, that is, the second target diagram exceeds the diagram drawing area after being laid out, the length value of the previous target diagram of the second target diagram is modified, so that the row in which the previous target diagram is located is occupied, and the second target diagram is laid out to the next row. Specifically, a difference between the maximum length of the chart drawing area and the abscissa of the previous target chart is calculated, the length value of the previous target chart is updated to the sum of the difference and the length value of the previous target chart, so that the previous target chart of the second target chart occupies the row of the chart drawing area, and the abscissa of the second target chart is equal to 0, so that the ordinate of the second target chart is equal to the sum of the width value of the previous target chart and the width value of the second target chart, so that the second target chart is laid out to the next row. By the mode, the typesetting efficiency and the typesetting attractiveness are improved.
In the embodiment of the application, the step of establishing a chart coordinate array for each target chart by using the creation sequence labels, the chart types, the length values and the width values of the target charts comprises the following steps: for a third target diagram with the sequence number of Mth, under the condition that the diagram type of the third target diagram is different from that of an M-1 th target diagram, enabling the abscissa of the third target diagram to be equal to 0 and the ordinate of the third target diagram to be equal to the sum of the width value of the M-1 th target diagram and the width value of the third target diagram, wherein M is a positive integer greater than 1; and forming a chart coordinate array of the third target chart by using the sequence label, the length value, the width value and the chart coordinate of the third target chart.
In this embodiment, for the third target diagram, which is not the first created target diagram, it should be noted that the third target diagram is not limited to the third created target diagram, but all the non-first created target diagrams, for example, the second created target diagram, the third created target diagram, and the like, can be defined as the third target diagram. In the case that the chart type of the third target chart is not the same as the chart type of the previous target chart of the third target chart, the third target chart is laid out to the next row of the previous target chart (i.e. the third target chart is not laid out in the same row as the previous target chart), specifically, the abscissa of the third target chart is made equal to 0, and the ordinate of the third target chart is made equal to the sum of the width value of the previous target chart and the width value thereof. Further, the sequence number, the length value, the width value, and the chart coordinates of the third target chart are combined to form a chart coordinate array of the third target chart, for example, the chart coordinate array arr of the third target chart is [ id3, L3, W3, x3, y3], where id3 is the sequence number of the third target chart, L3 is the length value of the third target chart, W3 is the width value of the third target chart, x3 is the abscissa of the third target chart, and y3 is the ordinate of the third target chart. By the method, the chart coordinate array of the target chart which is not established for the first time is determined, a basis is provided for subsequent typesetting, and the typesetting efficiency and accuracy are improved.
In an embodiment of the present application, before receiving the first input, the method for chart layout further includes: dividing a chart drawing area into a plurality of grid units; marking a coordinate system for the chart drawing area, wherein the coordinate system takes the upper left corner of the chart drawing area as an origin, the length direction of the chart drawing area as a transverse coordinate axis and the width direction of the chart drawing area as a longitudinal coordinate axis; length values and width values of charts of different chart types are set in units of grid cells.
In this embodiment, preparation work to be performed before the chart layout is performed is defined. Specifically, the chart drawing area is rasterized, that is, the length and width of the chart drawing area are divided into cells to divide a plurality of cells. Further, a planar rectangular coordinate system is introduced into the chart drawing area, specifically, the upper left corner of the chart drawing area is set as the origin, the right (i.e., the length direction) is set as the positive direction of the lateral coordinate axis, and the downward (i.e., the width direction) is set as the positive direction of the longitudinal coordinate axis. And finally, setting initial length values and width values for charts of different chart types by taking the grid unit as a unit. By the mode, a foundation is provided for subsequent typesetting, and typesetting efficiency and accuracy are improved.
In an embodiment of the present application, a method for automatically typesetting a kanban chart based on grids is provided, as shown in fig. 2, the method includes:
and 202, rasterizing a signboard drawing area, and introducing a plane rectangular coordinate system. The method comprises the following specific steps:
(1) rasterizing the width to obtain the length of a signboard drawing area, and equally dividing the length of the signboard drawing area by 24; height rasterization, setting a grid height of 30 px. After the grid is set, the length and width of the subsequent chart are all in unit of one grid unit. For example, if the panel drawing area is 1200px long and the length of each grid cell is 1200/24 equal to 50px, assuming that the length and width of a graph is 300px × 300px, the corresponding length and width are 6 × 10 in grid cells.
(2) A rectangular plane coordinate system is introduced, and as shown in fig. 3, the upper left corner of the billboard drawing area is set as the origin, the right (i.e., the length direction) is set as the positive x-axis direction, and the downward (i.e., the width direction) is set as the positive y-axis direction.
And step 204, setting default values of the length and the width of each type of chart by taking the grid unit as a unit. The method comprises the following specific steps:
(1) chart types can be divided into three major categories, filter a, indicator card B and other types of charts C.
(2) The default minimum values of the length and width of the three major types of charts are shown in table 1.
TABLE 1
Chart type Default value (Length X Width)
Sieve separator A 24×3
Index card B 6×5
Other types of charts C 8×13
And step 206, creating a chart in the signboard drawing area according to the default values of the length, the width and the height of the chart, and marking the chart with a corresponding serial number according to the creating sequence.
And step 208, clicking an automatic typesetting button, acquiring the number of each type of chart on the signboard drawing area and the number of array elements of chart x-axis classification (categories) (it needs to be noted that the filter A and the index card B do not have the parameter), and grouping the number m of the array elements of the chart x-axis categories. Generally, each row of a page shows three charts by default (the length x the width in the grid is 8 x 13), and if the chart type with an x axis is provided by default (such as a bar chart, a line chart and the like), the value of the number m of the array elements of the x axis categories of each chart is L1[0,15], and the showing effect is better. If m >15, each row of the page also displays three charts, the data display of the x axis of the charts can be too crowded to affect the viewing effect of the charts, at this time, the width is increased appropriately, the numerical values of m can be divided into three sections of L1[0,15], L2(15, 25) and L3(25, + ∞) according to experience, the length × width respectively corresponds to L1(8 × 13), L2(16 × 13) and L3(24 × 13), like a pie chart, a radar chart and the like, m ═ 1 can be considered to belong to L1, therefore, the groups can be grouped according to the chart type × number × chart x axis categories array elements on the panel drawing area, the screener A and the index card B in Table 1 have no x axis, and only one combination A × N1 and B × N2 respectively, wherein N1 is the chart number of the screener A, and N2 is the chart number of the index card B.
Other types of charts C include two chart types, one is including x-axis, such as line chart, bar chart, there are three combinations of C × N3 × L1, C × N4 × L2, C × N5 × L3, where N3 is the number of charts of the first combination, N4 is the number of charts of the second combination, and N5 is the number of charts of the third combination; alternatively, if the x-axis is not included, such as pie charts, radar charts, then there would be a combination C × N6 × L1, where N6 is the number of charts of that combination, which could be combined with C × N3 × L1 into a combination C × N7 × L1, where N7 is the sum of the number of charts of the two combinations. In summary, the following five combinations can be obtained: a × N1, B × N2, C × N7 × L1, C × N4 × L2, C × N5 × L3.
And step 210, based on the grid unit, automatically typesetting the diagrams on the billboard drawing area according to the number of the diagrams of each type in the billboard drawing area, the default values of the length and the width of the diagrams and the number of array elements of the diagrams x-axis categories. In step 210, the combination obtained in step 208 is converted into a number of length × width by combining the default values of the length and width of each type of chart in step 204, so that a combination of the filter a is 24 × 3 × N1, a combination of the indicator card B is 6 × 5 × N2, and combinations of other chart types C are 8 × 13 × N7, 16 × 13 × N4, and 24 × 13 × N5. In summary, the following five combinations are available:
combination 1: 24 × 3 × N1;
and (3) combination 2: 6X 5 XN 2;
and (3) combination: 8X 13 XN 7;
and (4) combination: 16 × 13 × N4;
and (3) combination 5: 24 × 13 × N5.
In the following steps, the above combinations are utilized in obtaining the length value and the width value of each chart. For example, when the chart does not have x-axis classification, a corresponding combination is determined according to the type of the combination, and then a length value and a width value corresponding to the combination are determined; when the chart has x-axis classification, determining a corresponding combination according to the type of the combination and the number m of the x-axis categories array elements, and further determining a length value and a width value corresponding to the combination.
Specifically, in step 210, the charts on the billboard rendering area are automatically typeset according to the number of each type of chart in the billboard rendering area, the default values of the length and the width of the charts, and the number of array elements of the x-axis categories of the charts, as shown in fig. 4, the specific steps are as follows:
step 402, generating an array T [ [ id ] according to the creation sequence of the graphs in the signboard drawing area1,type1,L1,W1],[id2,type2,L2,W2],[id3,type3,L3,W3]......[idn,typen,Ln,Wn]]Wherein id is a creation sequence index of the chart, type is a chart type of the chart, L is a length value of the chart, W is a width value of the chart, and n is the number of the charts.
Step 404, define the following variables: array of coordinates of chart arr [ deg. ] [ alpha ]]Abscissa variable xBecome0, ordinate variable yBecome0,1 for cyclic variable i, and type for chart type variableBecomeThen, a loop is started for the array T, thereby obtaining the coordinates of the upper left corner of each chart.
Step 406, determine whether i is less than or equal to the number of elements in the array T, if yes, go to step 408, if no, end.
Step 408, determine whether i is equal to 1, if yes, go to step 410, if no, go to step 414.
Step 410, obtaining the coordinate of the upper left corner of the first chart as (0, 0), putting the creation sequence label, the length value, the width value and the coordinate of the upper left corner of the first chart into an array arr together, and obtaining the chart coordinate array arr of the first chart [ [ id ] ]1,L1,W1,0,0]]And let xBecome=L1,yBecome=W1,typeBecome=type1
In step 412, the loop variable i is increased by i + +, if 1, and the process returns to step 406.
Step 414, determine typeiWhether it is equal to typeBecomeOtherwise, go to step 416, if not, go to step 420.
Step 416, let xBecome0, and the creation order label, length value, width value, and upper left coordinate [ id ] of the charti,Li,Wi,xBecome,yBecome]Put together into an array arr to get a chart coordinate array arr of the chart and let yBecome=yBecome+Wi
Step 418, make typeBecomeIs equal to typeiAnd proceeds to step 412.
Step 420, let xBecome=xBecome+Li
Step 422, judge xBecomeIf it is greater than 24, if so, step 424 is entered, and if not, step 426 is entered.
Step 424, modify the length of the last icon to [24- (x)Become-Li) + original length value of the previous icon]Thereby filling the line, and xBecome0, and the creation order label, length value, width value, and upper left coordinate [ id ] of the charti,Li,Wi,xBecome,yBecome]Put together in array arr, then let yBecome=yBecome+WiAnd returns to step 418.
Step 426, create order label, length value, width value and upper left corner coordinate [ id ] of the charti,Li,Wi,xBecome,yBecome]Put together into an array arr to get a chart coordinate array arr of the chart and let yBecome=yBecome+WiAnd returns to step 418.
The method and the device for typesetting the chart are based on the grids, the chart in the signboard is automatically typeset according to the number of various types of charts in the signboard drawing area, the default values of the length and the width of the charts and the number of the x-axis categories array of the charts through a certain rule, so that a signboard developer can quickly typeset the signboard, the development efficiency of the signboard is improved, and the conditions of low typesetting efficiency and poor effect caused by unskilled typesetting are avoided.
The embodiment of the application can be used for typesetting the diagrams of the signboards of the visual configuration platform, and the diagrams such as Excel, word and ppt need to be typeset, and can also be automatically and quickly typeset by adopting the scheme.
It should be noted that, in the chart layout method provided in the embodiment of the present application, the execution main body may be a chart layout device, or a control module in the chart layout device, which is used for executing the method for loading the chart layout. The embodiment of the present application describes a diagram layout device provided in the embodiment of the present application, by taking an example of a method for executing loaded diagram layout by a diagram layout device.
As shown in fig. 5, the chart layout apparatus 500 includes:
a first receiving unit 502 for receiving a first input;
a creating unit 504 for creating at least one target chart in response to a first input;
a second receiving unit 506 for receiving a second input;
the typesetting unit 508 is configured to, in response to the second input, typeset the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation order of the at least one target chart, and the chart type of each target chart.
In this embodiment, a first input is received, and at least one target chart is created in a chart drawing area (i.e., a kanban of a visual configuration platform) in response to the first input. Further, receiving a second input, responding to the second input, and automatically typesetting the target charts in the chart drawing area according to the total number (namely the first number) of at least one target chart in the chart drawing area, the chart type of each target chart and the creation sequence of the target charts by a certain rule, so that a kanban developer can quickly typeset the chart kanban, the situations of low typesetting efficiency and poor effect caused by unskilled typesetting of the kanban developer are avoided, and the development efficiency of the chart kanban is improved.
In this embodiment of the application, the typesetting unit 508 is specifically configured to: determining a second number of target graphs corresponding to each graph type according to the graph types and the first number; grouping the target charts according to the chart types and the second quantity, and respectively setting a length value and a width value for each group of target charts; and in the chart drawing area, typesetting the grouped at least one target chart according to the set length value and the set width value.
In this embodiment of the application, the typesetting unit 508 is specifically configured to: determining whether the target graph has a transverse coordinate axis classification array or not according to the graph type; under the condition that the target chart has the transverse coordinate axis classification arrays, acquiring the number of the transverse coordinate axis classification arrays, and grouping the target chart according to the chart type, the second number and the number of the transverse coordinate axis classification arrays; and under the condition that the target charts do not have the transverse coordinate axis classification arrays, grouping the target charts according to the chart types and the second quantity.
In this embodiment of the application, the typesetting unit 508 is further configured to: before grouping the target charts according to the chart type, the second quantity and the quantity of the transverse coordinate axis classification arrays, grouping the quantity of the transverse coordinate axis classification arrays according to a preset quantity threshold.
In this embodiment of the application, the typesetting unit 508 is specifically configured to: determining a length value and a width value corresponding to the target chart according to the chart type or the quantity of the classification arrays according to the chart type and the transverse coordinate axis; establishing a chart coordinate array for each target chart by using the creation sequence labels, chart types, length values and width values of the target charts; and typesetting the at least one target chart in the chart drawing area according to the chart coordinate array.
In this embodiment of the application, the typesetting unit 508 is specifically configured to: recording the chart coordinates of a first target chart as first coordinates for the first target chart with the sequence label as the first one; and forming a chart coordinate array of the first target chart by using the sequence label, the length value, the width value and the first coordinate of the first target chart.
In this embodiment of the application, the typesetting unit 508 is specifically configured to: for a second target diagram sequentially labeled as Nth, under the condition that the diagram type of the second target diagram is the same as that of the Nth target diagram, enabling the abscissa of the second target diagram to be equal to the sum of the abscissa of the Nth target diagram and the length value of the second target diagram, and enabling the ordinate of the second target diagram to be equal to the ordinate of an N-1 th target diagram, wherein N is a positive integer greater than 1; and under the condition that the abscissa of the second target chart is less than or equal to the maximum length of the chart drawing area, forming a chart coordinate array of the second target chart by using the sequence number, the length value, the width value and the chart coordinates of the second target chart.
In this embodiment of the application, the typesetting unit 508 is further configured to: under the condition that the abscissa of the second target chart is larger than the maximum length of the chart drawing area, calculating the difference value between the maximum length of the chart drawing area and the abscissa of the (N-1) th target chart, and updating the length value of the (N-1) th target chart into the sum of the difference value and the length value of the (N-1) th target chart; the abscissa of the second target chart is made equal to 0, and the ordinate of the second target chart is made equal to the sum of the width value of the (N-1) th target chart and the width value of the second target chart.
In this embodiment of the application, the typesetting unit 508 is specifically configured to: for a third target diagram with the sequence number of Mth, under the condition that the diagram type of the third target diagram is different from that of an M-1 th target diagram, enabling the abscissa of the third target diagram to be equal to 0 and the ordinate of the third target diagram to be equal to the sum of the width value of the M-1 th target diagram and the width value of the third target diagram, wherein M is a positive integer greater than 1; and forming a chart coordinate array of the third target chart by using the sequence label, the length value, the width value and the chart coordinate of the third target chart.
In this embodiment of the application, the typesetting unit 508 is further configured to: dividing the chart drawing area into a plurality of grid cells before the first receiving unit receives the first input; marking a coordinate system for the chart drawing area, wherein the coordinate system takes the upper left corner of the chart drawing area as an origin, the length direction of the chart drawing area as a transverse coordinate axis and the width direction of the chart drawing area as a longitudinal coordinate axis; length values and width values of charts of different chart types are set in units of grid cells.
The diagram layout device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the Mobile electronic device may be a Mobile phone, a tablet Computer, a notebook Computer, a palm top Computer, an in-vehicle electronic device, a wearable device, an Ultra-Mobile Personal Computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-Mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (Personal Computer, PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not limited in particular.
The chart layout device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The chart typesetting device provided in the embodiment of the present application can implement each process implemented in the method embodiments of fig. 1 to fig. 4, and is not described here again to avoid repetition.
Optionally, an electronic device is further provided in this embodiment of the present application, and includes a processor 620, a memory 618, and a program or an instruction stored in the memory 618 and executable on the processor 620, where the program or the instruction is executed by the processor 620 to implement each process of the above diagram layout method embodiment, and can achieve the same technical effect, and no further description is provided here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 600 includes, but is not limited to: radio frequency unit 602, network module 604, audio output unit 606, input unit 608, sensor 610, display unit 612, user input unit 614, interface unit 616, memory 618, and processor 620.
Those skilled in the art will appreciate that the electronic device 600 may further include a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 620 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The user input unit 614 is configured to receive a first input; a processor 620 for creating at least one target graph in response to a first input; a user input unit 614, further configured to receive a second input; the processor 620 is further configured to, in response to the second input, typeset the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation order of the at least one target chart, and the chart type of each target chart.
In this embodiment, a first input is received, and at least one target chart is created in a chart drawing area (i.e., a kanban of a visual configuration platform) in response to the first input. Further, receiving a second input, responding to the second input, and automatically typesetting the target charts in the chart drawing area according to the total number (namely the first number) of at least one target chart in the chart drawing area, the chart type of each target chart and the creation sequence of the target charts by a certain rule, so that a kanban developer can quickly typeset the chart kanban, the situations of low typesetting efficiency and poor effect caused by unskilled typesetting of the kanban developer are avoided, and the development efficiency of the chart kanban is improved.
In this embodiment, the processor 620 is specifically configured to: determining a second number of target graphs corresponding to each graph type according to the graph types and the first number; grouping the target charts according to the chart types and the second quantity, and respectively setting a length value and a width value for each group of target charts; and in the chart drawing area, typesetting the grouped at least one target chart according to the set length value and the set width value.
In this embodiment, the processor 620 is specifically configured to: determining whether the target graph has a transverse coordinate axis classification array or not according to the graph type; under the condition that the target chart has the transverse coordinate axis classification arrays, acquiring the number of the transverse coordinate axis classification arrays, and grouping the target chart according to the chart type, the second number and the number of the transverse coordinate axis classification arrays; and under the condition that the target charts do not have the transverse coordinate axis classification arrays, grouping the target charts according to the chart types and the second quantity.
In this embodiment of the present application, the processor 620 is further configured to: before grouping the target charts according to the chart type, the second quantity and the quantity of the transverse coordinate axis classification arrays, grouping the quantity of the transverse coordinate axis classification arrays according to a preset quantity threshold.
In this embodiment, the processor 620 is specifically configured to: determining a length value and a width value corresponding to the target chart according to the chart type or the quantity of the classification arrays according to the chart type and the transverse coordinate axis; establishing a chart coordinate array for each target chart by using the creation sequence labels, chart types, length values and width values of the target charts; and typesetting the at least one target chart in the chart drawing area according to the chart coordinate array.
In this embodiment, the processor 620 is specifically configured to: recording the chart coordinates of a first target chart as first coordinates for the first target chart with the sequence label as the first one; and forming a chart coordinate array of the first target chart by using the sequence label, the length value, the width value and the first coordinate of the first target chart.
In this embodiment, the processor 620 is specifically configured to: for a second target chart sequentially numbered as Nth, under the condition that the chart type of the second target chart is the same as that of an Nth-1 th target chart, enabling the abscissa of the second target chart to be equal to the sum of the abscissa of the Nth-1 th target chart and the length value of the second target chart, and enabling the ordinate of the second target chart to be equal to the ordinate of the Nth-1 th target chart, wherein N is a positive integer greater than 1; and under the condition that the abscissa of the second target chart is less than or equal to the maximum length of the chart drawing area, forming a chart coordinate array of the second target chart by using the sequence number, the length value, the width value and the chart coordinates of the second target chart.
In this embodiment of the present application, the processor 620 is further configured to: under the condition that the abscissa of the second target chart is larger than the maximum length of the chart drawing area, calculating the difference value between the maximum length of the chart drawing area and the abscissa of the (N-1) th target chart, and updating the length value of the (N-1) th target chart into the sum of the difference value and the length value of the (N-1) th target chart; the abscissa of the second target chart is made equal to 0, and the ordinate of the second target chart is made equal to the sum of the width value of the (N-1) th target chart and the width value of the second target chart.
In this embodiment, the processor 620 is specifically configured to: for a third target diagram with the sequence number of Mth, under the condition that the diagram type of the third target diagram is different from that of an M-1 th target diagram, enabling the abscissa of the third target diagram to be equal to 0 and the ordinate of the third target diagram to be equal to the sum of the width value of the M-1 th target diagram and the width value of the third target diagram, wherein M is a positive integer greater than 1; and forming a chart coordinate array of the third target chart by using the sequence label, the length value, the width value and the chart coordinate of the third target chart.
In this embodiment of the present application, the processor 620 is further configured to: dividing the chart drawing area into a plurality of grid cells before the first receiving unit receives the first input; marking a coordinate system for the chart drawing area, wherein the coordinate system takes the upper left corner of the chart drawing area as an origin, the length direction of the chart drawing area as a transverse coordinate axis and the width direction of the chart drawing area as a longitudinal coordinate axis; length values and width values of charts of different chart types are set in units of grid cells.
It should be understood that, in the embodiment of the present application, the radio frequency unit 602 may be used for transceiving information or transceiving signals during a call, and in particular, receiving downlink data of a base station or sending uplink data to the base station. The radio frequency unit 602 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
The network module 604 provides wireless broadband internet access to the user, such as assisting the user in emailing, browsing web pages, and accessing streaming media.
The audio output unit 606 may convert audio data received by the radio frequency unit 602 or the network module 604 or stored in the memory 618 into an audio signal and output as sound. Also, the audio output unit 606 may also provide audio output related to a specific function performed by the electronic apparatus 600 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 606 includes a speaker, a buzzer, a receiver, and the like.
The input unit 608 is used to receive audio or video signals. The input Unit 608 may include a Graphics Processing Unit (GPU) 6082 and a microphone 6084, and the Graphics processor 6082 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 612, or stored in the memory 618 (or other storage medium), or transmitted via the radio frequency unit 602 or the network module 604. The microphone 6084 may receive sound and can process the sound into audio data, and the processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 602 in the case of a phone call mode.
The electronic device 600 also includes at least one sensor 610, such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, a motion sensor, and others.
The display unit 612 is used to display information input by a user or information provided to the user. The display unit 612 may include a display panel 6122, and the display panel 6122 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
The user input unit 614 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 614 includes a touch panel 6142 and other input devices 6144. The touch panel 6142 is also referred to as a touch screen, and can collect touch operations by a user thereon or nearby. The touch panel 6142 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 620, and receives and executes commands sent by the processor 620. Other input devices 6144 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 6142 can be overlaid on the display panel 6122, and when the touch panel 6142 detects a touch operation on or near the touch panel 6142, the touch panel is transmitted to the processor 620 to determine the type of the touch event, and then the processor 620 provides a corresponding visual output on the display panel 6122 according to the type of the touch event. The touch panel 6142 and the display panel 6122 may be provided as two separate components or may be integrated into one component.
The interface unit 616 is an interface for connecting an external device to the electronic apparatus 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 616 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 600 or may be used to transmit data between the electronic device 600 and external devices.
The memory 618 may be used to store software programs as well as various data. The memory 618 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the mobile terminal, and the like. Further, the memory 618 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
Processor 620 performs various functions of electronic device 600 and processes data by executing or executing software programs and/or modules stored within memory 618 and by invoking data stored within memory 618, thereby providing an overall monitoring of electronic device 600. Processor 620 may include one or more processing units; preferably, the processor 620 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above-mentioned method for composing a chart, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device in the above embodiment. Readable storage media, including computer-readable storage media, such as Read-Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, etc.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above-mentioned chart typesetting method embodiment, and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (16)

1. A method for composing a chart, comprising:
receiving a first input;
creating at least one target chart in response to the first input;
receiving a second input;
in response to the second input, typesetting the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation order of the at least one target chart and the chart type of each target chart.
2. The chart layout method according to claim 1, wherein the step of laying out the at least one target chart in the chart drawing area based on the first number of the at least one target chart, the creation order of the at least one target chart, and the chart type of each of the target charts, comprises:
determining a second number of the target graphs corresponding to each graph type according to the graph types and the first number;
grouping the target charts according to the chart types and the second quantity, and setting a length value and a width value for each group of target charts respectively;
and in the chart drawing area, typesetting the at least one target chart according to the set length value and the set width value.
3. The chart layout method according to claim 2, wherein the step of grouping the target charts according to the chart types and the second number comprises:
determining whether the target graph has a transverse coordinate axis classification array or not according to the graph type;
under the condition that the target chart has the transverse coordinate axis classification arrays, acquiring the number of the transverse coordinate axis classification arrays, and grouping the target charts according to the chart type, the second number and the number of the transverse coordinate axis classification arrays;
and under the condition that the target charts do not have the transverse coordinate axis classification arrays, grouping the target charts according to the chart types and the second quantity.
4. A chart layout method according to claim 3, wherein said step of laying out said at least one target chart in said chart drawing area according to said length value and said width value set includes:
determining the length value and the width value corresponding to the target chart according to the chart type or the quantity of the chart type and the transverse coordinate axis classification arrays;
establishing a chart coordinate array for each target chart by using the creation sequence labels, the chart types, the length values and the width values of the target charts;
and typesetting the at least one target chart in the chart drawing area according to the chart coordinate array.
5. The chart layout method according to claim 4, wherein the step of establishing a chart coordinate array for each of the target charts using the creation order label, the chart type, the length value and the width value of the target chart comprises:
for a first target chart with the sequence label as the first one, recording the chart coordinates of the first target chart as first coordinates;
and forming a chart coordinate array of the first target chart by using the sequence label, the length value, the width value and the first coordinate of the first target chart.
6. The chart layout method according to claim 4, wherein the step of establishing a chart coordinate array for each of the target charts using the creation order label, the chart type, the length value and the width value of the target chart comprises:
for a second target chart with the sequence number being Nth, in the case that the chart type of the second target chart is the same as the chart type of an Nth target chart, making the abscissa of the second target chart equal to the sum of the abscissa of the N-1 th target chart and the length value of the second target chart, and making the ordinate of the second target chart equal to the ordinate of the N-1 th target chart, wherein N is a positive integer greater than 1;
under the condition that the abscissa of the second target chart is smaller than or equal to the maximum length of the chart drawing area, forming a chart coordinate array of the second target chart by using the sequence number, the length value, the width value and the chart coordinates of the second target chart;
under the condition that the abscissa of the second target chart is larger than the maximum length of the chart drawing area, calculating a difference value between the maximum length of the chart drawing area and the abscissa of the (N-1) th target chart, and updating the length value of the (N-1) th target chart to be the sum of the difference value and the length value of the (N-1) th target chart;
and enabling the abscissa of the second target chart to be equal to 0, and enabling the ordinate of the second target chart to be equal to the sum of the width value of the (N-1) th target chart and the width value of the second target chart.
7. The chart layout method according to claim 4, wherein the step of establishing a chart coordinate array for each of the target charts using the creation order label, the chart type, the length value and the width value of the target chart comprises:
for a third target diagram with the sequence number of Mth, when the diagram type of the third target diagram is different from that of an M-1 th target diagram, making the abscissa of the third target diagram equal to 0, and making the ordinate of the third target diagram equal to the sum of the width value of the M-1 th target diagram and the width value of the third target diagram, wherein M is a positive integer greater than 1;
and forming a chart coordinate array of the third target chart by using the sequence label, the length value, the width value and the chart coordinate of the third target chart.
8. A chart composing apparatus, comprising:
a first receiving unit for receiving a first input;
a creation unit for creating at least one target chart in response to the first input;
a second receiving unit for receiving a second input;
and the typesetting unit is used for responding to the second input and typesetting the at least one target chart in the chart drawing area according to the first number of the at least one target chart, the creation sequence of the at least one target chart and the chart type of each target chart.
9. The chart layout apparatus according to claim 8, wherein the layout unit is specifically configured to:
determining a second number of the target graphs corresponding to each graph type according to the graph types and the first number;
grouping the target charts according to the chart types and the second quantity, and setting a length value and a width value for each group of target charts respectively;
and in the chart drawing area, typesetting the at least one target chart according to the set length value and the set width value.
10. The chart layout apparatus according to claim 9, wherein the layout unit is specifically configured to:
determining whether the target graph has a transverse coordinate axis classification array or not according to the graph type;
under the condition that the target chart has the transverse coordinate axis classification arrays, acquiring the number of the transverse coordinate axis classification arrays, and grouping the target charts according to the chart type, the second number and the number of the transverse coordinate axis classification arrays;
and under the condition that the target charts do not have the transverse coordinate axis classification arrays, grouping the target charts according to the chart types and the second quantity.
11. The chart layout apparatus according to claim 10, wherein the layout unit is specifically configured to:
determining the length value and the width value corresponding to the target chart according to the chart type or the quantity of the chart type and the transverse coordinate axis classification arrays;
establishing a chart coordinate array for each target chart by using the creation sequence labels, the chart types, the length values and the width values of the target charts;
and typesetting the at least one target chart in the chart drawing area according to the chart coordinate array.
12. The chart layout apparatus according to claim 11, wherein the layout unit is specifically configured to:
for a first target chart with the sequence label as the first one, recording the chart coordinates of the first target chart as first coordinates;
and forming a chart coordinate array of the first target chart by using the sequence label, the length value, the width value and the first coordinate of the first target chart.
13. The chart layout apparatus according to claim 11, wherein the layout unit is specifically configured to:
for a second target chart with the sequence number being Nth, in the case that the chart type of the second target chart is the same as the chart type of an Nth target chart, making the abscissa of the second target chart equal to the sum of the abscissa of the N-1 th target chart and the length value of the second target chart, and making the ordinate of the second target chart equal to the ordinate of the N-1 th target chart, wherein N is a positive integer greater than 1;
under the condition that the abscissa of the second target chart is smaller than or equal to the maximum length of the chart drawing area, forming a chart coordinate array of the second target chart by using the sequence number, the length value, the width value and the chart coordinates of the second target chart;
under the condition that the abscissa of the second target chart is larger than the maximum length of the chart drawing area, calculating a difference value between the maximum length of the chart drawing area and the abscissa of the (N-1) th target chart, and updating the length value of the (N-1) th target chart to be the sum of the difference value and the length value of the (N-1) th target chart;
and enabling the abscissa of the second target chart to be equal to 0, and enabling the ordinate of the second target chart to be equal to the sum of the width value of the (N-1) th target chart and the width value of the second target chart.
14. The chart layout apparatus according to claim 11, wherein the layout unit is specifically configured to:
for a third target diagram with the sequence number of Mth, when the diagram type of the third target diagram is different from that of an M-1 th target diagram, making the abscissa of the third target diagram equal to 0, and making the ordinate of the third target diagram equal to the sum of the width value of the M-1 th target diagram and the width value of the third target diagram, wherein M is a positive integer greater than 1;
and forming a chart coordinate array of the third target chart by using the sequence label, the length value, the width value and the chart coordinate of the third target chart.
15. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the chart layout method according to any one of claims 1 to 7.
16. A readable storage medium on which a program or instructions are stored, the program or instructions, when executed by a processor, implementing the steps of the chart layout method according to any one of claims 1 to 7.
CN202110223340.0A 2021-03-01 2021-03-01 Chart typesetting method, device, electronic equipment and readable storage medium Active CN112966484B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110223340.0A CN112966484B (en) 2021-03-01 2021-03-01 Chart typesetting method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110223340.0A CN112966484B (en) 2021-03-01 2021-03-01 Chart typesetting method, device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112966484A true CN112966484A (en) 2021-06-15
CN112966484B CN112966484B (en) 2024-06-07

Family

ID=76277481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110223340.0A Active CN112966484B (en) 2021-03-01 2021-03-01 Chart typesetting method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112966484B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721815A (en) * 2021-08-31 2021-11-30 杭州群核信息技术有限公司 Billboard setting method, device and storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003203066A (en) * 2002-01-08 2003-07-18 Matsushita Electric Ind Co Ltd Document editing device, document editing method, document editing program, and recording medium
CN103246639A (en) * 2013-05-30 2013-08-14 安徽皖通科技股份有限公司 Automatic typesetting method of tax-exempt vehicle atlas provided with fixing device
CN103309970A (en) * 2013-06-08 2013-09-18 北京印刷学院 Picture object typesetting log establishing and protecting method used during collaborative network printing typesetting
CN105975462A (en) * 2015-09-11 2016-09-28 乐视致新电子科技(天津)有限公司 Method and device for displaying web page and intelligent television system
CN106920141A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 Page presentation content processing method and device
CN107908612A (en) * 2017-11-14 2018-04-13 杭州汉林文化创意股份有限公司 Answering card generation method, answer card identification method, operating system
CN109933756A (en) * 2019-03-22 2019-06-25 腾讯科技(深圳)有限公司 Image based on OCR turns shelves method, apparatus, equipment and readable storage medium storing program for executing
CN110198336A (en) * 2019-01-04 2019-09-03 华为技术有限公司 A kind of automatic composing method and cloud service platform
CN110390091A (en) * 2018-04-18 2019-10-29 成都野望数码科技有限公司 A kind of typesetting document structure tree method, device and equipment
CN110472222A (en) * 2019-08-22 2019-11-19 宁波奥克斯电气股份有限公司 Automatic composing method, device, electronic equipment and computer readable storage medium
CN110929487A (en) * 2018-09-04 2020-03-27 北大方正集团有限公司 Table typesetting method and device, computer equipment and readable storage medium
CN111597787A (en) * 2020-05-14 2020-08-28 广东小天才科技有限公司 Test question generation method and system
CN111597772A (en) * 2020-04-28 2020-08-28 维沃移动通信有限公司 Data integration method, data integration device and electronic equipment
CN112016290A (en) * 2020-09-02 2020-12-01 湖南写邦科技有限公司 Automatic document typesetting method, device, equipment and storage medium
CN112100979A (en) * 2020-09-16 2020-12-18 掌阅科技股份有限公司 Typesetting processing method based on electronic book, electronic equipment and storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003203066A (en) * 2002-01-08 2003-07-18 Matsushita Electric Ind Co Ltd Document editing device, document editing method, document editing program, and recording medium
CN103246639A (en) * 2013-05-30 2013-08-14 安徽皖通科技股份有限公司 Automatic typesetting method of tax-exempt vehicle atlas provided with fixing device
CN103309970A (en) * 2013-06-08 2013-09-18 北京印刷学院 Picture object typesetting log establishing and protecting method used during collaborative network printing typesetting
CN105975462A (en) * 2015-09-11 2016-09-28 乐视致新电子科技(天津)有限公司 Method and device for displaying web page and intelligent television system
CN106920141A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 Page presentation content processing method and device
CN107908612A (en) * 2017-11-14 2018-04-13 杭州汉林文化创意股份有限公司 Answering card generation method, answer card identification method, operating system
CN110390091A (en) * 2018-04-18 2019-10-29 成都野望数码科技有限公司 A kind of typesetting document structure tree method, device and equipment
CN110929487A (en) * 2018-09-04 2020-03-27 北大方正集团有限公司 Table typesetting method and device, computer equipment and readable storage medium
CN110198336A (en) * 2019-01-04 2019-09-03 华为技术有限公司 A kind of automatic composing method and cloud service platform
CN109933756A (en) * 2019-03-22 2019-06-25 腾讯科技(深圳)有限公司 Image based on OCR turns shelves method, apparatus, equipment and readable storage medium storing program for executing
CN110472222A (en) * 2019-08-22 2019-11-19 宁波奥克斯电气股份有限公司 Automatic composing method, device, electronic equipment and computer readable storage medium
CN111597772A (en) * 2020-04-28 2020-08-28 维沃移动通信有限公司 Data integration method, data integration device and electronic equipment
CN111597787A (en) * 2020-05-14 2020-08-28 广东小天才科技有限公司 Test question generation method and system
CN112016290A (en) * 2020-09-02 2020-12-01 湖南写邦科技有限公司 Automatic document typesetting method, device, equipment and storage medium
CN112100979A (en) * 2020-09-16 2020-12-18 掌阅科技股份有限公司 Typesetting processing method based on electronic book, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721815A (en) * 2021-08-31 2021-11-30 杭州群核信息技术有限公司 Billboard setting method, device and storage medium

Also Published As

Publication number Publication date
CN112966484B (en) 2024-06-07

Similar Documents

Publication Publication Date Title
CN111586237B (en) Image display method and electronic equipment
US11409421B2 (en) Object processing method and terminal device
CN111596817A (en) Icon moving method and electronic equipment
CN112055244B (en) Image acquisition method and device, server and electronic equipment
CN110908554B (en) Long screenshot method and terminal device
CN111638849A (en) Screenshot method and device and electronic equipment
CN112783594A (en) Message display method and device and electronic equipment
CN112947810A (en) Interface display method and device and electronic equipment
CN110750368A (en) Copying and pasting method and terminal
CN112966484B (en) Chart typesetting method, device, electronic equipment and readable storage medium
CN114638939A (en) Model generation method, model generation device, electronic device, and readable storage medium
CN112333329B (en) Unread information reminding method and device and electronic equipment
CN112181252B (en) Screen capturing method and device and electronic equipment
JP6668868B2 (en) Information processing apparatus and information processing program
CN112764639A (en) Screen capturing method and device and electronic equipment
CN112306320A (en) Page display method, device, equipment and medium
CN111724455A (en) Image processing method and electronic device
CN111459356A (en) Interface display method and electronic equipment
KR102266869B1 (en) Electronic apparatus and dispalying method thereof
CN110780795A (en) Screen capturing method and electronic equipment
CN115501588A (en) Image rendering method and device, storage medium and electronic equipment
CN114564921A (en) Document editing method and device
CN111596822B (en) Icon display control method and device and electronic equipment
CN113946456A (en) Information sharing method and information sharing device
CN114070892A (en) Data transmission method and device

Legal Events

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