Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CustomLabel Class
Collapse the table of content
Expand the table of content

CustomLabel Class

.NET Framework 4.6 and 4.5

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.

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.

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.

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.)

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.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

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