Use The Sample Ap

The fastest way to choose the basic chart setup you want is to use the sample ap, select the chart you want and adjust it as you want.  The code sample it generates may be good (but isn’t always, but once you’ve seen how it works and what options you want then look in the code for that form to see how the chart created.

Main Properties to set

ChartAreas

Defines area where a chart is plotted – a chart may contain multiple charts (leave as default for a single chart)

For each one:

Axes – Define properties for the X and Y axes like appearance and titles

Scale Maximum & Minimum (or set dynamically in code instead)

Title (or set dynamically in code instead)

Location

3D properties

Lots of other graphic options

Series

Defines the ChartType – this is where you do a lot of the actual chart design.

Definitions involving the chart data

Data

XValueType – may be useful to set

YValueType – may be useful to set

Map Area

Tool Tip – use this if you want values to be shown when you hover over each item in the chart

Legend

Key displayed by side of chart

To remove set it to disabled

Custom Properties

DrawSideBySide = false

EmptyPointValue = Zero

Label Style =

Palette

Defines the colors set for your chart;

Things you may want to set dynamically

Series > Labels

Defines text that may be displayed close to axis, points and custom labels.

Less Likely To Want

Titles

Overall title for a chart if you want that

Simple chart data example


	array ^yValues = gcnew array{ 10, 27.5, 7, 12, 45.5};
	array ^xNames = gcnew array{ "Mike", "John", "William", "George", "Alex" };
	chart1->Series[0]->Points->DataBindXY(xNames, yValues);
USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.