Summary of the invention
The embodiment of the present invention provides a kind of dynamic creation method and device of three-dimensional chart, in order to solve the problem of the process more complicated of the generation chart existed in prior art.
The embodiment of the present invention is by the following technical solutions:
A dynamic creation method for three-dimensional chart, described method comprises:
Receive subtype and the chart data of user's transmission;
According to the corresponding relation between the property parameters of subtype and graph primitive, graph primitive and the property parameters of word pel, determine the described subtype graph of a correspondence pel, the property parameters of graph primitive and the property parameters of word pel that receive;
The property parameters of the property parameters of graph primitive and word pel is set up data cube computation, wherein, the property parameters of described graph primitive comprises dimensional parameters and color parameter, the property parameters of described word pel comprises color parameter and the word content parameter of word pel, and the content of the word content parameter of described word pel is the numerical value of described chart data;
According to the described data cube computation set up, determine size and the color of described graph primitive, thus dynamically generate chart.
In embodiments of the present invention, according to the data cube computation set up between the property parameters of graph primitive and the property parameters of word pel, determine size and the color of described graph primitive, thus dynamically generate chart.Thus, avoid loaded down with trivial details chart generative process, simplify chart generative process.
Preferably, the property parameters of described graph primitive also comprises location parameter and zooming parameter.
In embodiments of the present invention, the attribute type that graph primitive property parameters comprises has multiple, can select flexibly according to the actual requirements, arrange.
Preferably, the described property parameters by the property parameters of graph primitive and word pel sets up data cube computation, specifically comprises:
The property parameters of the property parameters of graph primitive and word pel is set up logical relation.
In embodiments of the present invention, by the property parameters of the property parameters of graph primitive and word pel is set up logical relation, simplify the fussy degree that chart generates.
Preferably, the logical relation of the property parameters of described graph primitive and the property parameters of word pel, comprising:
Logical expression between the dimensional parameters of graph primitive and word content parameter and the logical expression between the color parameter of graph primitive and the color parameter of word pel;
According to the described data cube computation set up, determine size and the color of described graph primitive, thus dynamically generate chart, specifically comprise:
According to the logical expression between the color parameter of the logical expression between the dimensional parameters of described graph primitive and word content parameter, graph primitive and the color parameter of word pel, determine size and the color of described graph primitive, thus dynamically generate chart.
In embodiments of the present invention, by the property parameters of the property parameters of graph primitive and word pel is set up logical relation, simplify the fussy degree that chart generates.
Preferably, after dynamically generating described chart, described method also comprises:
Receive the chart data after the renewal of user's transmission;
According to the data cube computation of the property parameters of the graph primitive set up and the property parameters of word pel, utilize the chart data after upgrading to upgrade the size of described graph primitive, thus again dynamically generate chart.
In embodiments of the present invention, the innervation of chart can be increased by the mode of dynamic growth, can be more directly perceived and reflect the renewal process of the data that will embody really.
A dynamic generation apparatus for three-dimensional chart, described device comprises:
Receiver module, for receiving subtype and the chart data of user's transmission;
Determination module, for according to the corresponding relation between the property parameters of subtype and graph primitive, graph primitive and the property parameters of word pel, determine the described subtype graph of a correspondence pel, the property parameters of graph primitive and the property parameters of word pel that receive;
Set up module, for the property parameters of the property parameters of graph primitive and word pel is set up data cube computation, wherein, the property parameters of described graph primitive comprises dimensional parameters and color parameter, the property parameters of described word pel comprises color parameter and the word content parameter of word pel, and the content of the word content parameter of described word pel is the numerical value of described chart data;
Generation module, for according to the described data cube computation set up, determines size and the color of described graph primitive, thus dynamically generates chart.
In embodiments of the present invention, according to the data cube computation set up between the property parameters of graph primitive and the property parameters of word pel, determine size and the color of described graph primitive, thus dynamically generate chart.Thus, avoid loaded down with trivial details chart generative process, simplify chart generative process.
Preferably, the property parameters of described graph primitive also comprises location parameter and zooming parameter.
In embodiments of the present invention, the attribute type that graph primitive property parameters comprises has multiple, can select flexibly according to the actual requirements, arrange.
Preferably, describedly module is set up, specifically for the property parameters of the property parameters of graph primitive and word pel is set up logical relation.
In embodiments of the present invention, by the property parameters of the property parameters of graph primitive and word pel is set up logical relation, simplify the fussy degree that chart generates.
Preferably, the logical relation of the property parameters of described graph primitive and the property parameters of word pel, comprising:
Logical expression between the dimensional parameters of graph primitive and word content parameter and the logical expression between the color and dimensions parameter of graph primitive and the color parameter of word pel;
Described generation module, specifically for according to the logical expression between the color and dimensions parameter of the logical expression between the dimensional parameters of described graph primitive and word content parameter, graph primitive and the color parameter of word pel, determine size and the color of described graph primitive, thus dynamically generate chart.
In embodiments of the present invention, by the property parameters of the property parameters of graph primitive and word pel is set up logical relation, simplify the fussy degree that chart generates.
Preferably, after dynamically generating described chart,
Described receiver module, also for receive user send renewal after chart data;
Described generation module, also for the data cube computation according to the property parameters of graph primitive set up and the property parameters of word pel, utilizes the chart data after upgrading to upgrade the size of described graph primitive, thus again dynamically generates chart.
In embodiments of the present invention, the innervation of chart can be increased by the mode of dynamic growth, can be more directly perceived and reflect the renewal process of the data that will embody really.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the present invention is described in further detail, and obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
In embodiments of the present invention, in order to can simplified diagram manufacturing process, avoid the loaded down with trivial details of chart production, propose a kind of dynamic generation scheme of three-dimensional chart, when receiving subtype and the chart data of user's transmission, can according to subtype and graph primitive, corresponding relation between the property parameters of graph primitive and the property parameters of word pel, determine the subtype graph of a correspondence pel received, the dimensional parameters of graph primitive and the word content parameter of word pel, and according to the data cube computation set up between the property parameters of graph primitive and the property parameters of word pel, determine size and the color of described graph primitive, and then dynamically generate chart.Thus avoid loaded down with trivial details chart generative process, simplify chart generative process.
Be described in detail the present invention program below in conjunction with specific embodiment, need to illustrate all, the present invention is not limited to following examples.
Embodiment one:
The present embodiment one provides a kind of dynamic creation method of three-dimensional chart, before generation chart, chart dynamic generation apparatus can prestore multiple subtype and the graph primitive corresponding to often kind of subtype, the property parameters of this graph primitive and the property parameters of word pel.
Described graph primitive includes but not limited to: rectangle, cube, right cylinder, pie chart, broken line etc.
The property parameters of described graph primitive is for dynamically generating graph primitive in chart, the property parameters of described graph primitive includes but not limited to: the parameter of the appearance attribute such as dimensional parameters (be specially length parameter, width parameter, height parameter, radius parameter, scale parameter etc., specifically can select according to the classification of graph primitive), color parameter, location parameter and zooming parameter.
The property parameters of described word pel is that the property parameters of described word pel includes but not limited to: word content parameter and color parameter for dynamically generating word pel in chart.Wherein, the content of the word content parameter of described word pel can be any number of user's input.The content of the color parameter of described word pel is default color, can be the random color such as red, yellow, blue.
The property parameters of property parameters and word pel that described chart dynamic generation apparatus also stored for graph primitive sets up data cube computation, specifically comprises: the logical relation set up between the dimensional parameters of graph primitive and word content parameter and the logical relation between the color parameter of graph primitive and the color parameter of word pel.
The operation relations such as the logical relation between the dimensional parameters of described graph primitive and word content parameter, logical relation between the color parameter of graph primitive and the color parameter of word pel include but not limited to add, subtract, multiplication and division.
It should be noted that, the content prestored can carry out dynamic conditioning by keeper according to virtual condition, as changed the logical relation etc. between the dimensional parameters of graph primitive and the word content parameter of word pel.
After prestoring foregoing, the information that dynamically can input according to user, dynamically generates the chart needed for user simply, quickly, as shown in Figure 1, is the method step process flow diagram that chart dynamically generates, specifically comprises:
Step 101: the subtype and the chart data that receive user's transmission.
Step 102: according to the corresponding relation between the property parameters of subtype and graph primitive, graph primitive and the property parameters of word pel, determine the described subtype graph of a correspondence pel, the property parameters of graph primitive and the property parameters of word pel that receive.
In the scheme of the present embodiment one, when user needs dynamically to generate chart, the subtype and chart data that need the chart dynamically generated just is sent to chart dynamic generation apparatus, the content that the chart dynamic generation apparatus receiving described subtype and chart data can be prestored according to this locality, inquires the described subtype graph of a correspondence pel, the property parameters of graph primitive and the property parameters of word pel that receive.
Such as, when user inputs subtype " bar chart " on the operation interface that chart dynamic generation apparatus provides, chart dynamic generation apparatus is according to the subtype received, determine that user wishes that the graph primitive dynamically generating chart is rectangle, the property parameters inquiring graph of a correspondence pel comprises: the length of rectangular element and color parameter, and inquiring the property parameters of corresponding word pel: word content parameter and color parameter, the content of described word content parameter is the numerical value of chart data.
Step 103: the property parameters of the property parameters of graph primitive and word pel is set up data cube computation.
Wherein, the property parameters of described graph primitive comprises dimensional parameters and color parameter, the property parameters of described word pel comprises color parameter and the word content parameter of word pel, and the content of the word content parameter of described word pel is the numerical value of described chart data.
Owing to determining the graph primitive corresponding to subtype, and the word content parameter of the dimensional parameters of this graph primitive and word pel, the property parameters of the property parameters of graph primitive and word pel can be set up data cube computation, that is: the property parameters of the property parameters of graph primitive and word pel be set up logical relation.
Preferably, the logical relation of the property parameters of described graph primitive and the property parameters of word pel, comprise: the logical expression between the dimensional parameters of graph primitive and word content parameter, and the logical expression between the color parameter of the color parameter of graph primitive and word pel, such as: numerical value/10 of the height=word content parameter of rectangular element; The color of the color=word pel of rectangular element.
Step 104: according to the described data cube computation set up, determine size and the color of described graph primitive, thus dynamically generate chart.
According to the data cube computation set up in step 103, namely according to the logical expression between the dimensional parameters of described graph primitive and word content parameter, logical expression between the color parameter of graph primitive and the color parameter of word pel, determine size and the color of described graph primitive, that is: suppose that the chart data that user inputs is 300, the height that can calculate rectangular element is 30, if the color of the word pel preset is for red, then now the color of rectangular element is also red, thus dynamically generate chart according to the height of the rectangular element calculated and the color of rectangular element.
In embodiments of the present invention, according to the numerical value of the chart data of the color of word pel prestored and dynamically input, the word pel in chart can also dynamically be generated.
Preferably, in the scheme of above embodiment one, when the graph primitive dynamically generated in chart and word pel, chart animation stunt can be adopted, when stunt performs by the numerical value of every frame amendment chart data, according to the data cube computation of the property parameters of the graph primitive set up and the property parameters of word pel, make the size generation respective change of graph primitive, realize the effect of chart dynamic growth.
Preferably, in the scheme of above embodiment one, after the graph primitive dynamically generated in chart and word pel, chart data after the renewal sent by reception user, again according to the data cube computation of the property parameters of graph primitive set up and the property parameters of word pel, utilize the chart data after upgrading to upgrade the size of described graph primitive, thus dynamically generate new chart.Thus, the numerical value of the dimensional parameters of graph primitive can be changed by amendment chart data, and then the apparent size of graph primitive is changed (increase or reduce), produce the stunt of dynamic change.
Visible, in embodiments of the present invention, when receiving subtype and the chart data of user's transmission, can according to the corresponding relation between the property parameters of subtype and graph primitive, graph primitive and the property parameters of word pel, determine the subtype graph of a correspondence pel, the dimensional parameters of graph primitive and the word content parameter of word pel that receive, and according to the data cube computation set up between the property parameters of graph primitive and the property parameters of word pel, determine size and the color of described graph primitive, and then dynamically generate chart.Thus avoid loaded down with trivial details chart generative process, simplify chart generative process.
Embodiment two:
Be described in detail below by way of the dynamic creation method of concrete application scenarios to chart three-dimensional in embodiment one.It should be noted that, the present invention includes but be not limited to following examples.
Scene one: dynamically generate three-dimensional tufted column diagram
First, before dynamically generating three-dimensional tufted column diagram, need for this chart adds corresponding title, scale mark and other descriptive matter in which there.
Secondly, user input the subtype that will dynamically generate and chart data, described subtype is three-dimensional tufted column diagram, and described chart data is { 200; 400; 700}.
Chart dynamic generation apparatus can according to the corresponding relation between the property parameters of the subtype received and graph primitive, graph primitive and the property parameters of word pel, determine that the described subtype graph of a correspondence pel received is cube pel, the property parameters that cube pel is corresponding is height parameter and color parameter, and the property parameters of word pel is word content parameter and color parameter.
The property parameters of the property parameters of graph primitive and word pel is set up data cube computation, the property parameters of the property parameters of graph primitive and word pel is set up logical relation, such as can call the logical relation between the height parameter of cube pel and the word content parameter of word pel: numerical value/10 of the height=word content parameter of cube pel, wherein, word pel is source pel, cube pel is object pel, word content parameter is source primitive attribute parameter, the height of cube pel is object primitive attribute parameter, count is " 10 ", functional symbol is "/", for another example, call the logical relation of the color parameter of cube pel and the color parameter of word pel, suppose that this logical relation is: the color of the color=word pel of cube pel, wherein, word pel is source pel, and cube pel is object pel, and the color parameter of word pel is source primitive attribute parameter, the color parameter of cube pel is object primitive attribute parameter, and functional symbol is "=".
By the word content parameter of the height parameter of graph primitive and word pel is set up data cube computation, call the logical relation of cube pel height parameter and the word content parameter with word pel, and by the color parameter of the color parameter of graph primitive and word pel is set up data cube computation, call cube pel color parameter and the logical relation of the color parameter with word pel, automatically can calculate height and the color of cube pel.
The numerical value { 20 of one group of height parameter is calculated according to the data cube computation of height; 40; 70}, then the cubical height in chart is respectively 20,40,70; The type of the color parameter prestored according to the word pel of chart determines that the color of first cube and first word is all red, the color of second cube and second word is all green, and the color of the 3rd cube and the 3rd word is all yellow.
As shown in Figure 2, in the three-dimensional tufted column diagram chart now dynamically generated, contain three the cube pels being respectively red, green, yellow three kinds of colors, and the word content existed in the form of text is " 20 " " 40 " " 70 ".
It should be noted that, the left slanted bar line in Fig. 2 represents redness, and grid represents green, and nicking represents yellow.
Preferably, can add chart animation stunt for chart, after dynamically generating described chart, during trick play, chart data increases respectively by 0, rises to 200,400,700; Three cubical height increase, respectively until highly rise to 20,40,70 by 0.The mode of this dynamic growth can increase the innervation of chart, can be more directly perceived and reflect the renewal process of the data that will embody really.
Scene two: dynamically generate pie chart chart
First, before dynamically generating pie chart chart, need for this pie chart chart adds corresponding title and other descriptive matter in which there.
Secondly, user input the subtype that will dynamically generate: pie chart, and chart data: 10,25,30,35}.
Chart dynamic generation apparatus can according to the corresponding relation between the property parameters of subtype and graph primitive, graph primitive and the property parameters of word pel, determine that the described subtype graph of a correspondence pel received is pie chart pel, the property parameters that pie chart pel is corresponding is ratio data parameter and color parameter, and the property parameters of word pel is word content parameter and color parameter etc.
The property parameters of the property parameters of graph primitive and word pel is set up data cube computation, the property parameters of the property parameters of graph primitive and word pel is set up logical relation, such as can call the logical relation between the scale parameter of pie chart pel and the word content parameter of word pel: the numerical value summation of the numerical value/word content parameter of the ratio data=word content parameter of pie chart pel, wherein, word pel is source pel, pie chart pel is object pel, word content parameter is source primitive attribute parameter, the ratio data parameter of pie chart pel is object primitive attribute parameter, counting is the numerical value summation of word content parameter, functional symbol is "/", for another example, the logical relation of the color parameter of pie chart pel and the color parameter of word pel can be called: the color of the color=word pel of pie chart pel, wherein, word pel is source pel, pie chart pel is object pel, the color parameter source primitive attribute parameter of word pel, the color parameter object primitive attribute parameter of pie chart pel, functional symbol is "=".
By the ratio data parameter of graph primitive and the word content parameter of word pel are set up data cube computation, call the logical relation of the ratio data parameter of pie chart pel and the word content parameter of word pel, and by the color parameter of the color parameter of graph primitive and word pel is set up data cube computation, call the color parameter of pie chart pel and the logical relation of the color parameter with word pel, automatically can calculate ratio data and the color of pie chart pel.
It should be noted that, because pie chart is that the different area utilizing himself to split reflects the chart data that will embody, therefore, in the chart dynamically generated, embody multiple data by a pie chart pel, the graph primitive being different from multiple identical type in other charts embodies multiple data.Therefore, the ratio data parameter in pie chart and the logical relation between word content parameter also can be different from the logical relation in other subtypes.
Particularly, after the above-mentioned chart data of input, first the numerical value summation of this group chart data will be got, then, respectively each numerical value is substituted into described logical relation, calculate one group of ratio data parameter numerical value 10%, 25%, 30%, 35%}, then the ratio data of the pie chart in chart is respectively 10%, 25%, 30%, 35%; And the type of the color parameter to prestore according to the word pel of chart determines one group of color { orange, purple, black, blueness }.
As shown in Figure 3, in the chart now dynamically generated, contain and be respectively orange, purple, black, a pie chart pel of Lan Si kind color, and the word content existed in the form of text is " 10 " " 25 " " 30 " 35 ", the position relationship between numeral and pel can pre-set according to user's request.Wherein, the white space in Fig. 3 represents orange, and microgrid represents purple, and grid represents black, and right slanted bar line represents blueness.
In embodiments of the present invention, when receiving subtype and the chart data of user's transmission, can according to the corresponding relation between the property parameters of subtype and graph primitive, graph primitive and the property parameters of word pel, determine the subtype graph of a correspondence pel, the dimensional parameters of graph primitive and the word content parameter of word pel that receive, and according to the data cube computation set up between the property parameters of graph primitive and the property parameters of word pel, determine size and the color of described graph primitive, and then dynamically generate chart.Thus avoid loaded down with trivial details chart generative process, simplify chart generative process.
Corresponding to the dynamic creation method of the three-dimensional chart that the embodiment of the present invention one provides, the embodiment of the present invention three additionally provides a kind of dynamic generation apparatus of three-dimensional chart, and following examples three introduce this device in detail.
Embodiment three:
In the embodiment of the present invention three, provide a kind of dynamic generation apparatus of three-dimensional chart, as shown in Figure 4, the structural representation of the dynamic generation apparatus of the three-dimensional chart provided for the embodiment of the present invention three, specifically comprises following functions module:
Receiver module 201, for receiving subtype and the chart data of user's transmission.
Determination module 202, for according to the corresponding relation between the property parameters of subtype and graph primitive, graph primitive and the property parameters of word pel, determine described subtype graph of a correspondence pel, the property parameters of graph primitive and the property parameters of word pel that receiver module 201 receives.
Set up module 203, for the property parameters of the property parameters of graph primitive and word pel is set up data cube computation.
Wherein, the property parameters of described graph primitive comprises dimensional parameters and color parameter, the property parameters of described word pel comprises color parameter and the word content parameter of word pel, and the content of the word content parameter of described word pel is the numerical value of described chart data.
Preferably, the property parameters of described graph primitive also comprises location parameter and zooming parameter.
Preferably, describedly module 203 is set up, specifically for the property parameters of the property parameters of graph primitive and word pel is set up logical relation.
Preferably, the logical relation of the property parameters of described graph primitive and the property parameters of word pel, comprising:
Logical expression between the dimensional parameters of graph primitive and word content parameter and the logical expression between the color and dimensions parameter of graph primitive and the color parameter of word pel.
Generation module 204, for according to the described data cube computation set up, determines size and the color of described graph primitive, thus dynamically generates chart.
Preferably, described generation module 204, specifically for according to the logical expression between the color and dimensions parameter of the logical expression between the dimensional parameters of described graph primitive and word content parameter, graph primitive and the color parameter of word pel, determine size and the color of described graph primitive, thus dynamically generate chart.
Preferably, after dynamically generating described chart,
Described receiver module 201, also for receive user send renewal after chart data;
Described generation module 204, also for the data cube computation according to the property parameters of graph primitive set up and the property parameters of word pel, utilizes the chart data after upgrading to upgrade the size of described graph primitive, thus again dynamically generates chart.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.