[]
IAxisTitleAn IChartTitle provides access to the title text and related formatting for a chart, including its text frame, font, layout participation, formula binding, text orientation, and text direction. Use IChart.getChartTitle() to obtain the title object for a chart.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
IChartTitle chartTitle = chart.getChartTitle();
chartTitle.setText("Sales Analysis");
String titleText = chartTitle.getText();
voiddelete()getFont()IFontFormat object for the chart title.booleanintIChart that contains this chart title.getText()ITextFrame object that contains the text frame settings of the chart title.voidsetDirection(TextDirection value) voidsetFormula(String value) voidsetFormulaR1C1(String value) voidsetIncludeInLayout(boolean value) voidsetOrientation(int value) voidIChart that contains this chart title.Use this method to access the chart that owns the current chart title.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
IChart parentChart = title.getParent();
IChart of the chart title.Use this method to retrieve the text currently displayed in the chart title.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
String text = title.getText();
Use this method to set or replace the text displayed in the chart title.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
title.setText("Sample");
value - The text of the chart title.ITextFrame object that contains the text frame settings of the chart title.Use the returned ITextFrame object to access and modify the text content and layout settings of the chart title.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
ITextFrame textFrame = title.getTextFrame();
textFrame.getTextRange().setText("Quarterly Sales");
ITextFrame object for the chart title text.IFontFormat object for the chart title.Use the returned font format to read or modify font settings for the text displayed in the chart title.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
IFontFormat font = title.getFont();
font.getColor().setRGB(Color.GetBlue());
IFontFormat object for the chart title.Use the returned IChartFormat object to access the fill and line formatting settings of the chart title.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
IChartFormat format = title.getFormat();
format.getFill().getColor().setRGB(Color.GetBlue());
IChartFormat object that represents the chart title formatting.Use this method to retrieve the formula string assigned through setFormula(String) when the chart title is linked to worksheet data.
worksheet.getRange("E1").setValue("Sales Analysis");
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.setHasTitle(true);
chart.getChartTitle().setFormula("=Sheet1!$E$1");
String formula = chart.getChartTitle().getFormula();
worksheet.getRange("E1").setValue("Sales Analysis");
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.setHasTitle(true);
chart.getChartTitle().setFormula("=Sheet1!$E$1");
value - The formula string of the chart title in A1-style notation, in English.Use this method to retrieve the formula string assigned through setFormulaR1C1(String) when the chart title is linked to worksheet data.
worksheet.getRange("E1").setValue("Sales Analysis");
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.setHasTitle(true);
chart.getChartTitle().setFormulaR1C1("=Sheet1!R1C5");
String formula = chart.getChartTitle().getFormulaR1C1();
null if no formula is assigned.
worksheet.getRange("E1").setValue("Sales Analysis");
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.setHasTitle(true);
chart.getChartTitle().setFormulaR1C1("=Sheet1!R1C5");
value - The formula string of the chart title in R1C1-style notation, in English. Sets null if no formula is assigned.If this property is true, the chart title occupies chart layout space when the chart layout is determined. The default value is true.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
chart.getChartTitle().setIncludeInLayout(false);
boolean includeInLayout = chart.getChartTitle().getIncludeInLayout();
true if the chart title occupies chart layout space when the chart layout is determined; otherwise, false.If this property is true, the chart title occupies chart layout space when the chart layout is determined. The default value is true.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
chart.getChartTitle().setIncludeInLayout(false);
value - true if the chart title occupies chart layout space when the chart layout is determined; otherwise, false.The returned value is the rotation angle of the chart title text, in degrees.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
chart.getChartTitle().setOrientation(45);
int orientation = chart.getChartTitle().getOrientation();
Set this property to specify the rotation angle of the chart title text, in degrees.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
chart.getChartTitle().setOrientation(45);
value - The text orientation of the chart title, in degrees.Use this method to determine how the chart title text is oriented, such as horizontal, vertical, or rotated layout.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
chart.getChartTitle().setDirection(TextDirection.Vertical);
TextDirection direction = chart.getChartTitle().getDirection();
TextDirection value that specifies the text direction of the chart title.Use this method to control how the chart title text is displayed, such as horizontal, vertical, or rotated layout.
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
title.setDirection(TextDirection.Vertical);
value - The TextDirection value to apply to the chart title text.Use this method to remove the title from the chart.
worksheet.getRange("A1:B4").setValue(new Object[][]{{"Month", "Sales"}, {"Jan", 12}, {"Feb", 18}, {"Mar", 15}});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
chart.setHasTitle(true);
chart.getChartTitle().setText("Sales Analysis");
IChartTitle title = chart.getChartTitle();
title.delete();