Subtitle for a Chart

Hi,

How can I add a subtitle or multiple titles for a chart similar to the Chart title using Aspose cells Java APi?

Thanks in Advance

@SrideviG,

Could you please zip and attach a sample Excel file containing the chart having subtitle and multiple titles, you may create the chart with multiple titles/sub-titles in MS Excel manually. We will check it on how to do it via Aspose.Cells API.

Hi @amjad.sahi, Thanks for the quick response

I did try the following code to set the title and subtitle. But the subtitle code is not working.

// setting Title
chart.getTitle().setText(“Title”);
chart.getTitle().getFont().setColor(Color.getBlue());
chart.getTitle().getFont().setBold(true);
chart.getTitle().getFont().setSize(12);

// setting Subitle
chart.getSubTitle().setText(“Subtitle”);
chart.getSubTitle().getFont().setColor(Color.getGreen());
chart.getSubTitle().getFont().setBold(false);
chart.getSubTitle().getFont().setSize(8);

@SrideviG,

Could you please zip and attach template Excel file containing your desired title and subtitle for the chart, you may create your desired chart in MS Excel. We will check it soon.

@SrideviG,
After setting the data, what format do you save the file to? Chart.getSubTitle() is only for ODS format file. Please refer to the api: