Click or drag to resize

IChartCategoryAxis BaseUnit Property

Represents base unit for the specified category axis.
Examples
The following code illustrates how to set BaseUnit for IChartCategoryAxis:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create chart and set range</para><para>IChart chart = worksheet.Charts.Add();</para><para>chart.DataRange = worksheet.Range["A1:C2"];</para><para>//Set chart category axis</para><para>IChartCategoryAxis categoryAxis = chart.PrimaryCategoryAxis;</para><para>//Set category type</para><para>categoryAxis.CategoryType = CategoryType.Time;</para><para>//Set base unit</para><para>categoryAxis.BaseUnit = ChartBaseUnitType.Year;</para><para>//Save to file</para><para>workbook.SaveToFile("Chart.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
ChartBaseUnitType BaseUnit { get; set; }

Property Value

Type: ChartBaseUnitType
See Also