Gets the
ChartArea object that the scrollbar belongs to.
Chart area of the event.
Syntax
Visual Basic (Declaration) |
|
Public ReadOnly Property ChartArea As ChartArea |
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
If e.ChartArea.Name = "Default" Then
If e.Axis.Type = AxisName.X Then
If e.ButtonType = ScrollBarButtonType.ZoomReset Then
e.Axis.View.ZoomReset(0)
e.Handled = True End If End If End If End Sub
|
Remarks
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