New to Telerik ReportingStart a free 30-day trial

Base chart axis class

Definition

Constructors

Creates a new instance of the ChartAxis class.

C#
public ChartAxis(ChartPlotArea parent, IContainer container)
Parameters:parentChartPlotAreacontainerIContainer

Creates a new instance of the ChartAxis class.

C#
public ChartAxis(ChartPlotArea parent)
Parameters:parentChartPlotArea

Fields

ChartAxis style

C#
protected StyleAxis chartAxisAppearance

ChartAxis items

C#
protected ChartAxisItemsCollection chartAxisItems

ChartAxis main label

C#
protected ChartLabel chartAxisLabel

Maximum series value

C#
protected double chartAxisMaxAxisValue

Max axis item value

C#
protected double chartAxisMaxItemValue

Minimum series value

C#
protected double chartAxisMinAxisValue

Min axis item value

C#
protected double chartAxisMinItemValue

Parent element

C#
protected ChartPlotArea chartAxisParent

Axis zero value end point

C#
protected PointF chartAxisPointEnd

Axis start point

C#
protected PointF chartAxisPointStart

Is axis zero based

C#
protected bool chartAxisRealIsZeroBased

Pixels per value field.

C#
protected float pixelsPerValue

Cached zero coordinate value.

C#
protected float zeroCoord

Properties

ChartAxis style

C#
[TypeConverter(typeof(ExpandableObjectConverter))]
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[SkinnableProperty]
public StyleAxis Appearance { get; }

Enables or disables automatic axis scaling.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.Attribute)]
public bool AutoScale { get; set; }

ChartAxis label

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[TypeConverter(typeof(ExpandableObjectConverter))]
[SkinnableProperty]
public ChartLabel AxisLabel { get; }

Specifies whether the axis begins from 0.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.Attribute)]
public bool IsZeroBased { get; set; }

Returns a collection of axis items.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ChartAxisItemsCollection Items { get; }

Draw each 1,2,...,n item

C#
[Browsable(true)]
public int LabelStep { get; set; }

Gets or sets maximal count of the axis items when auto scaling.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.Attribute)]
public int MaxItemsCount { get; set; }

MaxValue

double

Specifies the max value of the axis range.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.Attribute)]
public virtual double MaxValue { get; set; }

MinValue

double

Specifies the min value of the axis range.

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.Attribute)]
public virtual double MinValue { get; set; }

Parent element (PlotArea)

C#
[Browsable(false)]
public ChartPlotArea Parent { get; }

Step

double

Specifies the step at which axis values are calculated

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.Attribute)]
public virtual double Step { get; set; }

Returns the axis item at the specified position.

C#
[Browsable(false)]
public ChartAxisItem this[int index] { get; }
Parameters:indexint

Specifies whether the axis should be rendered.

C#
public ChartAxisVisibility Visible { get; set; }

Determines the type of shown values

C#
[Browsable(true)]
[PersistenceMode(PersistenceMode.Attribute)]
public ChartAxisVisibleValues VisibleValues { get; set; }

Methods

Adds a ChartAxisItem to the axis.

C#
public void AddItem(ChartAxisItem item, params ChartAxisItem[] items)
Parameters:itemChartAxisItemitemsChartAxisItem[]

Adds ChartAxisItems to the axis.

C#
public void AddItem(ChartAxisItem[] items)
Parameters:itemsChartAxisItem[]

Adds a ChartAxisItemsCollection to the axis.

C#
public void AddItem(ChartAxisItemsCollection items)
Parameters:itemsChartAxisItemsCollection

Adds ChartAxisItems to the axis.

C#
public void AddItem(List<ChartAxisItem> items)
Parameters:itemsList<ChartAxisItem>

Adds a new ChartAxisItem object to the axis with the specified label and color.

C#
protected ChartAxisItem AddItem(string label, Color color, bool visible)
Parameters:labelstring

Axis label

colorColor

Item text color

visiblebool

Visibility

Returns:

ChartAxisItem

Adds a new ChartAxisItem object to the axis with the specified label and color.

C#
protected ChartAxisItem AddItem(string label, Color color)
Parameters:labelstring

Axis label

colorColor

Item text color

Returns:

ChartAxisItem

Automatically adds new axis items in AutoScale mode.

C#
public void AddRange(double minValue, double maxValue, double step)
Parameters:minValuedouble

Min range value

maxValuedouble

Max range value

stepdouble

Axis step value

Auto determines the min and max value of the axis

C#
protected void AutoCalcAxisExtents()

Clears data values of the axis.

C#
public void Clear()

Restores initial values of cached axis settings

C#
protected virtual void DisableCachedValues()

Releases unmanaged and - optionally - managed resources

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Overrides: StateManagedObject.Dispose(bool)

Gets the end value coordinate

C#
protected abstract float GetAxisEndCoord()
Returns:

float

Coordinate

Gets the start value coordinate

C#
protected abstract float GetAxisStartCoord()
Returns:

float

Coordinate

Gets distance between points

C#
protected float GetDistance(PointF point1, PointF point2)
Parameters:point1PointF

First point

point2PointF

Second point

Returns:

float

Distance

Gets the item at the specified index.

C#
public ChartAxisItem GetItem(int index)
Parameters:indexintReturns:

ChartAxisItem

Loading ViewState data

C#
protected override void LoadViewState(object savedState)
Parameters:savedStateobject

Saved state bag

Overrides: StateManagedObject.LoadViewState(object)

Removes all items

C#
public void RemoveAllItems()

Removes the ChartAxisItem specified.

C#
public void RemoveItem(ChartAxisItem item, params ChartAxisItem[] items)
Parameters:itemChartAxisItemitemsChartAxisItem[]

Removes the ChartAxisItems at the specified indexes.

C#
public void RemoveItem(int index, params int[] indexes)
Parameters:indexintindexesint[]

Removes the ChartAxisItem at the specified index.

C#
public void RemoveItem(int itemIndex)
Parameters:itemIndexint

item's index

Removes the last item from the axis.

C#
public void RemoveLastItem()

Resets the MaxValue to default

C#
protected void ResetMaxValue()

Resets the MinValue to default

C#
protected void ResetMinValue()

Resets the Step value to default

C#
protected void ResetStep()

Saves data to a State Bag

C#
protected override object SaveViewState()
Returns:

object

Saved axis data to a state bag

Overrides: StateManagedObject.SaveViewState()

Sets new color for the axis item text at the specified position.

C#
public void SetItemColor(int itemIndex, Color newColor)
Parameters:itemIndexint

Item index in collection

newColorColor

Item text color

Sets new label for the axis item at the specified position.

C#
public void SetItemLabel(int itemIndex, ChartAxisItem newLabel)
Parameters:itemIndexint

Item index in collection

newLabelChartAxisItem

Sets new label text for the axis item at the specified position.

C#
public void SetItemLabel(int itemIndex, string newLabelText)
Parameters:itemIndexint

Item index in collection

newLabelTextstring

Axis item label text

Sets the maximum axis range value

C#
protected void SetMaxValue(double maxValue)
Parameters:maxValuedouble

Sets the min axis range value

C#
protected void SetMinValue(double minValue)
Parameters:minValuedouble

Value to set

The axis MaxValue design time serialization reason

C#
protected bool ShouldSerializeMaxValue()
Returns:

bool

True is value have to be serialized

The axis MinValue design time serialization reason

C#
protected bool ShouldSerializeMinValue()
Returns:

bool

True is value have to be serialized

The axis Step design time serialization reason

C#
protected bool ShouldSerializeStep()
Returns:

bool

True is value have to be serialized

Tracking ViewState

C#
protected override void TrackViewState()

Overrides: StateManagedObject.TrackViewState()