Creation of the simple windows forms application that uses Chart Component .NET (Manco.Chart control for .NET) as easy as 1-2-3. Probably you will spend more time on customizing chart XML theme then on coding application itself.
Let see how it could be done in practice. At the first we should create simple chart desktop application.
Choose data source that will provide data for charting. We will use array of doubles as source of the data in this sample.
The code that implements this sequence could looks like the following:
int liCategoryCount = 3; // Set desirable number of the categories int liSeriesCount = 3; // Set desirable number of the series
// Declare array of doubles double[,] ldaData = new double[liCategoryCount, liSeriesCount];
double ldMin = 5; double ldMax = 30;
// Fill array with data here Random rnd = new Random(); for( int i = 0; i < liCategoryCount; i++) { for( int j = 0; j < liSeriesCount; j++) { ldaData[i,j] = ldMin + (ldMax - ldMin) * rnd.NextDouble(); } }
// Create IChartDataSource object IChartDataSource loDataSource = new ArrayDataSource(ldaData, DataOrientation.CategoryInRow);
// Load data to the chart m_ChartControl.Charts[0].LoadData(loDataSource, false, true);
Prepare XML chart theme document or customize existing one and put it to the folder near the application executable (bin\Debug or bin\Release). You can find ready to use chart themes in the Art\Theme subdirectory of the chart control installation folder. You can use all provided arts with your application, so just copy it to the desirable location (bin\Debug or bin\Release).
Now you can load chart theme or use chart API to decorate chart.
// Load theme to decorate chart m_ChartControl.LoadTheme(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "IntroChart.xml"));
Run your application. You will see the chart that looks as it was specified in the chart XML theme.