Embodiment
In order that those skilled in the art more fully understand the technical scheme in the application, below in conjunction with the embodiment of the present application
Accompanying drawing, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described embodiment is only
It is some embodiments of the present application, rather than whole embodiments.Based on the embodiment in the application, ordinary skill people
The every other embodiment that member is obtained under the premise of creative work is not made, should all belong to the scope of the application protection.
The conversion method and device to data described herein to chart are described in detail below in conjunction with the accompanying drawings.Fig. 1 is this
Apply the data of proposition to a kind of method flow diagram of embodiment of the conversion method of chart.Although this application provides such as following realities
Example or method operating procedure shown in the drawings or apparatus structure are applied, but based on routine or without performing creative labour in methods described
Or more or less operating procedure or modular structure can be included in device.It is not present in logicality necessary causal
In step or structure, the execution sequence of these steps or the modular structure of device are not limited to the execution sequence that the embodiment of the present application is provided
Or modular structure., can be according to embodiment when the device in practice of described method or modular structure or end product execution
Or method shown in the drawings or modular structure connection carry out order execution or parallel execution (such as parallel processor or multi-thread
The environment of journey processing).
The conversion of data to chart is frequently necessary to complex program, and these data are mainly for example:Excle forms, data set
Deng these, such as the list of the material used in engineering, the flow direction of fund, the classification of article etc., these data are mainly statistics
Data on, because if graphically being stated, will be more apparent from accordingly, readable more stronger.For example,
The cost bill of user's every month can be recorded now with some softwares, these bills are usually with data set when storage
Mode is stored, if however, adopting that be graphically shown obviously can be more apparent, because chart can be shown
Which class the bodily destination of the cost of your every month has, and ratio shared by each class etc. so as to the readings of data more
To be directly perceived clear.
In order to realize data to the conversion of chart, it is thus necessary to determine that the position of each data in the graph, and between data and data
Annexation, so that data could be realized to effective mapping of chart, therefore, in view of some syntax rules can be set,
These syntax rules can represent the position of data in the graph, can also represent the annexation between data and data, so that
System is parsed to the sentence generated based on these syntax rules, it is possible to realize data to the conversion of chart.Specifically, such as
Shown in Fig. 1, a kind of embodiment of data to the conversion method of chart that the application is provided can include:
S1:Obtain data set to be converted;
That is, receive or a data set to be converted is extracted from system, variable can be generated from the data set, it is so-called
Equivalent to one parameter of variable, when chart is generated, a variable can correspond to a dimension, for example, can extract
Two variables:The price of weight and Unit Weight.After generation variable, it is possible to the conversion carrying out variable to variable, from
And a variable space is formed, in order that obtaining follow-up variable can be shown in the same space namely same picture, can be to becoming
Amount carries out scale conversion, i.e. variable is normalized operation, so that the correspondence between realizing variable.Specifically, getting
After data set to be converted, following operation can be performed:
S1-1:Variable is extracted from the data set to be converted;
S1-2:Changed carrying out variable to the variable of extraction, form the variable space;
S1-3:The variable space is normalized.
In this application, data set is obtained, the data after variable extraction and scales transforming are carried out to data set, it is possible to according to pre-
The grammer of fixed syntax rule generation conversion, it is possible to carry out so-called encoding operation.
S2:Corresponding pass in the data set to be converted between each data and chart canvas location is generated according to predetermined syntax rule
System, and the annexation between each described data sign sentence;
That is, the annexation in data set to be converted between each data will be characterized by sentence or perhaps code language, with
And the position of each data in the graph, it can be realized so that subsequently characterizing sentence in other words to this section of code and being parsed
Data set to chart mapping, so as to form the chart for characterize data collection of desired generation.
If in view of grammar rule definitions and algebraic operation are compared into laminating, then the sign of data will be caused and changed more
It is simple and convenient, in this application, predetermined syntax rule can be generated according to algebraic operation.For example, by " * " in algebraically,
"+", "-" etc. represent the contact between data.In order that the application must be easier to understand, in this application, give several
Kind predetermined syntax rule, by the setting of these syntax rules, can realize data to the syntax conversion of chart with relatively simple,
For example:
1) the lateral connection relation between two variables sets is represented by following sentence:
Position (s*t), wherein, s represents the first variables set, and t represents the second variables set, and s*t represents that transverse axis is variables set s,
The longitudinal axis is variables set t;
In order that lateral connection relation can be corresponded to, it is necessary to which setting s and t two is line number and the identical two that puts in order by obtaining s and t
Individual form.The lateral connection that what s*t was represented be the two line numbers between two forms of identical that put in order.
S*t result can be understood as regarding two variables sets of s and t as line number and the horizontal stroke for two forms of identical that put in order
To connection, if s=(x, y, z), t=(a, a, b), then, s*t can be expressed as:
That is, the two variables sets of s and t, line number and put in order etc. identical, and after computing, s*t can be understood as one by one
The set of the point of (si, ti), is mapped to the result in chart, can be so that as shown in Fig. 2 transverse axis is variables set s, the longitudinal axis is variable
Collect t.
2) annexation between two data is represented by following sentence:
Position (a+b), wherein, a represents first data set, and b represents second data set, and a+b is represented from data set
A to data set b, i.e. the annexation between two data is represented by "+", also means that the link in graph of a relation,
Played a part of being exactly to connect, in order that one-to-one connection can be realized to data set b by obtaining data set a, then also
Data set a is needed to possess identical data type to data set b.
If position (a+b) is mapped in chart, then can obtain result as shown in Figure 3, shown in Fig. 3 is
The not chord figure of Weight.
If the "+" is mapped in parallel coordinate system, then can also parallel coordinates figure, for example:position(a+b+c+d)
The parallel coordinates figure shown in Fig. 4 can be obtained, wherein, a, b, c, d represent each parallel coordinate axes respectively, according to statement
Order, be sequentially connected ai、bi、ci、diFour points.
3) data relationship of Weight is represented by following sentence:
Position ((c+d) * e)=position (c*e1+d*e2)
Wherein, c represents first data set, and d represents second data set, and e represents weight, and c*e1+d*e2 is represented from number
It is e1 according to collection c to data set d, data set c weight, data set d weight is e2.
That is, in the graphic grammar ,+algebraic operator rideshare method the apportionment ratio with *, i.e. (a+b+c+d) * e are equivalent to
A*e+b*e+c*e+d*e, wherein, e represents it is weight, the associated diagram of Weight can be drawn with this grammer, i.e. ea1
Represent weighted value.
If the data relationship is transformed into polar coordinates, then can just form chord figure.And for Sang Jitu, as being also,
Weighted value is added on the basis of parallel coordinates, and for chord figure and Sang Jitu differentiation, when program is calculated,
The coordinate set type that can be stated according to user is judged, if polar coordinates, the drafting with regard to carrying out chord figure, is otherwise drawn
Sang Jitu.
In this application, it is as shown in Figure 5 and Figure 6 the sum corresponding to position ((a+b) * e)=position (a*ea+b*eb)
String figure and Sang Jitu.
It should be noted, however, that in upper example, although propose several predetermined syntax rules generated according to algebraic operation,
But this is merely to be better described the application, when actually performing can with it is other meet represent, the application is to this
It is not construed as limiting, as long as pre-defining a syntax rule, is converted to data set according to this predetermined syntax rule
The sentence that can be parsed just can be with.
S3:The sign sentence is parsed, the chart painting canvas corresponding to the data set to be converted is obtained.
Generally, data set is converted into chart painting canvas and data set is mainly converted into following several graphs of a relation, that is, used
The mode of picture syntax is changed, and what picture syntax was characterized is exactly the rule of correspondence between data and figure:
2-1) arc length linked, diagram, uses one-dimensional placement mode, i.e. node along some linear axes or circle permutation, wherein, circle
Linking relationship between arc expression node;The schematic diagram of chord figure is illustrated in figure 7, arc length linked, diagram is illustrated in figure 8
Schematic diagram.
2-2) parallel coordinates, is a kind of common method for visualizing, the visualization for high dimensional geometry data and multivariate data.Such as
Fig. 9 show a kind of schematic diagram of parallel coordinates figure, in order to represent a point set in higher dimensional space, in the parallel line of N bars
Background under (this general N bars line is all vertical and equidistant), a point in higher dimensional space is represented as a flex point in N bars
The broken line of parallel coordinate axes, the position in k-th reference axis means that this value tieed up in k-th;
2-3) Sang Jitu, is a kind of certain types of flow graph, for describing a class value to the flow direction of another class value, in Sang Jitu
Branch's width of extension is corresponding with the size of data traffic.It is a kind of Sang Jitu schematic diagram as shown in Figure 10, Sang Jitu is most bright
Aobvious feature is exactly that branch's width at whole story end is total each equal, i.e. all main Zhi Kuandu summation and all branches separated
The summation of width is equal, so as to keep the balance of energy, therefore, Sang Jitu is commonly used to the energy, material composition, finance
Etc. the visual analyzing of data.
The basic representation of above-mentioned graphic grammar is:By taking point (position (x*y)) as an example, point represents figure, i.e., finally need
The point diagram to be generated, position represents position, and position (x*y) represents the position of data in the graphic, the position by x and
The variable decision of two dimensions of y, wherein, x*y data processed result can be understood as:
For above-mentioned figure, it can be represented using polar mode, that will be shown as chord figure accordingly.
In this application, in order to realize the expression of coordinate system, when generation characterizes sentence, a markup sentence can be increased,
It is generation parallel coordinates or generation polar coordinates for identifying.I.e., it is possible to first determine whether coordinate system is polar coordinate system;If it is,
Then the sign sentence is parsed, the chord figure corresponding to the data set to be converted is obtained;If it is not, then to described
Characterize sentence to be parsed, obtain the parallel coordinates figure or Sang Jitu corresponding to the data set to be converted.
Parsed to the sign sentence, obtain the chart painting canvas corresponding to the data set to be converted after, can be to obtaining
To chart painting canvas carry out coordinate transform and render wait operate, so as to obtain final chart.
In order to which the conversion method to above-mentioned data to chart is specifically described, in this example, an above-mentioned number of application is additionally provided
According to the concrete scene of the conversion method to chart, it should be noted, however, that the specific embodiment is merely to be better described
The application, does not constitute the improper restriction to the application.
Data set is converted to chart and may comprise steps of by the conversion method based on above-mentioned data to chart:
Step 1:Variable is generated from data set;
Step 2:The conversion between variable is carried out, so as to form the variable space;
Step 3:Carry out scales transforming, i.e. operation is normalized in variable;
Wherein, scales transforming is exactly to zoom in or out, namely yardstick conversion, be that be converted into the size of correspondence parameter value can be straight
Connect the tested engineering numerical quantity for showing dimension, also referred to as project transformation.During production, parameters suffer from difference
Dimension, for example:The unit of pressure is Pa, and the unit of flow is m3/ h, the unit of temperature is DEG C etc..Measuring instrument can be passed through
Table is converted into analog electrical signal, turns into corresponding digital quantity after A/D is changed and only corresponds to the big of tested quantities parameter value
It is small, it is not the original parameter value for carrying dimension.
Linear and non-linear point of scale conversion, can select appropriate scale conversion method according to actual requirement:
1) lineal scale is converted:
It is linear relationship between parameter value and A/D transformation results for general linear meter, its scale conversion formula can
To be expressed as:
AX=A0+(Am-A0)(Nx-N0)/(Nm-N0)
Wherein, A0Represent the lower limit of measuring instrumentss, AmRepresent the upper limit of measuring instrumentss, AXThe measured value after scale conversion is represented,
N0Represent the digital quantity corresponding to instrument lower limit, NmRepresent the digital quantity corresponding to the instrument upper limit, NxRepresent that measured value is corresponding
Digital quantity, wherein, A0、Am、N0And NmIt is constant for a certain specific parameter, different parameters has different
Value.
2) nonlinear scale is converted:
The data signal of the relevant procedure parameter obtained from analog input channel, with the physical quantity representated by the signal not necessarily into
Linear relationship, then its scale conversion formula can be analyzed according to particular problem.
Step 4:Data are counted as required;
Step 5:Data after processing are mapped as to the attribute of figure, wherein, the attribute of so-called figure can include:Position,
Size, shape etc.;
It can be changed in this step according to the predetermined syntax rule in the conversion methods of above-mentioned data to chart, so that
The attribute that data are mapped as to figure is realized, when realizing, code conversion can be carried out according to code below, wherein, link
Representation relation figure:
link().position(a+b);The arc length linked, diagram of // one-dimensional coordinate system
coord(‘polar’);// statement polar coordinates
link().position((a+b)*c);// chord figure
link().position(a+b+c+d).shape(‘paralle’);// parallel coordinates
link().position((a+b+c+d)*w).shape(‘paralle’);// Sang Jitu.
Step 6:Carry out coordinate transformation, the operation such as render, form final graph of a relation.
In upper example, from graphic grammar level, the ability that existing graphic grammar generates complex figure is extended, from syntactic level
On, in Associative algcbra computing plus multiplication simplifies the grammer of production Methods figure there is provided a set of method for quickly generating graph of a relation
And step, focus on mapping of the data attribute to figure so that user may be better understood data are how to be mapped to figure
Space.In addition, the size of code used is fewer, therefore safeguard more simple.
Based on same inventive concept, a kind of data are additionally provided in the embodiment of the present invention to the conversion equipment of chart, such as following reality
Apply described in example.Because the principle that the conversion equipment of data to chart solves problem is similar to the conversion method of data to chart, because
The implementation of this data to the conversion equipment of chart may refer to data to the implementation of the conversion method of chart, repeats part and no longer goes to live in the household of one's in-laws on getting married
State.Used below, term " unit " or " module " can realize the combination of the software and/or hardware of predetermined function.
Although the device described by following examples is preferably realized with software, hardware, or software and hardware combination
Realization is also that may and be contemplated.Figure 11 be the data of the embodiment of the present invention to a kind of structured flowchart of the conversion equipment of chart,
It can include as shown in figure 11:Acquisition module 1101, sentence generation module 1102 and parsing module 1103, below to the knot
Structure is illustrated.
Acquisition module 1101, can be used for obtaining data set to be converted;
Sentence generation module 1102, can be used for generating each data and figure in the data set to be converted according to predetermined syntax rule
The sign sentence of annexation between corresponding relation between table canvas location, and each described data;
Parsing module 1103, can be used for parsing the sign sentence, obtains the figure corresponding to the data set to be converted
Table painting canvas.
It is a kind of structural representation of parsing module 1103 as shown in figure 12, can includes:Judging unit 1201, can be used for
Whether determine coordinate system is polar coordinate system;First resolution unit 1202, can be used in the case of it is determined that being polar coordinate system, right
The sign sentence is parsed, and obtains the chord figure corresponding to the data set to be converted;Second resolution unit 1203, can be with
For in the case of it is determined that being not polar coordinate system, being parsed to the sign sentence, the data set institute to be converted is obtained right
The parallel coordinates figure or Sang Jitu answered.
More it is easily understood in order that obtaining generated graphic grammar, above-mentioned predetermined syntax rule can be given birth to according to algebraic operation
Into, for example, can have following several:
1) the lateral connection relation between two variables sets is represented by following sentence:
Position (s*t), wherein, s represents the first variables set, and t represents the second variables set, and s*t represents that transverse axis is variables set s,
The longitudinal axis is variables set t;
2) annexation between two data is represented by following sentence:
Position (a+b), wherein, a represents first data set, and b represents second data set, and a+b is represented from data set
A to data set b;
3) data relationship of Weight is represented by following sentence:
Position ((c+d) * e)=position (c*e1+d*e2)
Wherein, c represents the first data set, and d represents second data set, and e represents weight, and c*e1+d*e2 is represented from data
Collect c to data set d, c weight is e1, and d weight is e2.
Above-mentioned data can also include to the conversion equipment of chart:Variable extraction module, for obtain data set to be converted it
Afterwards, variable is extracted from the data set to be converted;Modular converter, changes carrying out variable for the variable extraction, is formed
The variable space;Processing module, for the variable space to be normalized.So as to the conversion equipment of the data to chart
Certain processing can be carried out to the data set after data set to be converted is obtained.
Conversion method and device of the data that the application is provided to chart, it is possible to use predetermined syntax rule generates data to be converted
Concentrate the sign language of the annexation between the corresponding relation between each data and chart canvas location, and each described data
Sentence, then by can just show chart painting canvas corresponding with the data set to be converted to the parsing for characterizing sentence, so as to realize
Conversion of the data set to chart.The method that the application is provided can effectively improve data set to the conversion efficiency of chart painting canvas, and in fact
Now get up relatively simple.Using the application embodiment, conversion efficiency can be not only greatly improved, user can also be allowed intuitively
Understand data to pattern space mapping relations.
Although to several examples that list of predetermined syntax rule in teachings herein, the application be not limited to must be
Full standard or mentioned mode.Foregoing description involved by the embodiment of each in the application is only some implementations in the application
Application in example, embodiment amended slightly can also carry out this above-mentioned Shen on the basis of some standards, model, method
Please each embodiment scheme.Certainly, meet the process method step described in the application the various embodiments described above other are noninvasive
The deformation for the property made, still can realize identical application, will not be repeated here.
Although this application provides the method operating procedure as described in embodiment or flow chart, based on conventional or without creativeness
Work can include more or less operating procedures.The step of being enumerated in embodiment order is only numerous step execution sequences
In a kind of mode, unique execution sequence is not represented., can be according to reality when device or client production in practice is performed
Apply example or method shown in the drawings order is performed or parallel execution (environment of such as parallel processor or multiple threads).
Device or module that above-described embodiment is illustrated, can specifically be realized by computer chip or entity, or by with certain work(
Can product realize.For convenience of description, it is divided into various modules during description apparatus above with function to describe respectively.Implementing
The function of each module can be realized in same or multiple softwares and/or hardware during the application.It is of course also possible to which certain will be realized
The module of function combines realization by multiple submodule or subelement.
Method, device or module described herein can realize controller by any suitable in computer readable program code mode
When mode realize, for example, controller can take such as microprocessor or processor and storage can be by (micro-) processor
Computer-readable medium, gate, switch, the special collection of the computer readable program code (such as software or firmware) of execution
Into circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller (PLC) and embedded microcontroller
Form, the example of controller includes but is not limited to following microcontroller:ARC 625D、Atmel AT91SAM、Microchip
PIC18F26K20 and Silicone Labs C8051F320, the control that Memory Controller is also implemented as memory is patrolled
The part collected.It is also known in the art that in addition to realizing controller in pure computer readable program code mode,
By the way that method and step is carried out into programming in logic controller can be caused with gate, switch completely, application specific integrated circuit, can compiled
Journey logic controller realizes identical function with the form of embedded microcontroller etc..Therefore this controller is considered one kind
Hardware component, and the device for realizing various functions included to its inside can also be considered as the structure in hardware component.Or
Even, it not only can be able to will be the software module of implementation method for realizing that the device of various functions is considered as but also can be hardware component
Interior structure.
Part of module in herein described device can computer executable instructions general context
Described in, such as program module.Usually, program module includes performing particular task or realizes the example of particular abstract data type
Journey, program, object, component, data structure, class etc..The application can also be put into practice in a distributed computing environment, at this
In a little DCEs, task is performed by the remote processing devices connected by communication network.In Distributed Calculation
In environment, program module can be located at including in the local and remote computer-readable storage medium including storage device.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can be by soft
Part adds the mode of required hardware to realize.Understood based on such, the technical scheme of the application is substantially in other words to existing skill
The part that art contributes can be embodied in the form of software product, can also be by being embodied in the implementation process of Data Migration
Out.The computer software product can be stored in storage medium, such as ROM/RAM, magnetic disc, CD, including some
Instruction is to cause a computer equipment (can be personal computer, mobile terminal, server, or network equipment etc.)
Perform the method described in some parts of each embodiment of the application or embodiment.
Each embodiment in this specification is described by the way of progressive, and same or analogous part is mutual between each embodiment
Referring to what each embodiment was stressed is the difference with other embodiment.The all or part of of the application can
For in numerous general or special purpose computing system environments or configuration.For example:It is personal computer, server computer, hand-held
Equipment or portable set, laptop device, mobile communication terminal, multicomputer system, the system based on microprocessor, can
Electronic equipment, network PC, minicom, the mainframe computer of programming include the distributed meter of any of the above system or equipment
Calculate environment etc..
Although depicting the application by embodiment, it will be appreciated by the skilled addressee that the application have it is many deformation and change and
Spirit herein is not departed from, it is desirable to which appended claim includes these deformations and changed without departing from spirit herein.