java.lang.Object
com.aspose.words.ChartTitle
public class ChartTitle
To learn more, visit the https://docs.aspose.com/words/net/working-with-charts/Working with Charts documentation article. Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a chart shape with a document builder and get its chart.
Shape chartShape = builder.insertChart(ChartType.BAR, 400.0, 300.0);
Chart chart = chartShape.getChart();
// Use the "Title" property to give our chart a title, which appears at the top center of the chart area.
ChartTitle title = chart.getTitle();
title.setText("My Chart");
// Set the "Show" property to "true" to make the title visible.
title.setShow(true);
// Set the "Overlay" property to "true" Give other chart elements more room by allowing them to overlap the title
title.setOverlay(true);
doc.save(getArtifactsDir() + "Charts.ChartTitle.docx");
| Property Getters/Setters Summary | ||
|---|---|---|
boolean | getOverlay() | |
void | setOverlay(boolean value) | |
Determines whether other chart elements shall be allowed to overlap title.
By default overlay is false.
|
||
boolean | getShow() | |
void | setShow(boolean value) | |
Determines whether the title shall be shown for this chart.
Default value is true.
|
||
java.lang.String | getText() | |
void | setText(java.lang.String value) | |
Gets or sets the text of the chart title.
If null or empty value is specified, auto generated title will be shown.
|
||
| Property Getters/Setters Detail |
|---|
getOverlay/setOverlay | |
public boolean getOverlay() / public void setOverlay(boolean value) | |
false.
Example:
Shows how to insert a chart and set a title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a chart shape with a document builder and get its chart.
Shape chartShape = builder.insertChart(ChartType.BAR, 400.0, 300.0);
Chart chart = chartShape.getChart();
// Use the "Title" property to give our chart a title, which appears at the top center of the chart area.
ChartTitle title = chart.getTitle();
title.setText("My Chart");
// Set the "Show" property to "true" to make the title visible.
title.setShow(true);
// Set the "Overlay" property to "true" Give other chart elements more room by allowing them to overlap the title
title.setOverlay(true);
doc.save(getArtifactsDir() + "Charts.ChartTitle.docx");getShow/setShow | |
public boolean getShow() / public void setShow(boolean value) | |
true.
Example:
Shows how to insert a chart and set a title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a chart shape with a document builder and get its chart.
Shape chartShape = builder.insertChart(ChartType.BAR, 400.0, 300.0);
Chart chart = chartShape.getChart();
// Use the "Title" property to give our chart a title, which appears at the top center of the chart area.
ChartTitle title = chart.getTitle();
title.setText("My Chart");
// Set the "Show" property to "true" to make the title visible.
title.setShow(true);
// Set the "Overlay" property to "true" Give other chart elements more room by allowing them to overlap the title
title.setOverlay(true);
doc.save(getArtifactsDir() + "Charts.ChartTitle.docx");getText/setText | |
public java.lang.String getText() / public void setText(java.lang.String value) | |
null or empty value is specified, auto generated title will be shown.
Example:
Shows how to insert a chart and set a title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert a chart shape with a document builder and get its chart.
Shape chartShape = builder.insertChart(ChartType.BAR, 400.0, 300.0);
Chart chart = chartShape.getChart();
// Use the "Title" property to give our chart a title, which appears at the top center of the chart area.
ChartTitle title = chart.getTitle();
title.setText("My Chart");
// Set the "Show" property to "true" to make the title visible.
title.setShow(true);
// Set the "Overlay" property to "true" Give other chart elements more room by allowing them to overlap the title
title.setOverlay(true);
doc.save(getArtifactsDir() + "Charts.ChartTitle.docx");