Embodiment 1
In order to solve prior art presence the unconventional chart of drafting it is less efficient the problem of, the embodiment of the present application
1 provides a kind of chart generation method.The executive agent of this method, can be, but not limited to as mobile phone, flat board electricity
At least one of user terminals such as brain, PC (Personal Computer, PC).In addition, should
The executive agent or drawing instrument of method in itself, can such as be installed and run use on the subscriber terminal
In the application (Application, APP) of drawing, or the drawing installed and operated on PC is using soft
Part.
For ease of description, hereafter subject of implementation in this way be drawing instrument exemplified by, the implementation to this method
Mode is introduced.It is appreciated that it is a kind of exemplary say that the executive agent of this method, which is application software,
It is bright, it is not construed as the restriction to this method.
Specifically, the implementation process schematic diagram for the chart generation method that embodiment 1 is provided is as shown in Figure 1a,
Including following key step:
Step 11, drawing instrument obtains the data to be presented that will be shown with chart;
Wherein, drawing instrument, generally refers to be arranged on the local application software of user terminal, it is to adopt
The graphically instrument by data display over the display.
The data to be presented that will be shown with chart, such as can be, but not limited to include the business such as customer flow
The personal data such as data, user's height, it can also be for statistics of some features or process etc..For
It is easy to description, hereinafter by " data to be presented that will be shown with chart ", referred to as " data to be presented ".
Particularly, there can be certain relevance between part or all of data to be presented.With with certain class business
The related data instance of the network trading flow of product:Within certain time (such as one week), the commodity it is clear
The amount of looking at is A data, and the commodity are placed into shopping cart quantity for B data, for the generation order of the commodity
Measure as C data, the pay invoice amount for the commodity is D data, for the completion trading volume of the commodity
For E data.So, A, B, C, D, E are the data related to the commodity, from magnitude relationship
For, the relation between A~E is:A≥B≥C≥D≥E;From the corresponding network trading step of data
Consider in time order and function relation, the relevance between A~E includes:A before B, B before C, C
Before D, D is before E.Wherein, network trading step, to constitute the step of the network trading flow
Suddenly.
Drawing instrument described in the embodiment of the present application, can obtain the number to be presented that will be shown with chart
According to acquisition modes can be, but not limited to using one of following manner:
1st, drawing instrument obtains the data to be presented that will be shown with chart of user's input.
Such as, user paints in the assigned work area of the operation interface of data input to be presented to drawing instrument
Figure instrument can obtain the data in the workspace.
2nd, drawing instrument obtains the data to be presented that will be shown with chart that the network terminal is sent.
3rd, drawing instrument is by calling the application programming interface (Application of other application software
Programming Interface, abbreviation API), obtain the data to be presented that will be shown with chart.
4th, drawing instrument receives the data to be presented that will be shown with chart that other application software is sent.
Such as, it is necessary to adopt when being graphically shown to the partial data of certain application software, the application software
This partial data can be sent to drawing instrument.
Step 12, drawing instrument is according to for generating the template graph and the data to be presented of conventional diagrams,
Generate the conventional diagrams for showing the data to be presented;
Wherein, conventional diagrams are the template graph with the conventional diagrams in the template graph storehouse of drawing instrument
Chart.Therefore, drawing instrument calls the use having in chart ATL during conventional diagrams are drawn
In the template graph of generation conventional diagrams.Wherein, it is to be used to give birth to for generating the template graphs of conventional diagrams
Function into conventional diagrams, with least one component.In at least one described component, typically
Include at least one variable.In addition, template graph can also include original constant.The original constant, leads to
Often refer to for elements such as the priming colors or shape of decision generation chart.It should be noted that described original normal
Amount can be adjusted according to the requirement of user.For example, if the original constant in template graph is defined
The color of the conventional diagrams of generation is red, then user be able to will be generated by being adjusted to original constant
The colors of conventional diagrams be adjusted to other colors beyond red.
In the embodiment of the present application, drawing instrument draw be used for show data to be presented conventional diagrams when,
The template graph that some template graph shows the conventional diagrams of data to be presented as generation can be given tacit consent to.Citing
For, the template graph of acquiescence such as can be the template graph for generating column diagram.Or, it is real in the application
Apply in example, drawing instrument can (be according to the unconventional chart of expected generation before conventional diagrams are drawn
It is be easy to description, rear to be referred to as the first unconventional chart) type, it is determined that the chart mould for generating conventional diagrams
Plate.
For the latter, its specific embodiment can be, but not limited to a kind of following modes:
1st, drawing instrument is according to the type of the first unconventional chart of expected generation, and pre-establish it is non-
The type of conventional diagrams and the corresponding relation of the template graph for generating conventional diagrams, it is determined that being generated with expected
The first unconventional chart the corresponding template graph of type;And according to data to be presented and the chart determined
Template, generates the conventional diagrams for showing data to be presented.
Such as:If it is determined that there is the normal for generating of corresponding relation with the first unconventional chart " crater blasting "
The template graph for advising chart is bar chart template, then, drawing instrument calls post when drawing crater blasting
Shape template graph is used as the template graph for generating conventional diagrams.Above corresponding relation can be compiled by program staff
Code is stored in the program of drawing instrument, or in the memory space that can call of drawing instrument.
2nd, drawing instrument receives the template graph inputted by user and chooses instruction, and in response to the instruction, holds
Row operation corresponding with the instruction, that is, determine template graph that user selectes, for generating conventional diagrams;
Further, drawing instrument generates according to data to be presented and the template graph determined and waits to open up for showing
The conventional diagrams of registration evidence.
General, user can select the template graph associated with the subtype of the first unconventional chart.
Such as:The subtype of " crater blasting " can regard what is obtained by some bar shape structure compositions as, because
This user can select there is the template graph associated with the subtype of crater blasting, such as can be to carry bar
The bar chart template or bar chart template of shape structure, drawing instrument is when drawing crater blasting, it is possible to hold
The template graph of row user input chooses instruction, it is determined that and calling the template graph to generate corresponding conventional figure
Table.
It should be noted that drawing instrument according to data to be presented and determine be used for generate conventional diagrams
Template graph, generates the specific implementation of the conventional diagrams for showing the data to be presented, general bag
Include:By the way that data to be presented are loaded into the template graph determined through the above way, generate for showing
The conventional diagrams of data to be presented.
Such as, the example of certain class commodity network transaction flow above is continued to use, if assuming A, B, C, D, E
The specific value of data is:A=100, B=8, C=60, D=40, E=20, and the first of expected generation is non-
The subtype of conventional diagrams is " crater blasting ", and the template graph determined through the above way is column diagram
Table template, then drawing tool is by the way that A, B, C, D, E specific value are loaded into column diagram template,
Conventional diagrams as shown in Figure 1 b can be generated.The height of column diagram represents the size of data in Fig. 1 b, number
According to bigger, the height of corresponding column diagram is higher.
Step 13, the conventional diagrams generated by performing step 12 are converted into and conventional diagrams by drawing instrument
Subtype there is the unconventional chart (then claim the first unconventional chart) of association.
Wherein, unconventional chart, refers to and does not have the unconventional chart in the template graph storehouse of drawing instrument
Template graph chart, it is impossible to the direct chart that is generated using the existing template graph of drawing instrument, such as
Crater blasting etc..
In the embodiment of the present application, the class for the first unconventional chart that drawing instrument can be generated according to expection
Conventional diagrams are performed the type conversion with the type matching of the first unconventional chart and operated, to realize by type
Conventional diagrams are converted into the unconventional chart of the subtype for the first unconventional chart for possessing expected generation
(the i.e. first unconventional chart) between explanation, the first unconventional chart and conventional diagrams, it is necessary to exist
Incidence relation, it is similar to the subtype of conventional diagrams that the incidence relation can be embodied in the first unconventional chart
Or it is identical.
Above-mentioned drawing instrument performs the type change with the type matching of the first unconventional chart to conventional diagrams
Operation is changed, can be included but is not limited to following at least one:
Centering operations;Line is operated;Rotation process.
Below so that the first unconventional chart of expected generation is crater blasting as an example, illustrate normal shown in Fig. 2 a
Rule chart passes through the process of the type conversion operation generation crater blasting matched with crater blasting subtype.The mistake
Journey specifically includes following steps:
The first step, centering operations are performed to each cylindricality shown in Fig. 1 b;
Specifically, drawing instrument can be with horizontal center line (the such as highest post of some cylindricality in Fig. 1 b
The horizontal center line of shape) or a certain bar horizontal linear is preset as datum line, according to datum line to each cylindricality
It is adjusted so that the central point of all cylindricalitys is on this straight line.Cylindricality shown in Fig. 1 b is by occupying
Chart is generated after middle operation as illustrated in figure 1 c, and dotted line shown in 101 is the datum line in figure 1 c.
Second step, line operation is performed to each cylindricality shown in Fig. 1 c;
Specifically, the upper end of adjacent cylindricality in Fig. 1 c is carried out line by drawing instrument successively, by phase in Fig. 1 c
The lower end of adjacent cylindricality carries out line successively, and the chart obtained after line is operated is as shown in Figure 1 d.Need
Illustrate, the width of the column diagram in this figure does not have practical significance, can adjust.
3rd step, rotation process is performed to chart shown in Fig. 1 d.
Specifically, because the shape of crater blasting is approximately inverted triangle, in the chart base shown in Fig. 1 d
On plinth, drawing instrument can turn clockwise the chart shown in Fig. 1 d 90 °, and obtained crater blasting is as schemed
Shown in 1e.General, drawing instrument is that graph making is carried out in a plane coordinate system, therefore, is drawn
Instrument, can also be right in the case where chart is remained stationary as in addition to it can in itself be rotated for chart
Plane coordinate system is rotated, and equally can obtain chart as shown in fig. le.
It should be noted that the sequencing that above-mentioned steps are performed generates crater blasting by column diagram without limitation
The step of, drawing instrument can also to column diagram 1b perform rotation process as the first step, then to rotation after
Chart perform placed in the middle, line operation.The step of programmer can be by above-mentioned execution is compiled into drawing instrument energy
The language codes enough recognized.When needing to draw crater blasting according to data to be presented, drawing instrument can be called
And perform the language codes.
In addition, drawing instrument can be performed accordingly according to the configuration information of the first unconventional chart of expected generation
Visual effect adjustment operation, with realize cause the first unconventional chart possess corresponding visual effect.Wherein,
It is expected that the configuration information of the first unconventional chart of generation can be including at least one in color and size.
In the embodiment of the present application, can according to the configuration information, after being adjusted to the visual effects of conventional diagrams,
The conventional diagrams after adjustment are converted into the first unconventional chart again;Or or by conventional diagrams
It is converted into after the first unconventional chart, further according to the configuration information, the vision to the first unconventional chart is imitated
Fruit is adjusted.
General, when above-mentioned configuration information includes color, corresponding visual effect adjustment operation includes:Adjust
The color of whole chart;When above-mentioned configuration information includes size, corresponding visual effect adjustment operation includes:
The size of adjusting diagram.
Because there is drawing instrument common in correlation technique adjusting diagram color to adjust and size substantially
Function, and the function is also commonly used in the related art, and the specific of operation is adjusted to visual effect at this
Implementation is not repeated.
For above-mentioned steps it should be noted that when need to draw be as similar crater blasting, for by
According to it is certain put in order the chart for showing each data to be presented when, drawing instrument before conventional diagrams are drawn,
Putting in order for the data to be presented of acquisition can adaptively be adjusted, to be opened up according to treating after adjustment
Putting in order for registration evidence, draws corresponding figure.Such as, the data to be presented got are not according to just
True putting in order is arranged, then, can be by the data to be presented got before step 12 execution
It is ranked up, obtains orderly data to be presented, then performs step 12 for orderly data to be presented,
To obtain the conventional diagrams for showing the data to be presented.Wherein, in the conventional diagrams obtained, respectively
Putting in order for the corresponding figure of data to be presented, it is relative with putting in order for the orderly data to be presented
Should.
For the method that prior art draws unconventional chart, drafting is first passed through using the above method normal
Chart is advised, then the conventional diagrams completed are implemented to be converted into unconventional chart, process is simple, realizes
Get up and be also easier.This improves the drafting efficiency of unconventional chart.
In actual applications, because the data in the first unconventional chart and/or display form may be according to differences
Period, different demands change, the chart after being changed for Fast Drawing, what the embodiment of the present application was provided
The above method can also include following key step as shown in Figure 2 a:
Step 21, drawing instrument obtains the adjustment information for the first unconventional chart;
Wherein, the adjustment information for the first unconventional chart can include the chart with the first unconventional chart
The distribution information that type is consistent, and the first unconventional chart color, size and data to be presented
One or more in adjustment information.
Such as, by taking unconventional chart as shown in fig. le as an example, enter for the unconventional chart shown in Fig. 1 e
Row adjustment, such as by funnel chart can be modified to it by the subtype of the unconventional chart shown in Fig. 1 e
The chart of his subtype such as pyramid chart;One or more figures pair either shown in adjustment Fig. 1 e
The data to be presented answered, such as the pageview corresponding data of the commodity becomes 200 by 100;Either will figure
The display color of unconventional chart shown in 1e is adjusted to green by red;Either by shown in Fig. 1 e very
Rule chart reduces one times and shown in the display.
Step 22, drawing instrument generates the second unconventional chart according to adjustment information.
The specific implementation of step 22 such as can be including but not limited to following two:
Mode 1, drawing instrument is adjusted according to adjustment information to conventional diagrams, and according to normal after adjustment
Advise chart and generate unconventional chart (rear to claim the second unconventional chart);
Mode 2, drawing instrument adjusts the first unconventional chart according to adjustment information, and obtaining unconventional chart (should
Chart is typically consistent with the described second unconventional chart, therefore the also referred to as second unconventional chart).
Exemplified by being adjusted to the unconventional chart shown in Fig. 1 e, illustrate by above two mode
Generate the implementation process of the second unconventional chart.
Only it is that subtype changes when adjustment occurs for the unconventional chart shown in Fig. 1 e, as by Fig. 1 e institutes
Show that crater blasting is modified to pyramid chart, drawing instrument needs to draw pyramid chart.
According to mode 1, drawing instrument can rotate to the conventional diagrams shown in Fig. 1 b, so as to obtain
Chart shown in Fig. 2 b.Chart shown in Fig. 2 c is obtained to the chart execution centering operations shown in Fig. 2 b,
Perform method placed in the middle approximate with the method placed in the middle that chart shown in above-mentioned Fig. 1 b generates chart shown in Fig. 1 c, institute
Unlike datum line use in Fig. 2 b the vertical center line of some bar shaped (such as most strip be vertical
Center line) or preset a certain bar vertical line be used as datum line.Such as, using pageview pair shown in Fig. 2 b
Line on the basis of the vertical center line 201 of figure is answered, the chart shown in Fig. 2 b is performed after centering operations, can
To obtain the chart shown in Fig. 2 c.Pyramid is obtained to the corresponding figure of data shown in Fig. 2 c successively line
Chart such as Fig. 2 d.
According to mode 2, drawing instrument directly can carry out 180 ° of rotation to the crater blasting shown in Fig. 1 e,
Obtain pyramid chart such as Fig. 2 d.
When data to be presented change in the very chart shown in Fig. 1 e, such as pageview pair of the commodity
Data are answered to become 200 by 100, remainder data does not change, drawing instrument needs to draw to be treated for displaying
Corresponding crater blasting after display data change.According to mode 1, then drawing instrument is clear by the commodity in Fig. 1 e
The amount of looking at correspondence figure is adjusted, and is that 200 corresponding cylindricalitys replacement pageviews are 100 corresponding by pageview
Cylindricality, obtains chart as shown in Figure 2 e;Centering operations generation figure is performed for the corresponding cylindricality of remainder data
Table as shown in figure 2f, performs the residence that method placed in the middle generates chart shown in Fig. 1 c with chart shown in above-mentioned Fig. 1 b
Middle method, datum line is 202;Drawing instrument carries out line to each data correspondence figure and obtains chart such as Fig. 2 g
It is shown;Rotation process is performed to the chart shown in Fig. 2 g and generates the second unconventional chart as shown in fig. 2h.If
Employing mode 2, then drawing instrument is direct enters to the cylindricality that representative in unconventional chart shown in Fig. 1 e browses commodity
Row adjustment, line operation is re-executed to the figure after adjustment and obtains chart as shown in fig. 2h, original connection
Line is deleted.
When needing the display to the unconventional chart shown in Fig. 1 e to adjust, the chart is drawn.Employing mode 1,
Drawing instrument can be first by the display color of conventional diagrams shown in Fig. 1 b it is anticipated that the second unconventional figure of generation
The color of table is adjusted, and is then performed and remaining consistent that generate chart shown in Fig. 1 e of chart shown in Fig. 1 c
Step obtains the second unconventional chart;Employing mode 2, drawing instrument can directly adjust non-shown in Fig. 1 e
The display color of conventional diagrams so that the display face of the display color of newly-generated chart and the second unconventional chart
Color is consistent.
It should be noted that in the present embodiment, any operation is performed to chart will not typically change chart exhibition
The implication representated by data shown.The step of programmer can be by above-mentioned execution, which is compiled into drawing instrument, to be known
Other language codes.When needing to draw crater blasting according to data to be presented, drawing instrument can be called and held
The row language codes.
The method provided using the embodiment of the present application, the feelings adjusted for completed unconventional chart
Condition, drawing instrument can generate unconventional chart adjustment using the conventional diagrams and unconventional chart drawn
Chart afterwards, starts anew freehand chart without user, therefore efficiency is higher.
Embodiment 2
In order to solve the problem of drawing a diagram less efficient of prior art presence, the embodiment of the present application 2 is provided
A kind of chart generating means.The concrete structure schematic diagram of the device as shown in figure 3, including acquiring unit 31,
Generation unit 32, conversion unit 33.Wherein:
Acquiring unit 31, for obtaining the data to be presented that will be shown with chart;Generation unit 32,
For according to being used to generate the data to be presented that the template graph and acquiring unit of conventional diagrams are got, generating
Conventional diagrams for showing the data to be presented;Conversion unit 33, for the conventional diagrams to be converted
To there is the first unconventional chart associated with the subtype of the conventional diagrams.
It should be noted that above-mentioned conventional diagrams are in the template graph storehouse of drawing instrument there is this routinely to scheme
The chart of the template graph of table, unconventional chart is without unconventional in the template graph storehouse of drawing instrument
The chart of the template graph of chart.
In one embodiment, generation unit 32, specifically can be used for:It is non-according to the first of expected generation
The type of conventional diagrams, it is determined that the template graph for generating conventional diagrams;According to data to be presented and determination
The template graph for being used to generate conventional diagrams gone out, generates the conventional diagrams for showing data to be presented.
In one embodiment, conversion unit 33, specifically can be used for:It is non-according to the first of expected generation
The conventional diagrams that generation unit 32 is generated are performed and the class by the type and configuration information of conventional diagrams
The type conversion operation of type matching and the visual effect matched with the configuration information are adjusted and operated, to generate
First unconventional chart;Wherein, it is contemplated that the configuration information of the first unconventional chart of generation, including expected life
Into the first unconventional chart color and size at least one of.
The type switching operation that above-mentioned conversion unit 33 is performed can include at least one of operations described below:
Centering operations;Line is operated;Rotation process.
It should be noted that after conversion unit 33 generates the first unconventional chart, it is unconventional for first
The situation that chart is changed, is repainted to realize to chart, and described device also includes such as lower unit:
Receiving unit 34, for obtaining the adjustment information for the first unconventional chart, wherein, described tune
Whole information includes the adjustment information being consistent with the subtype of the first unconventional chart;
Adjustment unit 35, for getting the adjustment letter for the first unconventional chart according to receiving unit 34
Breath is adjusted to conventional diagrams, and generates the second unconventional chart according to the conventional diagrams after adjustment;Or root
The adjustment information for the first unconventional chart got according to receiving unit 34 is entered to the first unconventional chart
Row adjustment, obtains the second unconventional chart.
In a kind of mode, generation unit 32, which generates obtained conventional diagrams, to be included:Column diagram;Conversion is single
The first unconventional chart that the conversion of member 33 is obtained includes:Crater blasting.
The chart generating means provided using the embodiment of the present application 2, can be according to data to be presented and chart mould
Plate, generates conventional diagrams, and conventional diagrams are performed with operation the first unconventional chart of generation, and when for the
There is situation about changing in one unconventional chart, and can also adjust conventional diagrams or the first unconventional chart generation
Second unconventional chart, for the method for the unconventional chart of prior art freehand, efficiency is higher.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or meter
Calculation machine program product.Therefore, the present invention can be using complete hardware embodiment, complete software embodiment or knot
The form of embodiment in terms of conjunction software and hardware.Wherein wrapped one or more moreover, the present invention can be used
Containing computer usable program code computer-usable storage medium (include but is not limited to magnetic disk storage,
CD-ROM, optical memory etc.) on the form of computer program product implemented.
The present invention is with reference to the production of method according to embodiments of the present invention, equipment (system) and computer program
The flow chart and/or block diagram of product is described.It should be understood that can by computer program instructions implementation process figure and
/ or each flow and/or square frame in block diagram and the flow in flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to all-purpose computer, special-purpose computer, insertion
Formula processor or the processor of other programmable data processing devices are to produce a machine so that pass through and calculate
The instruction of the computing device of machine or other programmable data processing devices is produced for realizing in flow chart one
The device for the function of being specified in individual flow or multiple flows and/or one square frame of block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or the processing of other programmable datas to set
In the standby computer-readable memory worked in a specific way so that be stored in the computer-readable memory
Instruction produce include the manufacture of command device, the command device realization in one flow or multiple of flow chart
The function of being specified in one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices, made
Obtain and perform series of operation steps on computer or other programmable devices to produce computer implemented place
Reason, so that the instruction performed on computer or other programmable devices is provided for realizing in flow chart one
The step of function of being specified in flow or multiple flows and/or one square frame of block diagram or multiple square frames.
Embodiments herein is the foregoing is only, the application is not limited to.For this area skill
For art personnel, the application can have various modifications and variations.All institutes within spirit herein and principle
Any modification, equivalent substitution and improvements of work etc., should be included within the scope of claims hereof.