Class XlsChartAxis
- Namespace
- Spire.Xls.Core.Spreadsheet.Charts
- Assembly
- Spire.XLS.dll
public class XlsChartAxis : XlsObject, IExcelApplication, IDisposable, IChartAxis
- Inheritance
-
XlsChartAxis
- Implements
- Derived
- Inherited Members
Properties
Alignment
Represents alignment for the tick label.
public AxisTextDirectionType Alignment { get; set; }
Property Value
AutoTickLabelSpacing
public bool AutoTickLabelSpacing { get; set; }
Property Value
AutoTickMarkSpacing
public bool AutoTickMarkSpacing { get; set; }
Property Value
AxisId
Gets axis id.
public int AxisId { get; }
Property Value
AxisType
Type of the axis.
public AxisType AxisType { get; set; }
Property Value
Border
Represents chart border. Read only.
//Create worksheetWorkbook workbook = new Workbook();Worksheet worksheet = workbook.Worksheets[0];//Add dataworksheet.Range["A1"].Text = "Jan";
worksheet.Range["B1"].Text = "Feb";
worksheet.Range["C1"].Text = "Mar";
worksheet.Range["A2"].Text = "10";
worksheet.Range["B2"].Text = "20";
worksheet.Range["C2"].Text = "30";//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart category axisIChartAxis categoryAxis = chart.PrimaryCategoryAxis;//Set border and colorIChartBorder border = categoryAxis.Border;border.Color = Color.Red;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public ChartBorder Border { get; }
Property Value
Chart3DOptions
public IFormat3D Chart3DOptions { get; }
Property Value
Chart3DProperties
public IFormat3D Chart3DProperties { get; }
Property Value
Deleted
public bool Deleted { get; set; }
Property Value
Font
Returns font used for axis text displaying. Read-only.
//Create worksheetWorkbook workbook = new Workbook();Worksheet worksheet = workbook.Worksheets[0];//Add dataworksheet.Range["A1"].Text = "Jan";
worksheet.Range["B1"].Text = "Feb";
worksheet.Range["C1"].Text = "Mar";
worksheet.Range["A2"].Text = "10";
worksheet.Range["B2"].Text = "20";
worksheet.Range["C2"].Text = "30";//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart axisIChartAxis chartAxis = chart.PrimaryCategoryAxis;//Set font colorchartAxis.Font.Color = Color.Red;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IFont Font { get; }
Property Value
FrameFormat
Return frame format of Axis. Read-only.
public IChartFrameFormat FrameFormat { get; }
Property Value
Has3dProperties
public bool Has3dProperties { get; }
Property Value
HasAxisTitle
Indicates wheather the axis has title
public bool HasAxisTitle { get; }
Property Value
HasMajorGridLines
True if the axis has major gridlines. Only axes in the primary axis group can have gridlines.
public bool HasMajorGridLines { get; set; }
Property Value
HasMinorGridLines
True if the axis has minor gridlines. Only axes in the primary axis group can have gridlines.
public bool HasMinorGridLines { get; set; }
Property Value
IsAutoTextRotation
public bool IsAutoTextRotation { get; }
Property Value
IsPrimary
True if this is primary axis.
public bool IsPrimary { get; }
Property Value
IsReversed
True if plots data points from last to first.
public bool IsReversed { get; set; }
Property Value
IsSourceLinked
public bool IsSourceLinked { get; set; }
Property Value
MajorGridLines
Represents major gridLines. Read-only.
//Create worksheetWorkbook workbook = new Workbook();Worksheet worksheet = workbook.Worksheets[0];//Add dataworksheet.Range["A1"].Text = "Jan";
worksheet.Range["B1"].Text = "Feb";
worksheet.Range["C1"].Text = "Mar";
worksheet.Range["A2"].Text = "10";
worksheet.Range["B2"].Text = "20";
worksheet.Range["C2"].Text = "30";//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart axisIChartAxis chartAxis = chart.PrimaryCategoryAxis;//Set visibilitychartAxis.HasMajorGridLines = true;//Set grid linesIChartGridLine gridLine = chartAxis.MajorGridLines;gridLine.LineProperties.Color = Color.Red;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartGridLine MajorGridLines { get; }
Property Value
MajorTickMark
Represents major tick marks.
//Create worksheetWorkbook workbook = new Workbook();Worksheet worksheet = workbook.Worksheets[0];//Add dataworksheet.Range["A1"].Text = "Jan";
worksheet.Range["B1"].Text = "Feb";
worksheet.Range["C1"].Text = "Mar";
worksheet.Range["A2"].Text = "10";
worksheet.Range["B2"].Text = "20";
worksheet.Range["C2"].Text = "30";//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart category axisIChartAxis categoryAxis = chart.PrimaryCategoryAxis;//Set category minor tick typecategoryAxis.MajorTickMark = TickMarkType.TickMarkCross;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public TickMarkType MajorTickMark { get; set; }
Property Value
MinorGridLines
Represents minor gridLines. Read-only.
//Create worksheetWorkbook workbook = new Workbook();Worksheet worksheet = workbook.Worksheets[0];//Add dataworksheet.Range["A1"].Text = "Jan";
worksheet.Range["B1"].Text = "Feb";
worksheet.Range["C1"].Text = "Mar";
worksheet.Range["A2"].Text = "10";
worksheet.Range["B2"].Text = "20";
worksheet.Range["C2"].Text = "30";//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart axisIChartAxis chartAxis = chart.PrimaryCategoryAxis;//Set visibilitychartAxis.HasMinorGridLines = true;//Set grid linesIChartGridLine gridLine = chartAxis.MinorGridLines;gridLine.LineProperties.Color = Color.Red;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public IChartGridLine MinorGridLines { get; }
Property Value
MinorTickMark
Represents minor tick marks.
//Create worksheetWorkbook workbook = new Workbook();Worksheet worksheet = workbook.Worksheets[0];//Add dataworksheet.Range["A1"].Text = "Jan";
worksheet.Range["B1"].Text = "Feb";
worksheet.Range["C1"].Text = "Mar";
worksheet.Range["A2"].Text = "10";
worksheet.Range["B2"].Text = "20";
worksheet.Range["C2"].Text = "30";//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart category axisIChartAxis categoryAxis = chart.PrimaryCategoryAxis;//Set category minor tick typecategoryAxis.MinorTickMark = TickMarkType.TickMarkCross;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public TickMarkType MinorTickMark { get; set; }
Property Value
MultiLevelLable
Axis is show Multi-level category lables.
public bool MultiLevelLable { get; set; }
Property Value
NumberFormat
Gets or sets number format string.
public string NumberFormat { get; set; }
Property Value
NumberFormatIndex
Gets or sets format index.
public int NumberFormatIndex { get; set; }
Property Value
ParagraphType
public ChartParagraphType ParagraphType { get; set; }
Property Value
Shadow
Represents the Shadow.Read-only
public ChartShadow Shadow { get; }
Property Value
ShadowProperties
public IShadow ShadowProperties { get; }
Property Value
TextDirection
axis's text direction
public TextVerticalValue TextDirection { get; set; }
Property Value
TextRotationAngle
Text rotation angle. Should be integer value between -90 and 90.
//Create worksheetWorkbook workbook = new Workbook();Worksheet worksheet = workbook.Worksheets[0];//Add dataworksheet.Range["A1"].Text = "Jan";
worksheet.Range["B1"].Text = "Feb";
worksheet.Range["C1"].Text = "Mar";
worksheet.Range["A2"].Text = "10";
worksheet.Range["B2"].Text = "20";
worksheet.Range["C2"].Text = "30";//Create chart and set rangeChart chart = worksheet.Charts.Add();chart.DataRange = worksheet.Range["A1:C2"];//Set chart category axisIChartAxis chartAxis = chart.PrimaryCategoryAxis;//Set text rotation anglechartAxis.TextRotationAngle = 90;//Save to fileworkbook.SaveToFile("Chart.xlsx");
public int TextRotationAngle { get; set; }
Property Value
TickLabelPosition
Represents tick label position.
public TickLabelPositionType TickLabelPosition { get; set; }
Property Value
Title
Title of the axis.
public string Title { get; set; }
Property Value
TitleArea
Returns text area for the axis title. Read-only.
public IChartTextArea TitleArea { get; }
Property Value
Visible
Indicates is axis is visible.
public bool Visible { get; set; }
Property Value
Methods
Clone(object, Dictionary<int, int>, Dictionary<string, string>)
public virtual XlsChartAxis Clone(object parent, Dictionary<int, int> dicFontIndexes, Dictionary<string, string> dicNewSheetNames)
Parameters
parent
objectdicFontIndexes
Dictionary<int, int>dicNewSheetNames
Dictionary<string, string>