Dundas Chart for Windows Forms
ChartArea Property
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > CursorEventArgs Class : ChartArea Property


Gets the ChartArea object that a cursor or range selection belongs to.
Chart area of the event.

Syntax

Visual Basic (Declaration)  
Public ReadOnly Property ChartArea As ChartArea
Visual Basic (Usage) Copy Code
Dim instance As CursorEventArgs
Dim value As ChartArea
 
value = instance.ChartArea
C#  
public ChartArea ChartArea {get;}

Return Value

An object of type ChartArea that represents the chart area that a range selection or cursor belongs to.

Example

In this example we only limit the X axis cursor position if it is the X axis cursor in a chart area named Chart Area 1.
C# Copy Code
using Dundas.Charting.WinControl;
...
private void chart1_CursorPositionChanging(object sender, Dundas.Charting.WinControl.CursorEventArgs e){

   
if(e.ChartArea.Name == "Chart Area 1")
   {

       
if(e.Axis.Type == AxisName.X)
       {
           
if(e.NewPosition > 3)
               e.NewPosition = 3;
       }
   }
}
In this example we only limit the X axis cursor position if it is the X axis cursor in a chart area named Chart Area 1.
Visual Basic Copy Code
Imports Dundas.Charting.WinControl

...

Private Sub chart1_CursorPositionChanging(ByVal sender As Object, _
ByVal e As Dundas.Charting.WinControl.CursorEventArgs) Handles chart1.CursorPositionChanging

If e.ChartArea.Name = "Chart Area 1" Then

    If e.Axis.Type = AxisName.X Then

    If e.NewPosition > 3 Then
        e.NewPosition = 3
    End If
End If

End Sub

Remarks

The property is exposed in the following events of the root Chart object: CursorPositionChanged, CursorPositionChanging, SelectionRangeChanged and SelectionRangeChanging.

This property can be used to:

  • determine which chart area the event is being raised for (useful when there are multiple chart areas within a chart image).
  • get and set chart area properties (e.g. backcolor, etc.).

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.