Export (0) Print
Expand All

CustomLabel Class

Represents a custom label for an axis.

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

public class CustomLabel : ChartNamedElement

The CustomLabel type exposes the following members.

  NameDescription
Public methodCustomLabel()Creates a new instance of the CustomLabel class.
Public methodCustomLabel(Double, Double, String, Int32, LabelMarkStyle)Initializes a new instance of the CustomLabel class with the specified fromPosition, toPosition, text, labelRow, and markStyle parameters.
Public methodCustomLabel(Double, Double, String, Int32, LabelMarkStyle, GridTickTypes)Initializes a new instance of the CustomLabel class with the specified fromPosition, toPosition, text, labelRow, markStyle and gridTick parameters.
Top

  NameDescription
Public propertyAxisGets the axis that this CustomLabel object belongs to.
Public propertyForeColorGets or sets the text color of the custom label.
Public propertyFromPositionGets or sets the beginning position, in axis coordinates, of the custom label.
Public propertyGridTicksGets or sets a property that specifies whether custom tick marks and grid lines will be drawn in the center of the label.
Public propertyImageGets or sets the custom label image.
Public propertyImageTransparentColorGets or sets a color that will be replaced with a transparent color when a custom label image is drawn.
Public propertyLabelMarkGets or sets the label mark for a custom label. This applies to labels in rows other than the first row.
Public propertyMarkColorGets or sets the marker color for the custom label.
Public propertyNameGets or sets the name of the custom label. (Overrides ChartNamedElement.Name.)
Public propertyRowIndexGets or sets the index of the custom label row.
Public propertyTagGets or sets an object associated with this chart element. (Inherited from ChartElement.)
Public propertyTextGets or sets the custom label text.
Public propertyToolTipGets or sets the custom label tooltip text.
Public propertyToPositionGets or sets the starting position of the custom label, in axis coordinates.
Top

  NameDescription
Public methodCloneReturns a cloned label object.
Public methodDispose()Releases the resources used by the ChartElement. (Inherited from ChartElement.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the ChartElement and optionally releases the managed resources. (Inherited from ChartElement.)
Public methodEqualsDetermines whether the specified Object is equal to the current ChartElement. (Inherited from ChartElement.)
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 methodGetHashCodeReturns a hash function for a particular type. (Inherited from ChartElement.)
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 ChartElement.)
Top

CustomLabel objects are stored in the CustomLabelsCollection class, which is exposed as the CustomLabels property of the Axis class.

Axis labels for the first label row are automatically generated unless custom labels are specified using the CustomLabels property. If you specify a custom label along the first label row, no axis labels will be automatically generated for the entire first row.

Only custom labels may be used for the second label row.

The ToPosition and FromPosition properties determine the axis range that the label applies to.

A grid line and/or tick mark can be displayed for a custom axis label by using the GridTicks property; this property specifies whether a custom grid line or tick mark will be drawn in the middle of the label range.

.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