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


Gets the Axis object that a scrollbar belongs to.
Axis of the event.

Syntax

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

Return Value

An object of type Axis that represents the axis that the scrollbar belongs to.

Example

In this example we override the default behavior when the user clicks on the reset button. Normally clicking on the reset button will result in the previous view being displayed, but using the AxisScrollBarClicked event we reset the view to its original state (i.e. no zooming). We only do this for the X axis of a chart area named Default.
C# Copy Code
// Note that events in C# should be added via the Events button in the Properties window, so
//   that the necessary code is added to InitializeComponent()
private void chart1_AxisScrollBarClicked(object sender, Dundas.Charting.WinControl.ScrollBarEventArgs e)
{

   
// First check for zoom/reset button being clicked for X axis in chart area named "Default"
   
if(e.ChartArea.Name == "Default")
   {
       
if(e.Axis.Type == AxisName.X)
       {
           
if(e.ButtonType == ScrollBarButtonType.ZoomReset)
           {
               
// Reset view to original view (no zooming)
               
e.Axis.View.ZoomReset(0);
               
               
// further handling of event is not required
               
e.Handled = true;
           }
       }
   }
}
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

Private Sub chart1_AxisScrollBarClicked(ByVal sender As Object, _
ByVal e As Dundas.Charting.WinControl.ScrollBarEventArgs) Handles chart1.AxisScrollBarClicked

    'first check for zoom/reset button being clicked for X axis in chart area named "Default"
    If e.ChartArea.Name = "Default" Then

        If e.Axis.Type = AxisName.X Then

            If e.ButtonType = ScrollBarButtonType.ZoomReset Then

                ' Reset view to original view (no zooming)
                e.Axis.View.ZoomReset(0)

                ' further handling of event is not required
                e.Handled = True
            End If
        End If
    End If
End Sub

Remarks

This property is exposed in the AxisScrollBarClicked event of the root Chart object.

Axis can be used to:

  • determine the axis that the scrollbar belongs to via the Axis.Type property.
  • get and set axis properties (e.g. axis line color, 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.