1318 |
alexandre_ |
1 |
Dojo Charting Engine
|
|
|
2 |
=========================================================================
|
|
|
3 |
The Dojo Charting Engine is a (fairly) complex object structure, designed
|
|
|
4 |
to provide as much flexibility as possible in terms of chart construction.
|
|
|
5 |
To this end, the engine details the following structure:
|
|
|
6 |
|
|
|
7 |
Chart
|
|
|
8 |
---PlotArea[]
|
|
|
9 |
------Plot[]
|
|
|
10 |
---------Axis (axisX)
|
|
|
11 |
---------Axis (axisY)
|
|
|
12 |
---------Series[]
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
A Chart object is the main entity; it is the entire graphic. A Chart may
|
|
|
16 |
have any number of PlotArea objects, which are the basic canvas against
|
|
|
17 |
which data is plotted. A PlotArea may have any number of Plot objects,
|
|
|
18 |
which is a container representing up to 2 axes and any number of series
|
|
|
19 |
to be plotted against those axes; a Series represents a binding against
|
|
|
20 |
two fields from a data source (initial rev, this data source is always of
|
|
|
21 |
type dojo.collections.Store but this will probably change once dojo.data
|
|
|
22 |
is in production).
|
|
|
23 |
|
|
|
24 |
The point of this structure is to allow for as much flexibility as possible
|
|
|
25 |
in terms of what kinds of charts can be represented by the engine. The
|
|
|
26 |
current plan is to accomodate up to analytical financial charts, which tend
|
|
|
27 |
to have 3 plot areas and any number of different types of axes on each one.
|
|
|
28 |
|
|
|
29 |
The main exception to this is the pie chart, which will have it's own
|
|
|
30 |
custom codebase. Also, 3D charts are not accounted for at this time,
|
|
|
31 |
although the only thing that will probably need to be altered to make
|
|
|
32 |
that work would be Plot and Series (to accomodate the additional Z axis).
|
|
|
33 |
|
|
|
34 |
Finally, a Plot will render its series[] through the use of Plotters, which
|
|
|
35 |
are custom methods to render specific types of charts.
|
|
|
36 |
-------------------------------------------------------------------------
|
|
|
37 |
In terms of widgets, the basic concept is that there is a central, super-
|
|
|
38 |
flexible Chart widget (Chart, oddly enough), and then any number of preset
|
|
|
39 |
chart type widgets, that are basically built to serve a simple, easy
|
|
|
40 |
purpose. For instance, if someone just needs to plot a series of lines,
|
|
|
41 |
they would be better off using the LineChart widget; but if someone needed
|
|
|
42 |
to plot a combo chart, that has 2 Y Axes (one linear, one log) against the
|
|
|
43 |
same X Axis, using lines and areas, then they will want to use a Chart widget.
|
|
|
44 |
Note also that unlike other widgets, the Charting engine *can* be called
|
|
|
45 |
directly from script *without* the need for the actual widget engine to be
|
|
|
46 |
loaded; the Chart widgets are thin wrappers around the charting engine.
|