ViewEventArgs 类

定义

提供事件数据,其在 AxisViewChangedAxisViewChanging 事件(属于根 Chart 对象)。Provides event data that is used as a parameter object in the AxisViewChanged and AxisViewChanging events of the root Chart object.

public ref class ViewEventArgs : EventArgs
public class ViewEventArgs : EventArgs
type ViewEventArgs = class
    inherit EventArgs
Public Class ViewEventArgs
Inherits EventArgs
继承
ViewEventArgs

注解

此类作为e AxisViewChangedAxisViewChanging事件中的参数公开。This class is exposed as the e parameter in the AxisViewChanged and AxisViewChanging events. AxisViewChanging事件恰好在显示新视图之前引发, 这是最终用户在图表区域中单击并拖动的结果。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. 创建AxisViewChanged新视图后, 将引发事件。The AxisViewChanged event is raised just after the new view is created.

需要注意的是, 无法在AxisViewChanged事件中设置视图的位置和大小, 因为在此情况下已创建视图。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.

ViewEventArgs类包含以下属性:The ViewEventArgs class contains the following properties:

  • 属性, 用于ChartArea获取要在其中显示视图的对象。 ChartAreaThe ChartArea property, which is used to get the ChartArea object in which the view is being displayed. Name属性获取图表区的名称。The Name property gets the name of the chart area. 还可以设置其他图表区属性。Other chart area properties can also be set.

  • 属性, 用于Axis获取与视图关联的对象。 AxisThe Axis property, which is used to get the Axis object with which the view is associated. 若要确定轴的类型, 可以是 X、Y、X2 或 Y2, 请使用AxisName属性。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.

  • NewPosition属性, 表示视图的新位置。The NewPosition property, which represents the new position of a view.

  • NewSize属性, 表示视图的新大小。The NewSize property, which represents the new size of a view.

  • NewSizeType属性, 表示视图大小的度量单位。The NewSizeType property, which represents the unit of measurement for the size of a view.

构造函数

ViewEventArgs(Axis, Double)

用指定的 axisnewPosition 参数初始化 ViewEventArgs 类的新实例。Initializes a new instance of the ViewEventArgs class with the specified axis and newPosition parameters.

ViewEventArgs(Axis, Double, Double, DateTimeIntervalType)

用指定的 axisnewPositionnewSizenewSizeType 参数初始化 ViewEventArgs 类的新实例。Initializes a new instance of the ViewEventArgs class with the specified axis, newPosition, newSize and newSizeType parameters.

属性

Axis

获取视图所属的 Axis 对象。Gets the Axis object that a view belongs to.

ChartArea

获取视图所属的 ChartArea 对象。Gets the ChartArea object that a view belongs to.

NewPosition

获取视图沿某个轴的新位置。Gets the new position of a view along an axis.

NewSize

获取或设置沿轴的视图的大小。Gets or sets the size of a view along an axis.

NewSizeType

获取视图新尺寸的度量单位。Gets the unit of measurement for the new size of a view.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于