MindFusion.Charting Programmer's Guide

Setting the Chart's Data

Charts that use the Cartesian coordinate system use two basic properties for setting the data - XData and YData. A third data property is also available - Y2Data and it is used by the second Y-axis. Those properties are of type IList and hold other lists with the data. The member lists can be different in count. The count of graphics in vertical charts depends on the YData property; the count of graphics in horizontal charts depends on XData.

In bubble charts, the Y2Data property is used as a third data array, which determines the radius of the bubble. In such cases, the second Y axis is not drawn. When no Y2Data is specified, the bubble radius is calculated based on the YData values.

Pie, bar and radar charts use a single property called Data (See PieChart.Data, BarChart.Data, RadarChart.Data).

Data in line chars can be either numbers or DateTime values. The rest of the charts support only numbers. Data of any format is acceptable as long as it can be converted to numbers or DateTime values using the standard .NET DoubleConverter and DateTimeConverter classes. Negative values for all charts that use the Cartesian coordinate system are supported.

In bar charts of type Groups2D/Groups3D, each group is drawn with data from the subsequent array in the Data property and each data series forms one group. When the BarType is Clustered2D / Clustered3D, each cluster is built with the numbers placed at the same positions in each array in the Data property.

Pie charts cannot have more than one graphics. If you need to draw several pies, add several instances of the PieChart control to your application.

MindFusion.Charting supports database binding. Check DataMember and DataSource properties for further details. Read the BarChart Members, PieChart Members, LineChart Members and RadarChart Members for more information about the properties for the specific chart type, which can be bound to database fields.

See Also

Using DateTime Values
Axes of the Chart
Adding Summary Values
Retrieving Chart Data from a Database