Search
Chart Series and Data Binding

SeriesRenderer classes that draw chart graphics read their data through the Series interface. You could implement this interface in your own model classes to avoid duplicating data. Alternatively, if a model class is sealed but provides API to access its data, you can implement the interface in an adapter class.

The library includes several pre-defined series classes that let you specify data via List or array objects. They are:

  • BarSeries where you specify lists of values, inner labels and top labels.
  • DataBoundSeries where the data is given as strings that identify fields in the DataSource that provide data for chart values, labels etc.
  • DateTimeSeries  where you specify the data range as DateTime values.
  • PieSeries where you specify list with numbers, and optionally lists with the inner and outer labels.
  • PointSeries where the data is a list of points.
  • PointSeries3D where the data is Point3D instances.
  • Series2D class that supports two lists with data for the X and Y values.
  • Series3D class that supports three dimensional data with arrays for the X, Y and Z coordinates of the points.
  • SimpleSeries that has only a list with numbers and a list with labels.
  • StockPriceSeries whose elements are StockPrice objects with fields for the open, close, high and low values of a stock.
  • XmlSeries class that provides convenient interface for reading data and labels from an XML file.

If you use data binding you should set the DataSource property of a Chart control. This automatically creates DataBoundSeries for all fields listed in the chart's *Fields properties such as XDataFields.

Series instances of different type can freely be mixed together in a single Chart as long as they are appropriate for the given Chart. For example, it is acceptable to create a BarChart with a DateTimeSeries, a DataBoundSeries and a SimpleSeries.