Export (0) Print
Expand All

ViewEventArgs Class

Provides event data that is used as a parameter object in the AxisViewChanged and AxisViewChanging events of the root Chart object.

System.Object
  System.EventArgs
    System.Windows.Forms.DataVisualization.Charting.ViewEventArgs

Namespace:  System.Windows.Forms.DataVisualization.Charting
Assembly:  System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)

'Declaration
Public Class ViewEventArgs _
	Inherits EventArgs

The ViewEventArgs type exposes the following members.

  NameDescription
Public methodViewEventArgs(Axis, Double)Initializes a new instance of the ViewEventArgs class with the specified axis and newPosition parameters.
Public methodViewEventArgs(Axis, Double, Double, DateTimeIntervalType)Initializes a new instance of the ViewEventArgs class with the specified axis, newPosition, newSize and newSizeType parameters.
Top

  NameDescription
Public propertyAxisGets the Axis object that a view belongs to.
Public propertyChartAreaGets the ChartArea object that a view belongs to.
Public propertyNewPositionGets the new position of a view along an axis.
Public propertyNewSizeGets or sets the size of a view along an axis.
Public propertyNewSizeTypeGets the unit of measurement for the new size of a view.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

This class is exposed as the e parameter in the AxisViewChanged and AxisViewChanging events. The AxisViewChanging event is raised just before a new view is displayed, as a result of the end-user clicking and dragging in a chart area. The AxisViewChanged event is raised just after the new view is created.

It is important to note that the position and size of a view cannot be set in the AxisViewChanged event because in this case the view is already created.

The ViewEventArgs class contains the following properties:

  • The ChartArea property, which is used to get the ChartArea object in which the view is being displayed. The Name property gets the name of the chart area. Other chart area properties can also be set.

  • The Axis property, which is used to get the Axis object with which the view is associated. To determine the type of axis, which can be X, Y, X2 or Y2, use the AxisName property. Other axis properties can also be set.

  • The NewPosition property, which represents the new position of a view.

  • The NewSize property, which represents the new size of a view.

  • The NewSizeType property, which represents the unit of measurement for the size of a view.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft