Interface IChartCategoryAxis
Represents category axis of the chart.
public interface IChartCategoryAxis : IChartValueAxis, IChartAxis
- Inherited Members
Properties
AxisBetweenCategories
If true - cuts unused plot area. Default for area, surface charts.
//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:C2"];
//Set chart category axis
IChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
//Set category axis IsBetween
categoryAxis.AxisBetweenCategories = false;
//Save to file
workbook.SaveToFile("Chart.xlsx");
bool AxisBetweenCategories { get; set; }
Property Value
BaseUnit
Represents base unit for the specified category axis.
//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:C2"];
//Set chart category axis
IChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
//Set category type
categoryAxis.CategoryType = CategoryType.Time;
//Set base unit
categoryAxis.BaseUnit = ChartBaseUnitType.Year;
//Save to file
workbook.SaveToFile("Chart.xlsx");
ChartBaseUnitType BaseUnit { get; set; }
Property Value
BaseUnitIsAuto
True if use automatic base units for the specified category axis.
bool BaseUnitIsAuto { get; set; }
Property Value
CategoryLabels
Category labels for the chart.
//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:C2"];
//Set chart category axis
IChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
//Get category label range . Output will be A1:C1
Console.WriteLine(categoryAxis.CategoryLabels.RangeAddressLocal);
//Save to file
workbook.SaveToFile("Chart.xlsx");
IXLSRange CategoryLabels { get; set; }
Property Value
CategoryType
Represents axis category type.
//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:C2"];
//Set chart category axis
IChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
//Set category type
categoryAxis.CategoryType = CategoryType.Time;
//Set base unit
categoryAxis.BaseUnit = ChartBaseUnitType.Year;
//Save to file
workbook.SaveToFile("Chart.xlsx");
CategoryType CategoryType { get; set; }
Property Value
CrossingPoint
Value axis / category crossing point (2D charts only).
double CrossingPoint { get; set; }
Property Value
EnteredDirectlyCategoryLabels
Entered directly category labels for the chart.
object[] EnteredDirectlyCategoryLabels { get; set; }
Property Value
- object[]
LabelFrequency
Frequency of labels.
int LabelFrequency { get; set; }
Property Value
MajorUnitScale
Represens the major unit scale value for the category axis when the CategoryType property is set to TimeScale.
ChartBaseUnitType MajorUnitScale { get; set; }
Property Value
MinorUnitScale
Represens the minor unit scale value for the category axis when the CategoryType property is set to TimeScale.
ChartBaseUnitType MinorUnitScale { get; set; }
Property Value
Offset
Represents distance between the labels and axis line. The value can be from 0 through 1000.
int Offset { get; set; }
Property Value
TickLabelSpacing
Represents the number of categories or series between tick-mark labels.
//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:F2"];
//Set chart category axis
IChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
//Set tick label spacing
categoryAxis.TickLabelSpacing = 2;
//Save to file
workbook.SaveToFile("Chart.xlsx");
int TickLabelSpacing { get; set; }
Property Value
TickMarkSpacing
Represents the number of categories or series between tick marks.
//Create worksheet
Workbook workbook = new Workbook();
workbook.LoadFromFile("Sample.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
//Create chart and set range
IChart chart = worksheet.Charts.Add();
chart.DataRange = worksheet.Range["A1:F2"];
//Set chart category axis
IChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;
//Set tick mark spacing
categoryAxis.TickMarkSpacing = 2;
//Save to file
workbook.SaveToFile("Chart.xlsx");
int TickMarkSpacing { get; set; }
Property Value
TickMarksFrequency
Frequency of tick marks.
int TickMarksFrequency { get; set; }