Charts are great for displaying information to users in a graphical,
tangible way. To support charts in .NET applications, Microsoft
provides an add-on for .NET 3.5 SP1 and Visual Studio 2008 to support
robust charts without purchasing expensive, proprietary software. In
order to create charts , you will
need to install Microsoft Chart Controls for Microsoft .NET Framework
3.5 and Microsoft Chart Controls add-on for Microsoft Visual Studio
2008. If you are new to MS Charts, you can check out this overview to
help you get started and set up.
The following are overviews of the key pieces used in creating and
displaying a chart with the MSChart control. ChartAreas
The ChartAreas property is a collection of ChartArea objects. A
ChartArea is what is responsible for the display properties of the
container, or "background," of the chart. Since there can be more than
one, this means that a single MSChart control can have multiple charts
contained within it.
Series
The Series property, like the ChartAreas property, is a collection.
A single Series instance contains 3 important properties: the ChartArea
property, the ChartType property, and the Points collection property.
Data Binding
Data can be bound at either design-time or run-time. To bind at
design-time use the Data Source Configuration Wizard that can be found
by clicking on the dropdown button for the DataSource property directly
on the MSChart control. If you already have data sources configured,
you can select them from the list provided.
Chart Methods:
- DataBind(): The basic method to bind to the set data source.
- DataBindTable(): Binds the chart to a specific data
table. Does not allow for binding multiple Y values, different data
sources per series or different data sources for X and Y values.
- DataBindCrossTab(): Binds the chart to a data source
and allows grouping of data based on a column of data. A separate
series is automatically created per unique value in the specified
column.
i thing its enough to understand MS cahrt control