Embodiment
In order that those skilled in the art more fully understand the technical scheme in the application, it is real below in conjunction with the application
The accompanying drawing in example is applied, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described implementation
Example only some embodiments of the present application, rather than whole embodiments.Based on the embodiment in the application, this area is common
The every other embodiment that technical staff is obtained under the premise of creative work is not made, should all belong to the application protection
Scope.
The processing method to generation chart components system described herein is described in detail below in conjunction with the accompanying drawings.Figure
1 is a kind of method flow schematic diagram of the embodiment for the generation chart components system processing method that the application is provided.Although this Shen
Such as following embodiments or method operating procedure shown in the drawings please be provide, but is existed based on routine or without performing creative labour
More or less operating procedures can be included in methods described.The step of necessary causality is not present in logicality
In, the execution sequence of these steps is not limited to the execution sequence of the embodiment of the present application offer.The generation of methods described in practice
In the processing procedure of chart components system or when device is performed, it can be held according to embodiment or method shown in the drawings order
Row or parallel execution.
A kind of embodiment of the processing method for the generation chart components system that specific the application is provided is as shown in figure 1, institute
The method of stating can include:
S1:Obtain the business structure information of object diagram.
In one embodiment of the application, the object diagram can be financial chart, mathematical analysis chart, at other
In embodiment, the object diagram can also be the relative complex chart of other kinds of structure.In the present embodiment, it can obtain
The business structure information of the object diagram, further according to the business structure information, chooses corresponding target element.Specifically,
In one embodiment of the application, the business structure of object diagram built can be needed by analysis, the target is obtained
The business structure information of chart.The business structure information can include the letter such as service basic component of the object diagram
Breath.For example, finance K line charts include the basic component such as ground line, hand number, reference axis, K lines, fund figure includes ground line, sat
The basis such as parameter component.In other embodiments, the business structure information can also include the finger of the object diagram
Determine the information such as usage scenario, the application is not limited herein.
The business structure information of object diagram is obtained, effective data basis can be provided for follow-up target element of choosing.
S2:According to the business structure information, concentrated from default chart components and choose what is matched with the object diagram
Target element.
In the present embodiment, it can concentrate and choose and the target from default chart components according to the business structure information
The target element that chart matches.The default chart components, which are concentrated, at least includes a chart components, and the chart components can
With the attribute information including the chart components and the method for realizing preset function.Wherein, the attribute information can include
The access object of chart data, the attribute such as width, height, the preset function can be real including the chart components
Existing function, in specific programming, the method for realizing preset function can be represented in the form of function.For example, group
Part " painter " can include the attribute such as width, height, and realize preset function method line (parameter 1) function,
Start (parameter 2) function, end (parameter 3) function etc..In the present embodiment, the chart components can as chart data and
Chart can realize the packaging body of function, can reuse and can carry out data interaction with other chart components.
In one embodiment of the application, the default chart components collection can include basic chart component set and two grades
Chart components collection, wherein, the chart components that two grades of chart components are concentrated are based on the basic chart component set combination producing.
In the present embodiment, the basic chart component set includes at least one basic chart components, and two grades of chart components are concentrated
Including at least one two grades of chart components.Basic chart components and two grades of chart components are specifically illustrated below by one
Relation, Fig. 2 is the UML graphs of a relation of basic chart components and two grades of chart components in the financial field that the application is provided.Such as Fig. 2
It is shown, in the present embodiment, the business structure information of financial chart is obtained by analysis, chart components as shown in Figure 2, tool are built
Body can include " painter ", " ground line-painter ", " hand number-painter ", " reference axis-painter ", " K lines-
The components such as painter ".Wherein, " ground line-painter ", " hand number-painter ", " reference axis-painter ", " K lines-
Four components of painter " are inherited in component " painter ", it is possible to understand that the category of aforementioned four component retention component " painter "
Property and function, but each component can increase new function again.Similarly, component " X-axis-painter " and component " Y-axis-
Painter " is inherited in component " reference axis-painter ".Component " chart " shown in Fig. 2 be by " ground line-painter ",
" hand number-painter ", etc. component assembly form, specific polymerization specification hereafter described in.As shown in Fig. 2 this reality
Apply in example, by component " ground line-painter ", " hand number-painter ", " reference axis-painter ", " K lines-painter ",
Chart components based on " gesture ".In the present embodiment, component " X-axis-painter ", " Y-axis-painter ", " chart " are made
For two grades of chart components.It should be noted that the chart components that the default chart components are concentrated can be to have developed and thrown
Enter the chart components product used, can also be the chart components for more conforming to practical business demand of exploitation, the application is herein
It is not limited.
In the present embodiment, the element needed for building chart is subjected to modularization, because component has portability and can
Maintainability, the degree of coupling of system can be substantially reduced using component construction financial chart system so that system is keeping interface not
In the case of change, replace component to meet the demand of system.
S3:The target element is configured to the chart components system for generating the object diagram.
In the present embodiment, the target element can be configured to the chart components system for generating the target element.It is described
Chart components system can input business datum to the chart components system as the basic system for generating the object diagram
In system, the object diagram matched with the business datum can be generated., can be by the method that configures by institute in the present embodiment
State chart components system described in target composition combination producing.It is described by the target element in one embodiment of the application
The chart components system of the configuration generation object diagram can include:
SS:Rewriting, the configuration generation target are combined to the target element using MVC model
The chart components system of chart.
In the present embodiment, model (model)-view (view)-controller (controller) mould can specifically be used
The target element is combined rewriting, the chart components system of the configuration generation object diagram by formula (MVC pattern).This reality
Example is applied there is provided a kind of method that configuration is combined to target element, Fig. 3 is matching somebody with somebody to target element combination for the application offer
A kind of method flow diagram of embodiment of method is put, as shown in figure 3, methods described can include:
S31:Required according to pre-set business, the rewrite method of the target element is set;
S32:Model component is built, the model component is used to send business datum to view component;
S33:View component is built, the view component is used to combine the target element, and according to the business received
Data draw generation object diagram;
S34:Controller assemblies are built, the controller assemblies are used to enter the target element according to the rewrite method
Row method is rewritten, and controls the model component and the view component.
In the present embodiment, the model layer in MVC pattern, view layer, key-course can be subjected to modularization, mould is built respectively
Type component, view component, controller assemblies.Wherein, the model component is inherited in model base class, for business datum to be provided
Drawn a diagram to view component, correspondingly, the model component can be set to perform following actions:Business datum is sent to view
Component.It should be noted that the business datum in the present embodiment can be the data source to be transformed into object diagram, such as it is financial
Data, Mathematical Analysis Data etc., the business datum can be inputted by preset interface to the model component.The sets of views
Part is inherited in view base class, and for the business datum according to model component, composite object component is drawn and shows target figure
Table, correspondingly, can set the view component to perform following actions:The target element is combined, according to the business received
Data draw generation object diagram.The controller assemblies are inherited in controller base class, for reference to the model component and institute
View component is stated, and controls the model component and the view component, correspondingly, the controller assemblies can be set to perform
Following actions:Combine, control the model component and the view component.
In the present embodiment, the rewrite method of the target element according to business demand, can be set.As described above, described
The method that chart components can include the attribute information of the chart components and realize preset function., can be with the present embodiment
On the basis of the preset function of the target element, according to actual business demand, the realization side of the preset function is rewritten
Method so that the implementation of the preset function matches with the business demand.As described above, the preset function realized
Method can be represented in the form of function, in the present embodiment, and the method for realizing the preset function is written over, can
To ensure the title and parameter constant of institute's use function, and it is to change the method for realizing the preset function, in this way, can be
The target element need not be done on the basis of many change, meet multiple business demand.
In the chart components system generated based on MVC pattern that the present embodiment is provided, model component can be used for encapsulating core
Calculation evidence and function, are represented and input behavior independently of specific output.Model component only has functional interfaces, passes through the work(
Energy property interface externally provides serial of methods.The relevant information of respective view is also stored in model component so that in the shape of model
When state changes, corresponding view can be notified to be updated.Controller assemblies can be used for Controlling model component, so as to
Model component transmits data, changes the state of model component, and finally results in the renewal of view component.It is closely connected between three
But it is independent mutually, the change of each component internal does not cause both changes in addition.For example, it is desired to change object diagram
Business rule, it is only necessary to change model component, now, view component and controller assemblies are not affected.Therefore,
Chart system is built using MVC pattern, it is possible to achieve the modularization and lower coupling of chart system, greatly facilitate chart system
Safeguard and upgrade.
In one embodiment of the application, the model component can also by business datum be sent to view component it
Before, the data format to the business datum carries out adaptation adjustment, and the model component is additionally operable to:
SS1:Parsing obtains the data format of the business datum;
SS2:By the Data Format Transform of the business datum into pre-set business data format.
In the present embodiment, the business datum can be obtained with a variety of methods, wherein being much real-time from third-party platform
Obtain, therefore, the data format of the business datum of acquisition is not quite similar, at this time, it may be necessary to which the data format of business datum is unified
Change, be converted into pre-set business data format.For example, in financial chart systematic procedure is set up, setting stock type is A-share, but
Being may be comprising A-share, B strands, a variety of stock type data such as H-share, now, in order to adapt to pre-set business in the business datum obtained
Data format, can only extract the corresponding business datum of A-share.Furthermore it is also possible to by the financial term with a variety of expression ways
Uniformly it is converted into a kind of term.
In the present embodiment, business datum can be converted into pre-set business data in model component according to business demand
Form, realizes being adapted to, uniformly for business datum, so as to provide good data basis for generation object diagram.
, can after the chart components system of the configuration generation object diagram in another embodiment of the application
To generate object diagram based on the chart components system, as shown in figure 1, target element configuration is being generated into the target
After the chart components system of chart, methods described can also include:
S14:Based on the chart components system, the object diagram matched with the business datum obtained is built.
In the present embodiment, the first preset interface of incoming traffic data can be set in the chart components system, led to
The input of business datum can be received by crossing first preset interface., can also be in institute in another embodiment of the application
The second preset interface for being set in chart components system and being available for external call is stated, such as api interface is preset by described second and connect
Mouth can receive the instruction for drawing object diagram, and the object diagram is drawn can include drawing the object diagram in instruction
The information such as time.In response to the object diagram draw instruct, using the chart components system, can in web container incite somebody to action
The business datum is rendered to object diagram.
In one embodiment of the application, parameter configuration can also be carried out to the graph structure component, for example, in life
During into financial chart, cut-off rule quantity can be controlled by parameter configuration, the corresponding drafting face of the equal line of price, ups and downs whether is shown
Color, the background colour of different zones, different parameters are corresponding to draw the selection of the chart outward appearances such as color.Fig. 4 is the figure that the application is provided
A kind of method flow diagram of embodiment of table collocation method, as shown in figure 4, it is described be based on the chart components system, build with
The object diagram that the business datum matches includes:
S41:Obtain the corresponding parameter value of the chart components system chart configuration parameter;
S42:The chart components system is configured according to the chart configuration parameter and corresponding parameter value;
S43:Based on the chart components system postponed, the object diagram matched with the business datum is built.
In the present embodiment, the configuration system for chart parameter configuration can be set up, the configuration system can be realized
A variety of chart configuration parameters and the figure can be provided in interacting between developer and chart interface, the configuration system
The corresponding optional parameters of table configuration parameter.The chart configuration interface figure that Fig. 5 provides for the application, as shown in figure 5, being on the left of interface
Financial chart type selecting region, right side is chart configuration parameter setting area, and the present embodiment includes multistage chart configuration ginseng
Number, the multistage chart configuration parameter formation tree data structure, as shown in figure 5, " Shou Shuo areas " is one-level chart configuration parameter,
" cylindricality " is two grades of chart configuration parameters for belonging to " Shou Shuo areas ", and " color of cylindricality " is the three-level chart configuration for belonging to " cylindricality "
Parameter.There is the chart configuration parameter " background colour " configuration parameter in corresponding optional parameters value, such as Fig. 5 to have a variety of face
Color sorting value, certainly, the parameter value of the chart configuration parameter can also be User Defined value, such as height value, width value
Deng.
In one embodiment of the application, Fig. 6 is one kind to chart components ' In System Reconfiguration Method that the application is provided
The method flow diagram of embodiment, as shown in fig. 6, it is described according to the chart configuration parameter and corresponding parameter value to the figure
Table component system, which carries out configuration, to be included:
S61:The chart configuration parameter and corresponding parameter value are generated to the configuration object of key-value pair form;
S62:The chart components system is configured according to the configuration object.
, can be by the chart configuration parameter and the chart after the corresponding parameter value of the chart configuration parameter is set
The corresponding parameter value of configuration parameter is built into configuration object, specifically, can be by the configuration item and the chart configuration parameter
Corresponding parameter value is configured to object in the form of key-value pair.For example, in JavaScript, can be set by options
The parameter value of chart configuration parameter, by chart configuration parameter and corresponding the parameter value structure in the form of key-value pair of the system of configuration
Build up configuration object.
In the present embodiment, the chart configuration parameter and corresponding parameter value are built into configuration in the form of key-value pair
Object, can improve the allocative efficiency of the chart components system.
Above-described embodiment method is illustrated below by a specific application scenarios, Fig. 7 is answering for the application offer
With schematic diagram of a scenario, as shown in fig. 7, regarding the K line charts in financial class chart as object diagram., can be with before K line charts are built
Inquire about and whether there is the corresponding chart components system of K line charts in existing financial class chart components, if in the presence of can be straight
Connect and call corresponding K line charts chart components system.
If for example, there is the K line charts chart components system in existing financial class chart components, calling the K
After line chart chart components system, the configuration data of configuration system generation can be obtained, the configuration data can include chart
Configuration parameter and corresponding parameter value.After the configuration data is obtained, financial circles can also be obtained by preset interface
Business data.According to the configuration data and the financial transaction data, the K line charts chart components system example can be melted into
Specific object.By calling the corresponding application programming interface of the object, what reception system was pre-set draws a diagram
Instruction, based on the instruction, the financial transaction data is rendered to corresponding K line charts chart in web container.
, can be from carrying if the corresponding chart components system of K line charts is not present in existing financial class chart components system
The default chart components supplied, which are concentrated, chooses target element, and sets the corresponding rewrite method of the target element.Regarded using model
Figure director mode is combined rewriting, the chart components system of the configuration generation K line charts to the target element.Specifically
Ground, can by the model layer of MVC pattern, view layer, controller layer carry out modularization, respectively build model component, view component,
Controller assemblies.Wherein, the model component inherits model base class, can be configured to perform following actions:Needed according to business
Ask and method rewriting is carried out to the model base class, and, data adapter unit is loaded, the data format of financial transaction data is converted
Sent into pre-set business data format, and by the financial transaction data after adaptation to view layer.The view component inherit in regarding
Figure base class, can be set execution following actions:Method rewriting is carried out to the view base class according to business demand, and, group
The chart components that target element is concentrated are closed, are drawn a diagram based on the business datum after the adaptation.In this scene, the sets of views
Part can call canvas painting canvas API to draw a diagram, canvas painting canvas have small CPU usage, easy extension, easily use etc. it is excellent
Point, therefore Installed System Memory consumption can be reduced.The controller assemblies are inherited in controller base class, execution can be set following
Action:Method rewriting is carried out to the controller base class according to business demand, and, built-up pattern component and view component, control
Chart components in loaded targets component set processed.Finally, the model component, view component, controller assemblies are combined, institute is generated
State the chart components system of K line charts.It should be noted that in the present embodiment, can also be according to existing financial system chart group
Part system generates " the chart groups in the K line charts chart components system, the financial system chart components system such as Fig. 2
Part ", the generation method of " the chart components " is identical with the method for above-mentioned generation K line charts chart components system.By described
, can be according to the business demands of K line charts, to " the chart during " chart components " generation K line chart chart components systems
The corresponding target element of component ", MVC components carry out method rewriting, generate the K line charts chart components system.In this way, can be right
Existing financial system chart components system is reused, and is saved the time of K line chart chart components systems that builds, is improved structure
Build efficiency.Certainly, described " chart components " can be also used for generating the other kinds of chart components system in financial class chart
System, such as Time Index Chart chart components system, fund figure icon component.
The processing method for the generation chart components system that the application is provided, can enter the component needed for building chart
Row modularization, because component has composability and portability, component is combined the chart group generated after systematization
Part system not only can also reduce the degree of coupling of system with the extension mechanism of lifting system so that system is keeping interface not
In the case of change, replace component to meet different system requirements.In addition, component also has higher maintainability, therefore, group
The introducing of part can also simplify system debug process, and due to the lower coupling between component, component is entered according to business demand
When carrying out system debug after row change, logic analysis process will simplify much relative to high degree of coupling system is analyzed.Component
Durability can reduce the memory size of chart components system, therefore, be applicable using the chart components systematic comparison of component construction
In mobile terminal, it is ensured that icon component system is in the relatively low CPU usage of mobile terminal.
Based on the processing method of above-mentioned generation chart components system, on the other hand the application also provides a kind of generation chart group
The processing unit of part system, Fig. 8 is a kind of module of the embodiment for the generation chart components system processing unit that the application is provided
Structural representation, as shown in figure 8, the processing unit 80 of the generation chart components system can include:
Business structure acquiring unit 81, the business structure information for obtaining object diagram;
Target element chooses unit 82, for according to the business structure information, concentrating and choosing from the chart components of offer
The target element matched with the object diagram;
Component system generation unit 83, the chart components system of the object diagram is generated for the target element to be configured
System.
The processing unit for the generation chart components system that the application is provided, can enter the component needed for building chart
Row modularization, because component has composability and portability, component is combined the chart group generated after systematization
Part system not only can also reduce the degree of coupling of system with the extension mechanism of lifting system so that system is keeping interface not
In the case of change, replace component to meet different system requirements.In addition, component also has higher maintainability, therefore, group
The introducing of part can also simplify system debug process, and due to the lower coupling between component, component is entered according to business demand
When carrying out system debug after row change, logic analysis process will simplify much relative to high degree of coupling system is analyzed.Component
Durability can reduce the memory size of chart components system, therefore, be applicable using the chart components systematic comparison of component construction
In mobile terminal, it is ensured that icon component system is in the relatively low CPU usage of mobile terminal.
As shown in figure 8, in one embodiment of the application, described device 80 can also include:
Object diagram generation unit 84, for based on the chart components system, building the business datum phase with obtaining
The object diagram matched somebody with somebody.
In one embodiment of the application, the chart components collection includes basic chart components and two grades of chart components,
Wherein, two grades of chart components are based on the basic chart components combination producing.
In another embodiment of the application, the chart components that the chart components are concentrated include the chart components
Attribute information and the method for realizing preset function.
In one embodiment of the application, the component system generation unit 83 is additionally operable to utilize Model View Controller
Pattern is combined rewriting, the chart components system of the configuration generation object diagram to the target element.
Fig. 9 is a kind of method flow diagram of the embodiment for the component system generation unit that the application is provided, as shown in figure 9,
The component system generation unit 83 includes:
Setting unit 91 is rewritten, for being required according to pre-set business, the rewrite method of the target element is set;
Model component construction unit 92, for building model component, the model component is used to sending business datum to regarding
Figure component;
View component construction unit 93, for building view component, the view component is used to combine the target element,
Generation object diagram is drawn according to the business datum received;
Controller assemblies construction unit 94, for building controller assemblies, the controller assemblies are used for according to described heavy
Write method carries out method rewriting to the target element, and controls the model component and the view component.
In one embodiment of the application, the model component construction unit 92 also includes:
Data format resolution unit, the data format of the business datum is obtained for parsing;
Date Conversion Unit, for by the Data Format Transform of the business datum into pre-set business data format.
Figure 10 is a kind of modular structure schematic diagram of the embodiment for the object diagram generation unit that the application is provided, such as Figure 10
Shown, the object diagram generation unit 84 can include:
Configuration parameter acquiring unit 101, for obtaining the corresponding parameter value of the chart components system chart configuration parameter;
Component Configuration unit 102, for according to the chart configuration parameter and corresponding parameter value to the chart group
Part system is configured;
Chart configures generation unit 103, for based on the chart components system postponed, building and the business datum phase
The object diagram of matching.
Figure 11 is a kind of modular structure schematic diagram of the embodiment for the component Configuration unit that the application is provided, such as Figure 11 institutes
Show, the component Configuration unit 102 can include:
Object generation unit 111 is configured, for the chart configuration parameter and corresponding parameter value to be generated into key-value pair
The configuration object of form;
Infrastructure component dispensing unit 112, for being configured according to the configuration object to the chart components system.
Based on the processing method and processing device of the generation chart components system, on the other hand the application also provides a kind of generation
The processing system of chart components system, the system can include:
Model component, for sending the business datum obtained to view component;
View component, the target element chosen is concentrated for combining from default chart components, and according to receiving
Business datum draws generation object diagram;
Controller assemblies, the controller assemblies are used to combine, control the model component and the view component.
Although mentioned in teachings herein the component combination rewriting in embodiment, Data Format Transform, parameter configuration etc. it
The data of class are set, processing description, and still, the application is not limited to comply fully with industry programming language design standard
Or the data described by embodiment are set, the situation of processing.Some implementations amended slightly on the basis of embodiment description
Scheme can also carry out above-described embodiment it is identical, equivalent or close or deformation after it is anticipated that implementation result.Certainly, even if not
By the way of upper data set, handled, as long as the component combination for meeting the application the various embodiments described above is rewritten, data format turns
Change, parameter configuration mode, 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 noninvasive
The means for the property made can include more or less operating procedures.The step of being enumerated in embodiment order is only numerous steps
A kind of mode in execution sequence, unique execution sequence is not represented., can when device or client production in practice is performed
To perform or perform parallel (such as at parallel processor or multithreading according to embodiment or method shown in the drawings order
The environment of reason).
Unit that above-described embodiment is illustrated, device, system, can specifically be realized, Huo Zheyou by computer chip or entity
Product with certain function is realized.For convenience of description, it is divided into various modules when describing apparatus above with function to distinguish
Description.Certainly, the function of each module can be realized in same or multiple softwares and/or hardware when implementing the application.
Certainly, a certain unit module described herein can also will realize the module of same function by multiple submodule or submodule
Combination realize.
It is also known in the art that in addition to realizing controller in pure computer readable program code mode, it is complete
Controller can be caused with gate, switch, application specific integrated circuit, programmable by the way that method and step is carried out into programming in logic entirely
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
Person even, not only can be able to will be the software module of implementation method but also can be hardware for realizing that the device of various functions is considered as
Structure in part.
The application can be described in the general context of computer executable instructions, such as program
Module.Usually, program module includes performing particular task or realizes routine, program, object, the group of particular abstract data type
Part, data structure, class etc..The application can also be put into practice in a distributed computing environment, in these DCEs,
Task is performed by the remote processing devices connected by communication network.In a distributed computing environment, program module can
With positioned 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
Realized by the mode of software plus required general hardware platform.Understood based on such, the technical scheme essence of the application
On the part that is contributed in other words to prior art can be embodied in the form of software product, the computer software product
It can be stored in storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are to cause a computer equipment
(can be personal computer, mobile terminal, server, or network equipment etc.) performs each embodiment of the application or implementation
Method described in some parts of example.
Each embodiment in this specification is described by the way of progressive, same or analogous portion between each embodiment
Divide mutually referring to what each embodiment was stressed is the difference with other embodiment.The application can be used for crowd
In more general or special purpose computing system environments or configuration.For example:Personal computer, server computer, handheld device or
Portable set, laptop device, multicomputer system, the system based on microprocessor, set top box, programmable electronics are set
Standby, network PC, minicom, DCE of mainframe computer including any of the above system or equipment 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 is without departing from spirit herein, it is desirable to which appended claim includes these deformations and changed without departing from the application's
Spirit.