Posted by: Cirilo Meggiolaro | 01/6/2009

Tip of the day #84 – Exploring the Microsoft Chart control – Chart Area

One month ago I published a tip here and an article on CodeProject website about the new Microsoft Chart control that is really cool and free. If you haven’t checked the Tip #48 yet it is a good time to take a look, download and install the pre-requisites and comes back to our example.

I am going to start today a series of posts about the Microsoft Chart control exploring daily an important object from the control. For this first post the Chart Area has been chosen.

Chart Area class

The chart area class is the space where the chart is plotted. Each chart control has a collection of chart areas. Even though most part of the time you are going to use only one, sometimes is useful to display several charts. You may use the ChartAreas collection from the chart control to display more than one plotted chart in the same control.

A chart control with two chart areas

A chart control with two chart areas

Constructors

Two overloads are available for the class constructor:

public ChartArea();
public ChartArea(string name);

Properties

  • AreaAlignmentOrientations AlignmentOrientation: Gets or sets the alignment orientation of a chart area;
  • AreaAlignmentStyles AlignmentStyle: Gets or sets the alignment style of a chart area;
  • string AlignWithChartArea: Gets or sets the name of the chart area object to which this chart are must be aligned;
  • ChartArea3DStyle Area3DStyle: Gets or sets the object that defines the 3D style of a chart area;
  • Axis[] Axes: Gets os sets an array of axis that represents all axes of a chart area;
  • Axis AxisX: Gets or sets the main X-axis object;
  • Axis AxisX2: Gets or sets the secondary X-axis object;
  • Axis AxisY: Gets or sets the main Y-axis object;
  • Axis AxisY2: Gets or sets the secondary Y-axis object;
  • Color BackColor: Gets or sets the background color of a chart area;
  • GradientStyle BackGradientStyle: Gets or sets the gradient style of a chart area;
  • ChartHatchStyle BackHatchStyle: Gets or sets the hatching style of a chart area;
  • string BackImage: Gets or sets a background image of a chart area;
  • ChartImageAlignmentStyle BackImageAlignment: Gets or sets the background image alignment of a chart area;
  • Color BackImageTransparentColor: Gets or sets the color of a chart area background image that is drawn as transparent;
  • ChartImageWrapMode BackImageWrapMode: Gets or sets the drawing mode for the background image of a chart area;
  • Color BackSecondaryColor: Gets or sets the background secondary color of a chart area object;
  • Color BorderColor: Gets or sets the border color of a chart area;
  • ChartDashStyle BorderDashStyle: Gets or sets the border style of a chart area;
  • int BorderWidth: Gets or sets the border width of a chart area;
  • Cursor CursorX: Gets or sets a cursor object used for cursors and selected ranges on the X-axis;
  • Cursor CursorY: Gets or sets a cursor object used for cursors and selected ranges on the Y-axis;
  • ElementPosition InnerPlotPosition: Gets or sets the inner plot position of a chart area;
  • bool IsSameFontSizeForAllAxes: Gets or sets a flag that indicates whether the labels on all axes are of equal size;
  • string Name: Gets or sets the chart area name;
  • ElementPosition Position: Gets or sets the position of chart within the chart control;
  • Color ShadowColor: Gets or sets the shadow color of a chart area;
  • int ShadowOffset: Gets or sets the shadow offset of a chart area (pixels);
  • bool Visible: Gets or sets a flag that indicates whether the chart area is visible or not.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: