Axis Class
TOC
Collapse the table of content
Expand the table of content

Axis Class

.NET Framework (current version)
 

Provides methods and properties that manage axes in the Chart control.

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)


public class Axis : ChartNamedElement, IChartMapArea

NameDescription
System_CAPS_pubmethodAxis()

Initializes a new instance of the Axis class.

System_CAPS_pubmethodAxis(ChartArea, AxisName)

Initializes a new instance of the Axis class with the specified ChartArea and axisTypeName values.

NameDescription
System_CAPS_pubpropertyArrowStyle

Gets or sets the arrow style of a two-dimensional (2D) axis; this style is not applied to three-dimensional (3D) chart areas.

System_CAPS_pubpropertyAxisName

This API supports the product infrastructure and is not intended to be used directly from your code. Gets the name of the axis, which can be either X, Y, X2 or Y2.

System_CAPS_pubpropertyCrossing

Gets or sets the location at which an axis is crossed by its associated axis.

System_CAPS_pubpropertyCustomLabels

Gets a CustomLabelsCollection object used to store CustomLabel objects.

System_CAPS_pubpropertyEnabled

Gets or sets a value that indicates whether an axis is enabled.

System_CAPS_pubpropertyInterlacedColor

Gets or sets the color of interlaced strip lines.

System_CAPS_pubpropertyInterval

Gets or sets the interval of an axis.

System_CAPS_pubpropertyIntervalAutoMode

Gets or sets a flag that determines if a fixed number of intervals is used on the axis, or if the number of intervals depends on the axis size.

System_CAPS_pubpropertyIntervalOffset

Gets or sets the interval offset of an axis.

System_CAPS_pubpropertyIntervalOffsetType

Gets or sets the interval offset type of an axis.

System_CAPS_pubpropertyIntervalType

Gets or sets the interval type of an axis.

System_CAPS_pubpropertyIsInterlaced

Gets or sets a flag that determines if interlaced strip lines are displayed for an axis.

System_CAPS_pubpropertyIsLabelAutoFit

Gets or sets a flag that determines whether axis labels are automatically fitted.

System_CAPS_pubpropertyIsLogarithmic

Gets or sets a flag which indicates whether the axis is logarithmic. Zeros or negative data values are not allowed on logarithmic charts.

System_CAPS_pubpropertyIsMarginVisible

Gets or sets a flag that determines whether an axis margin will be used.

System_CAPS_pubpropertyIsMarksNextToAxis

Gets or sets a flag that determines whether tick marks and axis labels move with an axis if the crossing point of an axis changes.

System_CAPS_pubpropertyIsReversed

Gets or sets a flag which indicates whether the axis is reversed.

System_CAPS_pubpropertyIsStartedFromZero

Gets or sets a flag which indicates whether the minimum value of the axis will be automatically set to zero if all data point values are positive. If there are negative data point values, the minimum value of the data points will be used.

System_CAPS_pubpropertyLabelAutoFitMaxFontSize

Gets or sets the maximum font size that can be used by the label auto-fitting algorithm.

System_CAPS_pubpropertyLabelAutoFitMinFontSize

Gets or sets the minimum font size that can be used by the label auto-fitting algorithm.

System_CAPS_pubpropertyLabelAutoFitStyle

Gets or sets the allowable label changes that can be made to enable the label to be fit along an axis.

System_CAPS_pubpropertyLabelStyle

Gets or sets the LabelStyle properties of an axis.

System_CAPS_pubpropertyLineColor

Gets or sets the line color of an axis.

System_CAPS_pubpropertyLineDashStyle

Gets or sets the line style of an axis.

System_CAPS_pubpropertyLineWidth

Gets or sets the line width of an axis, in pixels.

System_CAPS_pubpropertyLogarithmBase

Gets or sets a value for the logarithm base for the logarithmic axis.

System_CAPS_pubpropertyMajorGrid

Gets or sets a Grid object used to set the major grid line properties for an axis.

System_CAPS_pubpropertyMajorTickMark

Gets or sets a TickMark object used to set the major tick mark properties of an axis.

System_CAPS_pubpropertyMapAreaAttributes

Gets or sets the map area attributes of an axis.

System_CAPS_pubpropertyMaximum

Gets or sets the maximum value of an axis.

System_CAPS_pubpropertyMaximumAutoSize

Gets or sets the maximum size of the axis, measured as a percentage of the chart area. This value is used by the automatic layout algorithm.

System_CAPS_pubpropertyMinimum

Gets or sets the minimum value of an axis.

System_CAPS_pubpropertyMinorGrid

Gets or sets a Grid object used to specify the minor grid lines attributes of an axis.

System_CAPS_pubpropertyMinorTickMark

Gets or sets a TickMark object used to set the minor tick mark properties of an axis.

System_CAPS_pubpropertyName

Gets or sets the name of the axis.(Overrides ChartNamedElement.Name.)

System_CAPS_pubpropertyPostBackValue

Gets or sets the postback value that can be processed on a Click event.

System_CAPS_pubpropertyScaleBreakStyle

Gets or sets the axis automatic scale break style.

System_CAPS_pubpropertyScaleView

Gets or sets the view of an axis.

System_CAPS_pubpropertyStripLines

Gets a StripLinesCollection collection object, which stores all StripLine objects for an axis.

System_CAPS_pubpropertyTag

Gets or sets an object associated with this chart element.(Inherited from ChartElement.)

System_CAPS_pubpropertyTextOrientation

Gets or sets the orientation of the text in the axis title.

System_CAPS_pubpropertyTitle

Gets or sets the title of the axis.

System_CAPS_pubpropertyTitleAlignment

Gets or sets the alignment of an axis title.

System_CAPS_pubpropertyTitleFont

Gets or sets the title font properties of an axis.

System_CAPS_pubpropertyTitleForeColor

Gets or sets the text color of an axis title.

System_CAPS_pubpropertyToolTip

Gets or sets the tooltip used for the axis.

System_CAPS_pubpropertyUrl

Gets or sets the URL target of the axis.

NameDescription
System_CAPS_pubmethodDispose()

Releases the resources used by the ChartElement.(Inherited from ChartElement.)

System_CAPS_protmethodDispose(Boolean)

Releases unmanaged and, optionally, managed resources.(Overrides ChartElement.Dispose(Boolean).)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified Object is equal to the current ChartElement.(Inherited from ChartElement.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Returns a hash function for a particular type.(Inherited from ChartElement.)

System_CAPS_pubmethodGetPosition(Double)

Converts an axis value to a relative position (0-100%). If an axis is logarithmic, the value is converted to a linear scale.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodPixelPositionToValue(Double)

Converts an absolute pixel position along an axis to an axis value. This method only works in paint events.

System_CAPS_pubmethodPositionToValue(Double)

Converts a relative coordinate along an axis to an axis value. This method only works in paint events.

System_CAPS_pubmethodRoundAxisValues()

Automatically rounds axis values.

System_CAPS_pubmethodToString()

Returns a string that represents the current Object.(Inherited from ChartElement.)

System_CAPS_pubmethodValueToPixelPosition(Double)

Converts an axis value to an absolute coordinate along an axis. Measured in pixels. This method only works in paint events.

System_CAPS_pubmethodValueToPosition(Double)

Converts an axis value to its relative position (0-100%). If an axis has a logarithmic scale, the value is converted to a linear scale. This method only works in paint events.

This class encapsulates all the functionality for axes in the Chart control, and is exposed by the AxisX, AxisY, AxisX2 and AxisY2 properties of ChartArea objects.

For all charts—except bar, stacked bar, pie and doughnut—the primary and secondary axes are as follows:

Axis Type

Description

Primary X-Axis

Bottom horizontal axis.

Secondary X-Axis

Top horizontal axis.

Primary Y-Axis

Left vertical axis.

Secondary Y-Axis

Right vertical axis.

Bar and stacked-bar charts have their axes rotated 90 degrees clockwise, so the primary X axis for these two chart types is the left-vertical axis.

Note   There can be only one set of axes—two vertical and two horizontal—for each ChartArea object.

The Axis class also contains several methods that can be used to convert axis values to absolute pixel coordinates, which are useful for 2D custom drawing, or to relative coordinates, which are useful for 3D custom drawing. Absolute and relative coordinates can also be converted to axis values.

The following are the most important axis elements exposed by the Axis class:

Axis Element

Description

Axis Labels

The labels of an axis, and their associated properties.

Grid Lines

The major and minor grid lines of an axis.

Tick Marks

The major and minor tick marks of an axis.

Strip Lines

Strip lines.

.NET Framework
Available since 4.0

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

Return to top
Show:
© 2016 Microsoft