ChartAxisTitle

ChartAxisTitle class

Provides access to the axis title properties.

To learn more, visit the Working with Charts documentation article.

public class ChartAxisTitle

Properties

NameDescription
Font { get; }Provides access to the font formatting of the axis title.
Format { get; }Provides access to fill and line formatting of the axis title.
Overlay { get; set; }Determines whether other chart elements shall be allowed to overlap the title. The default value is false.
Show { get; set; }Determines whether the title shall be shown for the axis. The default value is false.
Text { get; set; }Gets or sets the text of the axis title. If null or empty value is specified, auto generated title will be shown.

Examples

Shows how to set chart axis title.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.InsertChart(ChartType.Column, 432, 252);

Chart chart = shape.Chart;
ChartSeriesCollection seriesColl = chart.Series;
// Delete default generated series.
seriesColl.Clear();

seriesColl.Add("AW Series 1", new string[] { "AW Category 1", "AW Category 2" }, new double[] { 1, 2 });

ChartAxisTitle chartAxisXTitle = chart.AxisX.Title;
chartAxisXTitle.Text = "Categories";
chartAxisXTitle.Show = true;
ChartAxisTitle chartAxisYTitle = chart.AxisY.Title;
chartAxisYTitle.Text = "Values";
chartAxisYTitle.Show = true;
chartAxisYTitle.Overlay = true;
chartAxisYTitle.Font.Size = 12;
chartAxisYTitle.Font.Color = Color.Blue;

doc.Save(ArtifactsDir + "Charts.ChartAxisTitle.docx");

See Also