Class ChartArea
The ChartArea is the actual rendering area of the plot. It provides a canvas on which the chart is rendered.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Chart
Assembly: Syncfusion.Chart.Base.dll
Syntax
public class ChartArea : IDisposable, IChartArea
Constructors
ChartArea(IChartAreaHost)
ChartArea requires a host which implements IChartAreaHost. Currently this is implemented only by the chart. However, it is possible that other controls that wish to aggregate the chart will implement this interface.
Declaration
public ChartArea(IChartAreaHost chart)
Parameters
Type | Name | Description |
---|---|---|
IChartAreaHost | chart | Host interface. |
Properties
AdjustPlotAreaMargins
Gets or sets the mode of drawing the edge labels. Default is AutoSet.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public ChartSetMode AdjustPlotAreaMargins { get; set; }
Property Value
Type |
---|
ChartSetMode |
AutoScale
Gets or sets a value indicating whether area should scale automatically in 3D mode.
Declaration
public bool AutoScale { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Axes
Collection of axes associated with this chart. You can add and remove axes from this collection. Primary X and Y axes may not be removed.
Declaration
public ChartAxisCollection Axes { get; }
Property Value
Type |
---|
ChartAxisCollection |
AxesInfoBar
Gets the information of axes bar representation.
Declaration
public ChartAxesInfoBar AxesInfoBar { get; }
Property Value
Type |
---|
ChartAxesInfoBar |
AxesSideBySide
Old (obsolete) property. Use XAxesLayoutMode and YAxesLayoutMode instead.
Declaration
[Obsolete("Use XAxesLayoutMode and YAxesLayoutMode instead")]
public bool AxesSideBySide { get; set; }
Property Value
Type |
---|
System.Boolean |
AxisSpacing
Gets or sets the spacing between different axes on the same side of the ChartArea. This spacing is useful when you display multiple axes side by side.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public SizeF AxisSpacing { get; set; }
Property Value
Type |
---|
System.Drawing.SizeF |
BackImage
Gets or sets the image that is to be used as the background for this ChartArea.
Declaration
public Image BackImage { get; set; }
Property Value
Type |
---|
System.Drawing.Image |
BackInterior
Gets or sets the background brush of the chart area.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public BrushInfo BackInterior { get; set; }
Property Value
Type |
---|
BrushInfo |
BorderColor
Gets or sets the bordercolor of the ChartArea. Default is SystemColors.ControlText.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public Color BorderColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
BorderStyle
Gets or sets the style of the border that is to be rendered around the ChartArea. Default is None.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public BorderStyle BorderStyle { get; set; }
Property Value
Type |
---|
System.Windows.Forms.BorderStyle |
BorderWidth
Gets or sets the border width of the ChartArea. Default is 1.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public int BorderWidth { get; set; }
Property Value
Type |
---|
System.Int32 |
Bottom
Returns the y coordinate of the bottom edge of the rectangular area that is to be occupied by this ChartArea.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public int Bottom { get; }
Property Value
Type |
---|
System.Int32 |
Bounds
Returns the bounds occupied by this ChartArea.
Declaration
public Rectangle Bounds { get; set; }
Property Value
Type |
---|
System.Drawing.Rectangle |
BoundsByAxes
Indicates if RenderBounds is calculated by including the label width and height of the axes. Default is true.
Declaration
[Obsolete]
public bool BoundsByAxes { get; set; }
Property Value
Type |
---|
System.Boolean |
Center
Returns the center point of this ChartArea.
Declaration
public PointF Center { get; }
Property Value
Type |
---|
System.Drawing.PointF |
Chart
Owner of this chart area.
Declaration
public IChartAreaHost Chart { get; }
Property Value
Type |
---|
IChartAreaHost |
ChartAreaMargins
Returns the margins that will be deduced from the rectangular area that represents the ChartArea. Negative values are supported.
Declaration
[ChartTemplate(ChartTemplateSet.ContentBehavior)]
public ChartMargins ChartAreaMargins { get; set; }
Property Value
Type |
---|
ChartMargins |
ChartAreaToolTip
Gets or sets the ToolTip text associated with this ChartArea.
Declaration
public string ChartAreaToolTip { get; set; }
Property Value
Type |
---|
System.String |
ChartPlotAreaMargins
Returns the margins of ChartArea (excluding label width and height).
Declaration
[ChartTemplate(ChartTemplateSet.ContentBehavior)]
public ChartMargins ChartPlotAreaMargins { get; set; }
Property Value
Type |
---|
ChartMargins |
ChartRegions
List of chart regions.
Declaration
[Obsolete("Use Chart.ChartRegions collection.")]
public IList ChartRegions { get; }
Property Value
Type |
---|
System.Collections.IList |
ClientRectangle
Returns the Rectangle in client co-ordinates that is occupied by this ChartArea.
Declaration
public Rectangle ClientRectangle { get; set; }
Property Value
Type |
---|
System.Drawing.Rectangle |
CursorLocation
Gets or sets the cursor location of chart.
Declaration
public Point CursorLocation { get; set; }
Property Value
Type |
---|
System.Drawing.Point |
CursorReDraw
Gets or sets whether the cursor need to redraw or not.
Declaration
public bool CursorReDraw { get; set; }
Property Value
Type |
---|
System.Boolean |
CustomPoints
Collection of custom points that are to be rendered in this ChartArea. Custom points can be added as markers at a specific location in the chart.
Declaration
public ChartCustomPointCollection CustomPoints { get; }
Property Value
Type |
---|
ChartCustomPointCollection |
Remarks
Depth
Gets or sets the perception of depth that is to be used when the ChartArea is rendered in 3D. Default is 50.
Declaration
public float Depth { get; set; }
Property Value
Type |
---|
System.Single |
DivideArea
Gets or sets a value indicating whether area should be divided for each simple chart (Pie, Funnel...).
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public bool DivideArea { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
FullStackMax
Gets or sets the maximal value of full stracking charts.
Declaration
public double FullStackMax { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The maximal value of full stracking charts. |
GridBackInterior
Gets or sets the grid back interior.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public BrushInfo GridBackInterior { get; set; }
Property Value
Type | Description |
---|---|
BrushInfo | The grid back interior. |
Height
Gets or sets the height of the rectangular area that is to be occupied by this ChartArea.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public int Height { get; set; }
Property Value
Type |
---|
System.Int32 |
HidePartialLabels
Indicates whether partially visible axis labels are hidden.
Declaration
[Obsolete("Use ChartAxis.HidePartialLabels instead.")]
public bool HidePartialLabels { get; set; }
Property Value
Type |
---|
System.Boolean |
InteractiveCursors
Collection of interactive cursors that renders custom cursors on the chart area.
Declaration
public ChartAreaCursorCollection InteractiveCursors { get; }
Property Value
Type |
---|
ChartAreaCursorCollection |
InteriorBackImage
Gets or sets the image that is to be used as the background for this ChartArea Interior.
Declaration
public Image InteriorBackImage { get; set; }
Property Value
Type |
---|
System.Drawing.Image |
IsAllowGap
Gets or sets a value indicating whether this instance is indexed with gap or not when empty points are used.
Declaration
public bool IsAllowGap { get; set; }
Property Value
Type |
---|
System.Boolean |
IsIndexed
Gets or sets a value indicating whether this instance is indexed.
Declaration
public bool IsIndexed { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Left
Returns the x coordinate of the left edge of the rectangular area that is to be occupied by the ChartArea.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public int Left { get; }
Property Value
Type |
---|
System.Int32 |
LegacyAppearance
Specifies whether to change the appearance of chart.
Declaration
public bool LegacyAppearance { get; set; }
Property Value
Type |
---|
System.Boolean |
Location
Gets or sets the location of the rectangular area that is to be occupied by this ChartArea.
Declaration
public Point Location { get; set; }
Property Value
Type |
---|
System.Drawing.Point |
MinSize
Gets or sets the minimum size of this ChartArea.
Declaration
public SizeF MinSize { get; set; }
Property Value
Type |
---|
System.Drawing.SizeF |
MultiplePies
If set to true, multiple pie chart series will be rendered in the same chart area.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public bool MultiplePies { get; set; }
Property Value
Type |
---|
System.Boolean |
NeedRedraw
Gets or sets the current Redraw flag state. If true, the ChartArea representation is out of date and needs to be refreshed.
Declaration
[Obsolete("This property isn't used anymore.")]
public bool NeedRedraw { get; set; }
Property Value
Type |
---|
System.Boolean |
OffsetX
Returns the X axis offset value that is to be used when rendering in 3D mode.
Declaration
public float OffsetX { get; }
Property Value
Type |
---|
System.Single |
OffsetY
Returns the Y axis offset value that is to be used when rendering in 3D mode.
Declaration
public float OffsetY { get; }
Property Value
Type |
---|
System.Single |
PrimaryXAxis
The primary X axis.
Declaration
public ChartAxis PrimaryXAxis { get; }
Property Value
Type |
---|
ChartAxis |
PrimaryYAxis
The primary Y axis.
Declaration
public ChartAxis PrimaryYAxis { get; }
Property Value
Type |
---|
ChartAxis |
Radius
Returns the radius of the Radar chart occupied by this ChartArea.
Declaration
public float Radius { get; }
Property Value
Type |
---|
System.Single |
RealSeries3D
Indicates whether the ChartArea is to be rendered in 3D. Default value is false.
Declaration
public bool RealSeries3D { get; set; }
Property Value
Type |
---|
System.Boolean |
ReDrawAxes
If set to true, Chart axes labels will be rendered each time chart updates.
Declaration
public bool ReDrawAxes { get; set; }
Property Value
Type |
---|
System.Boolean |
RenderBounds
Returns the actual rectangular bounds used for rendering.
Declaration
public Rectangle RenderBounds { get; }
Property Value
Type |
---|
System.Drawing.Rectangle |
RenderGlobalBounds
Returns the global rectangular bounds used for rendering.
Declaration
public Rectangle RenderGlobalBounds { get; }
Property Value
Type | Description |
---|---|
System.Drawing.Rectangle | The render global bounds. |
RequireAxes
Specifies whether the ChartArea requires axes to be rendered (for the Chart types being rendered).
Declaration
public bool RequireAxes { get; set; }
Property Value
Type |
---|
System.Boolean |
RequireInvertedAxes
Indicates whether Chart requires Inverted Axes
Declaration
public bool RequireInvertedAxes { get; set; }
Property Value
Type |
---|
System.Boolean |
Right
Returns the x coordinate of the right edge of the rectangular area that is to be occupied by the ChartArea.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public int Right { get; }
Property Value
Type |
---|
System.Int32 |
RotateCenter
Obsolete.
Declaration
[Obsolete("This property isn't used anymore.")]
public Vector3D RotateCenter { get; set; }
Property Value
Type |
---|
Vector3D |
Rotation
Gets or sets the rotational angle that is to be used when the ChartArea is rendered in 3D. Default is 30.
Declaration
public float Rotation { get; set; }
Property Value
Type |
---|
System.Single |
Scale3DCoeficient
Gets or sets a scale value in 3D mode.
Declaration
public float Scale3DCoeficient { get; set; }
Property Value
Type |
---|
System.Single |
Series3D
Indicates whether the ChartArea is to be rendered in 3D. Default value is false.
Declaration
public bool Series3D { get; set; }
Property Value
Type |
---|
System.Boolean |
SeriesParameters
Gets the series rendering parameters.
Declaration
public ChartSeriesParameters SeriesParameters { get; }
Property Value
Type | Description |
---|---|
ChartSeriesParameters | The series parameters. |
Settings3D
Gets the real 3D mode settings.
Declaration
public Graphics3DState Settings3D { get; }
Property Value
Type | Description |
---|---|
Graphics3DState | The real 3D mode settings. |
Size
Gets or sets the size of the rectangular area that is to be occupied by the ChartArea.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public Size Size { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
TextRenderingHint
Gets or sets the quality of text rendering. Default is AntiAlias.
Declaration
[Obsolete("This property isn't used anymore. Use Chart.TextRenderingHint property.")]
public TextRenderingHint TextRenderingHint { get; set; }
Property Value
Type |
---|
System.Drawing.Text.TextRenderingHint |
Tilt
Gets or sets the tilt that is to be used when the ChartArea is rendered in 3D. Default is 30.
Declaration
public float Tilt { get; set; }
Property Value
Type |
---|
System.Single |
Top
Returns the y coordinate of the top edge of the rectangular area that is to be occupied by this ChartArea.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public int Top { get; }
Property Value
Type |
---|
System.Int32 |
Transform3D
Gets transformation for real 3d mode.
Declaration
public Transform3D Transform3D { get; }
Property Value
Type |
---|
Transform3D |
Turn
Gets or sets the turn that is to be used when the ChartArea is rendered in real 3D only. Default is 0.0f.
Declaration
public float Turn { get; set; }
Property Value
Type |
---|
System.Single |
UpdateClientBounds
Gets a value indicating whether client bounds will be updated or not.
Declaration
public bool UpdateClientBounds { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
VisibleAllPies
In a PieChart, if set to false, the legend will be displayed with one legend item for each slice in the Pie. Default is false.
Declaration
[Obsolete("Use DivideArea property.")]
public bool VisibleAllPies { get; set; }
Property Value
Type |
---|
System.Boolean |
Watermark
Gets the water mark information.
Declaration
[ChartTemplate(ChartTemplateSet.Content)]
public ChartWatermark Watermark { get; }
Property Value
Type | Description |
---|---|
ChartWatermark | The water mark. |
Width
Gets or sets the width of the rectangular area that is to be occupied by this ChartArea.
Declaration
[ChartTemplate(ChartTemplateSet.SimpleBehavior)]
public int Width { get; set; }
Property Value
Type |
---|
System.Int32 |
XAxesLayoutMode
Specifies the way in which multiple X-axes will be rendered. Default is Stacking.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public ChartAxesLayoutMode XAxesLayoutMode { get; set; }
Property Value
Type |
---|
ChartAxesLayoutMode |
XLayouts
Gets the X axes layouts.
Declaration
public ChartAxisLayoutCollection XLayouts { get; }
Property Value
Type | Description |
---|---|
ChartAxisLayoutCollection | The X axes layouts. |
YAxesLayoutMode
Specifies the way in which multiple Y-axes will be rendered. Default is Stacking.
Declaration
[ChartTemplate(ChartTemplateSet.Simple)]
public ChartAxesLayoutMode YAxesLayoutMode { get; set; }
Property Value
Type |
---|
ChartAxesLayoutMode |
YLayouts
Gets the Y axes layouts.
Declaration
public ChartAxisLayoutCollection YLayouts { get; }
Property Value
Type | Description |
---|---|
ChartAxisLayoutCollection | The Y axes layouts. |
Methods
CalculateSizes(Rectangle)
Arranges the ChartArea elements.
Declaration
public void CalculateSizes(Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rect | The bounds of ChartArea. |
CalculateXZoomFactorAndZoomPosition(PointF, PointF, Double, Double, Double, out Double, out Double)
Calculates zoomfactor and zoomposition for x axis.
Declaration
[Obsolete]
public void CalculateXZoomFactorAndZoomPosition(PointF upPoint, PointF downPoint, double zoomFact, double zoomPos, double zoomPrec, out double newZoomFact, out double newZoomPos)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | upPoint | |
System.Drawing.PointF | downPoint | |
System.Double | zoomFact | |
System.Double | zoomPos | |
System.Double | zoomPrec | |
System.Double | newZoomFact | |
System.Double | newZoomPos |
CalculateYZoomFactorAndZoomPosition(PointF, PointF, Double, Double, Double, out Double, out Double)
Calculates zoomfactor and zoomposition for y axis.
Declaration
[Obsolete]
public void CalculateYZoomFactorAndZoomPosition(PointF upPoint, PointF downPoint, double zoomFact, double zoomPos, double zoomPrec, out double newZoomFact, out double newZoomPos)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | upPoint | |
System.Drawing.PointF | downPoint | |
System.Double | zoomFact | |
System.Double | zoomPos | |
System.Double | zoomPrec | |
System.Double | newZoomFact | |
System.Double | newZoomPos |
CorrectionFrom(Point)
Transforms the specified point to the chart plane.
Declaration
public Point CorrectionFrom(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt |
Returns
Type |
---|
System.Drawing.Point |
Remarks
Only for real 3D mode.
CorrectionFrom(PointF)
Transforms the specified point to the screen plane.
Declaration
public PointF CorrectionFrom(PointF pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | pt |
Returns
Type |
---|
System.Drawing.PointF |
Remarks
Only for real 3D mode.
CorrectionTo(Point)
Transforms the specified point to the screen plane.
Declaration
public Point CorrectionTo(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt |
Returns
Type |
---|
System.Drawing.Point |
Remarks
Only for real 3D mode.
CorrectionTo(PointF)
Transforms the specified point to the chart plane.
Declaration
public PointF CorrectionTo(PointF pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | pt |
Returns
Type |
---|
System.Drawing.PointF |
Remarks
Only for real 3D mode.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
DisposeSeriesStyle()
Method to dispose series style of chart area.
Declaration
public void DisposeSeriesStyle()
DoAppearanceChange()
Change the default appearance of chart.
Declaration
public void DoAppearanceChange()
Draw(PaintEventArgs)
Method used to draw the Chart.
Declaration
public void Draw(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | Specifies flags that control the elements painting. |
Draw(PaintEventArgs, ChartPaintFlags)
Declaration
public void Draw(PaintEventArgs e, ChartPaintFlags flags)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e | |
ChartPaintFlags | flags |
DrawZoomingRange(Graphics)
Method used to draw the zooming area of Chart.
Declaration
public void DrawZoomingRange(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | Graphics to draw the zooming area. |
GetAxesRect(ChartAxis, ChartAxis)
Returns the rectangle encompassing the specified axes.
Declaration
[Obsolete("This method is incorrect.")]
public static RectangleF GetAxesRect(ChartAxis ax1, ChartAxis ax2)
Parameters
Type | Name | Description |
---|---|---|
ChartAxis | ax1 | |
ChartAxis | ax2 |
Returns
Type |
---|
System.Drawing.RectangleF |
GetChartRegion(Int32)
Returns the ChartRegion at the specified index value.
Declaration
[Obsolete("Use Chart.ChartRegions collection.")]
public ChartRegion GetChartRegion(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type |
---|
ChartRegion |
GetFrontBoundByAxes()
Gets the front bound by axes.
Declaration
[Obsolete("This method isn't used anymore.")]
public RectangleF GetFrontBoundByAxes()
Returns
Type |
---|
System.Drawing.RectangleF |
GetFrontBoundByAxes(Boolean)
Gets the front bound by axes.
Declaration
[Obsolete("This method isn't used anymore.")]
public RectangleF GetFrontBoundByAxes(bool byAllAxes)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | byAllAxes | if set to |
Returns
Type |
---|
System.Drawing.RectangleF |
GetPointByValue(ChartPoint)
Gets the real point value at this chart point.
Declaration
public Point GetPointByValue(ChartPoint cpt)
Parameters
Type | Name | Description |
---|---|---|
ChartPoint | cpt |
Returns
Type | Description |
---|---|
System.Drawing.Point | The corresponding Point in client-coordinates. |
GetPointByValue(ChartSeries, ChartPoint)
Gets the real point value at this chart point. Use this method when multiple axes are used in the chart
Declaration
public Point GetPointByValue(ChartSeries series, ChartPoint cpt)
Parameters
Type | Name | Description |
---|---|---|
ChartSeries | series | |
ChartPoint | cpt |
Returns
Type | Description |
---|---|
System.Drawing.Point | The corresponding Point in client-coordinates. |
GetSeriesBounds(ChartSeries)
Gets the series bounds.
Declaration
public RectangleF GetSeriesBounds(ChartSeries series)
Parameters
Type | Name | Description |
---|---|---|
ChartSeries | series | The series. |
Returns
Type |
---|
System.Drawing.RectangleF |
GetValueByPoint(Point)
Returns the chartpoint value at this real point (in client co-ordinates).
Declaration
public ChartPoint GetValueByPoint(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt |
Returns
Type | Description |
---|---|
ChartPoint | The corresponding ChartPoint. |
GetXAxis(ChartSeries)
Returns the x axis associated with this chartseries.
Declaration
public ChartAxis GetXAxis(ChartSeries series)
Parameters
Type | Name | Description |
---|---|---|
ChartSeries | series | A ChartSeries whose ChartAxis we are interested in. |
Returns
Type | Description |
---|---|
ChartAxis | The corresponding ChartAxis. |
GetYAxis(ChartSeries)
Returns the y axis associated with this chartseries.
Declaration
public ChartAxis GetYAxis(ChartSeries series)
Parameters
Type | Name | Description |
---|---|---|
ChartSeries | series | A ChartSeries whose ChartAxis we are interested in. |
Returns
Type | Description |
---|---|
ChartAxis | The corresponding ChartAxis. |
SetSeriesSymbolForCursor(ChartSymbolInfo)
Sets the customized symbol for series points when moving the interactive cursor.
Declaration
public void SetSeriesSymbolForCursor(ChartSymbolInfo symbolInfo)
Parameters
Type | Name | Description |
---|---|---|
ChartSymbolInfo | symbolInfo | The ChartSymbolInfo |