ChartDirector Ver 4.1 (PHP Edition)

ChartDirector Object Model Overview


This section will give a very brief high level overview of the ChartDirector object model, which may be helpful for understanding of subsequent ChartDirector tutorials. The full details object model and API are documented in the ChartDirector Reference section.

The Top Level

At the top level, all ChartDirector charts (including meters) are derivatives of the BaseChart object. The following describes the top level class hierarchy.


BaseChart

The BaseChart class represents features common to all ChartDirector charts, such as the chart background, legend box (LegendBox), titles and custom text boxes (TextBox). It also contains a DrawArea tool, which allows you to add arbitrary custom drawings to the chart.

PieChart

The PieChart class, as it name implies, represents pie charts, including donut charts. PieChart objects contain Sector objects, which represent the sectors in the pie charts.

XYChart

The XYChart class represents all chart types that have x and y axes. Each XYChart object contains a PlotArea object, representing the rectangular region where the chart is actually drawn. A XYChart also contains Axis objects, representing the x and y axes.

The actual chart types in a XYChart are implemented as layers. The available layers are listed below. A XYChart can contain many layers, so combination and custom chart types can easily be created.

LayerDescription
BarLayerRepresent all style of bar charts, such as simple bar charts, multi-bar charts, stacked bar charts, multi-stacked bar charts, percentage bar charts, depth bar charts.
LineLayerRepresent line charts.
SplineLayerRepresent spline line charts.
StepLineLayerRepresent step line charts.
TrendLayerRepresent trend line charts. A trend line the best fit straight line computed using the least square method.
InterLineLayerA layer used for filling regions between two lines. The lines can come from LineLayer, SplineLayer, StepLineLayer, TrendLayer, or from Mark.
ScatterLayerRepresents scatter and bubble charts.
VectorLayerRepresents vector charts.
AreaLayerRepresent area charts.
HLOCLayerRepresent high-low-open-close charts.
CandleStickLayerRepresent candlestick charts.
BoxWhiskerLayerRepresent box-whisker charts.

The above layers are derived from the Layer class, which represents features common to all layers.

Each chart layer contains one or more DataSet objects. A DataSet object represents a data series. Several chart types require multiple data series, such as high-low-open-close, candlestick and box-whisker charts. Other chart types support combining the data series in various ways. For example, in a bar chart, multiple data series can be combined to form a stacked bar chart, percentage bar chart, multi-bar chart, multi-stacked bar chart, etc.

PolarChart

The PolarChart class represents polar and radar charts. Each PolarChart object contains a RadialAxis and an AngularAxis. The actual chart types in a PolarChart are implemented as layers. A PolarChart can contain many layers, so combination and custom chart types can easily be created.

The available layers are listed below.

LayerDescription
PolarLineLayerRepresent line charts, as well as scatter and bubble charts. (A scatter chart is a line chart with line set to Transparent. A bubble chart is a scatter chart in which the data symbols are of variable sizes.)
PolarAreaLayerRepresent area charts.
PolarSplineLineLayerRepresent spline line charts.
PolarSplineAreaLayerRepresent spline area charts.
PolarVectorLayerRepresent vector charts.

The above layers are derived from the PolarLayer class, which represents features common to all layers.

BaseMeter

The BaseMeter class is the base class for all meters. It represents features common to all meters. A BaseMeter object contains MeterPointer objects for representing meter pointers.

AngularMeter

The AngularMeter class represents angular meters, which are meters of which the meter pointers rotate to show the readings.

LinearMeter

The LinearMeter class represents horizontal and vertical linear meters, which are meters of which the meter pointers move linearly to show the readings.

MultiChart

A MultiChart object is a container for combining multiple BaseChart objects into a combined chart object.

FinanceChart

FinanceChart is a financial charting library built on top of the main ChartDirector library. It extends MultiChart by implementing many financial indicators, and allowing complex financial charts to be composed easily.