Table of Contents

Class XlsChartCategoryAxis

Namespace
Spire.Xls.Core.Spreadsheet.Charts
Assembly
Spire.XLS.dll
public class XlsChartCategoryAxis : XlsChartAxis, IExcelApplication, IDisposable, IChartCategoryAxis, IChartValueAxis, IChartAxis
Inheritance
XlsChartCategoryAxis
Implements
Derived
Inherited Members

Fields

DefaultCategoryAxisId

public const int DefaultCategoryAxisId = 59983360

Field Value

int

DefaultSecondaryCategoryAxisId

public const int DefaultSecondaryCategoryAxisId = 62908672

Field Value

int

Properties

AxisBetweenCategories

True if the value axis crosses the category axis between categories

public bool AxisBetweenCategories { get; set; }

Property Value

bool

BaseUnit

Represents base unit for the specified category axis.

public ChartBaseUnitType BaseUnit { get; set; }

Property Value

ChartBaseUnitType

BaseUnitIsAuto

True if use automatic base units for the specified category axis.

public bool BaseUnitIsAuto { get; set; }

Property Value

bool

BinWidth

Get or Set the number of data points in each range.

public double BinWidth { get; set; }

Property Value

double

Remarks

Applies only to Histogram and Pareto charts.

CategoryLabels

Category labels for the chart. The following code illustrates how to access the category labels range:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chart and set rangeIChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart category axisIChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;//Get category label range . Output will be A1:C1Console.WriteLine(categoryAxis.CategoryLabels.RangeAddressLocal);//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IXLSRange CategoryLabels { get; set; }

Property Value

IXLSRange

CategoryType

Represents axis category type.

public CategoryType CategoryType { get; set; }

Property Value

CategoryType

CrossValue

Value of category axis crosses.

public double CrossValue { get; set; }

Property Value

double

CrossesAt

Represents the point on the axis another axis crosses it.

public double CrossesAt { get; set; }

Property Value

double

CrossingPoint

Represents the point on the axis another axis crosses it.

public double CrossingPoint { get; set; }

Property Value

double

EnteredDirectlyCategoryLabels

Entered directly category labels for the chart.

public object[] EnteredDirectlyCategoryLabels { get; set; }

Property Value

object[]

HasAutomaticBins

True if bins generated are automatic. otherwise False

public bool HasAutomaticBins { get; set; }

Property Value

bool

Remarks

Applies only to Histogram and Pareto charts.

IsAutoCross

Automatic category crossing point selected.

public bool IsAutoCross { get; }

Property Value

bool

IsAutoMajor

Automatic major selected.

public bool IsAutoMajor { get; set; }

Property Value

bool

IsAutoMax

Automatic maximum selected.

public bool IsAutoMax { get; set; }

Property Value

bool

IsAutoMin

Automatic minimum selected.

public bool IsAutoMin { get; set; }

Property Value

bool

IsAutoMinor

Automatic minor selected.

public bool IsAutoMinor { get; set; }

Property Value

bool

IsBinningByCategory

True if bins generated by category values. otherwise False

public bool IsBinningByCategory { get; set; }

Property Value

bool

Remarks

Applies only to Histogram and Pareto charts.

IsLogScale

Logarithmic scale. The following code illustrates how to set IsLogScale for charts:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart value axisIChartValueAxis valueAxis = chart.PrimaryValueAxis;//Set IsLogScalevalueAxis.IsLogScale = true;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public bool IsLogScale { get; set; }

Property Value

bool

IsMaxCross

Value axis crosses at the far right category.

public bool IsMaxCross { get; set; }

Property Value

bool

IsReverseOrder

Categories in reverse order.

public bool IsReverseOrder { get; set; }

Property Value

bool

LabelFrequency

Frequency of labels.

public int LabelFrequency { get; set; }

Property Value

int

LogBase

public double LogBase { get; set; }

Property Value

double

MajorUnit

Value of major increment.

public double MajorUnit { get; set; }

Property Value

double

MajorUnitScale

Represens the major unit scale value for the category axis when the CategoryType property is set to TimeScale.

public ChartBaseUnitType MajorUnitScale { get; set; }

Property Value

ChartBaseUnitType

MaxValue

Maximum value on axis. The following code illustrates how to set MinValue and MaxValue for charts:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart value axisIChartValueAxis valueAxis = chart.PrimaryValueAxis;//Set min and max valuevalueAxis.MinValue = -20;valueAxis.MaxValue = 60;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public double MaxValue { get; set; }

Property Value

double

MinValue

Maximum value on axis. The following code illustrates how to set MinValue and MaxValue for charts:

//Create worksheetWorkbook workbook = new Workbook();workbook.LoadFromFile("Sample.xlsx");Worksheet worksheet = workbook.Worksheets[0];//Create chartChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart value axisIChartValueAxis valueAxis = chart.PrimaryValueAxis;//Set min and max valuevalueAxis.MinValue = -20;valueAxis.MaxValue = 60;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public double MinValue { get; set; }

Property Value

double

MinorUnit

Value of minor increment.

public double MinorUnit { get; set; }

Property Value

double

MinorUnitScale

Represens the minor unit scale value for the category axis when the CategoryType property is set to TimeScale.

public ChartBaseUnitType MinorUnitScale { get; set; }

Property Value

ChartBaseUnitType

NumberOfBins

Get or set the Number of Bins in the axis

public int NumberOfBins { get; set; }

Property Value

int

Remarks

Applies only to Histogram and Pareto charts.Can be a value from 1 through 31999.

Offset

Represents distance between the labels and axis line. The value can be from 0 through 1000.

public int Offset { get; set; }

Property Value

int

OverflowBinValue

Get or Set the OverFlow Bin value

public double OverflowBinValue { get; set; }

Property Value

double

Remarks

Applies only to Histogram and Pareto charts.

TickLabelSpacing

Represents the number of categories or series between tick-mark labels.

public int TickLabelSpacing { get; set; }

Property Value

int

TickMarkSpacing

Represents the number of categories or series between tick marks.

public int TickMarkSpacing { get; set; }

Property Value

int

TickMarksFrequency

Frequency of tick marks.

public int TickMarksFrequency { get; set; }

Property Value

int

UnderflowBinValue

Get or Set the UnderFlow Bin value

public double UnderflowBinValue { get; set; }

Property Value

double

Remarks

Applies only to Histogram and Pareto charts.

Methods

Clone(object, Dictionary<int, int>, Dictionary<string, string>)

[Obsolete("the method is not implemented")]
public override XlsChartAxis Clone(object parent, Dictionary<int, int> dicFontIndexes, Dictionary<string, string> dicNewSheetNames)

Parameters

parent object
dicFontIndexes Dictionary<int, int>
dicNewSheetNames Dictionary<string, string>

Returns

XlsChartAxis