com.aspose.words
Class ChartAxisTitle

java.lang.Object
    extended by com.aspose.words.ChartAxisTitle

public class ChartAxisTitle 
extends java.lang.Object

Provides access to the axis title properties.

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

Example:

Shows how to set chart axis title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);

Chart chart = shape.getChart();
ChartSeriesCollection seriesColl = chart.getSeries();
// Delete default generated series.
seriesColl.clear();

seriesColl.add("AW Series 1", new String[] { "AW Category 1", "AW Category 2" }, new double[] { 1.0, 2.0 });

// Set axis title.
ChartAxisTitle chartAxisXTitle = chart.getAxisX().getTitle();
chartAxisXTitle.setText("Categories");
chartAxisXTitle.setShow(true);
ChartAxisTitle chartAxisYTitle = chart.getAxisY().getTitle();
chartAxisYTitle.setText("Values");
chartAxisYTitle.setShow(true);
chartAxisYTitle.setOverlay(true);
chartAxisYTitle.getFont().setSize(12.0);
chartAxisYTitle.getFont().setColor(Color.BLUE);

doc.save(getArtifactsDir() + "Charts.ChartAxisTitle.docx");

Property Getters/Setters Summary
FontgetFont()
           Provides access to the font formatting of the axis title.
booleangetOverlay()
voidsetOverlay(boolean value)
           Determines whether other chart elements shall be allowed to overlap the title. The default value is false.
booleangetShow()
voidsetShow(boolean value)
           Determines whether the title shall be shown for the axis. The default value is false.
java.lang.StringgetText()
voidsetText(java.lang.String value)
           Gets or sets the text of the axis title. If null or empty value is specified, auto generated title will be shown.
 

Property Getters/Setters Detail

getFont

public Font getFont()
Provides access to the font formatting of the axis title.

Example:

Shows how to set chart axis title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);

Chart chart = shape.getChart();
ChartSeriesCollection seriesColl = chart.getSeries();
// Delete default generated series.
seriesColl.clear();

seriesColl.add("AW Series 1", new String[] { "AW Category 1", "AW Category 2" }, new double[] { 1.0, 2.0 });

// Set axis title.
ChartAxisTitle chartAxisXTitle = chart.getAxisX().getTitle();
chartAxisXTitle.setText("Categories");
chartAxisXTitle.setShow(true);
ChartAxisTitle chartAxisYTitle = chart.getAxisY().getTitle();
chartAxisYTitle.setText("Values");
chartAxisYTitle.setShow(true);
chartAxisYTitle.setOverlay(true);
chartAxisYTitle.getFont().setSize(12.0);
chartAxisYTitle.getFont().setColor(Color.BLUE);

doc.save(getArtifactsDir() + "Charts.ChartAxisTitle.docx");

getOverlay/setOverlay

public boolean getOverlay() / public void setOverlay(boolean value)
Determines whether other chart elements shall be allowed to overlap the title. The default value is false.

Example:

Shows how to set chart axis title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);

Chart chart = shape.getChart();
ChartSeriesCollection seriesColl = chart.getSeries();
// Delete default generated series.
seriesColl.clear();

seriesColl.add("AW Series 1", new String[] { "AW Category 1", "AW Category 2" }, new double[] { 1.0, 2.0 });

// Set axis title.
ChartAxisTitle chartAxisXTitle = chart.getAxisX().getTitle();
chartAxisXTitle.setText("Categories");
chartAxisXTitle.setShow(true);
ChartAxisTitle chartAxisYTitle = chart.getAxisY().getTitle();
chartAxisYTitle.setText("Values");
chartAxisYTitle.setShow(true);
chartAxisYTitle.setOverlay(true);
chartAxisYTitle.getFont().setSize(12.0);
chartAxisYTitle.getFont().setColor(Color.BLUE);

doc.save(getArtifactsDir() + "Charts.ChartAxisTitle.docx");

getShow/setShow

public boolean getShow() / public void setShow(boolean value)
Determines whether the title shall be shown for the axis. The default value is false.

Example:

Shows how to set chart axis title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);

Chart chart = shape.getChart();
ChartSeriesCollection seriesColl = chart.getSeries();
// Delete default generated series.
seriesColl.clear();

seriesColl.add("AW Series 1", new String[] { "AW Category 1", "AW Category 2" }, new double[] { 1.0, 2.0 });

// Set axis title.
ChartAxisTitle chartAxisXTitle = chart.getAxisX().getTitle();
chartAxisXTitle.setText("Categories");
chartAxisXTitle.setShow(true);
ChartAxisTitle chartAxisYTitle = chart.getAxisY().getTitle();
chartAxisYTitle.setText("Values");
chartAxisYTitle.setShow(true);
chartAxisYTitle.setOverlay(true);
chartAxisYTitle.getFont().setSize(12.0);
chartAxisYTitle.getFont().setColor(Color.BLUE);

doc.save(getArtifactsDir() + "Charts.ChartAxisTitle.docx");

getText/setText

public java.lang.String getText() / public void setText(java.lang.String value)
Gets or sets the text of the axis title. If null or empty value is specified, auto generated title will be shown. Use Show option if you need to show the title.

Example:

Shows how to set chart axis title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);

Chart chart = shape.getChart();
ChartSeriesCollection seriesColl = chart.getSeries();
// Delete default generated series.
seriesColl.clear();

seriesColl.add("AW Series 1", new String[] { "AW Category 1", "AW Category 2" }, new double[] { 1.0, 2.0 });

// Set axis title.
ChartAxisTitle chartAxisXTitle = chart.getAxisX().getTitle();
chartAxisXTitle.setText("Categories");
chartAxisXTitle.setShow(true);
ChartAxisTitle chartAxisYTitle = chart.getAxisY().getTitle();
chartAxisYTitle.setText("Values");
chartAxisYTitle.setShow(true);
chartAxisYTitle.setOverlay(true);
chartAxisYTitle.getFont().setSize(12.0);
chartAxisYTitle.getFont().setColor(Color.BLUE);

doc.save(getArtifactsDir() + "Charts.ChartAxisTitle.docx");

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.