We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set up- do not show the chart title

According to the document provided by the example of call,
chart.hasTitle(false);
but the title still shows, how do I set the title does not show

code:
AsposeLicense.readLic();
PresentationEx pres = new PresentationEx();
//Access first slide
SlideEx sld = pres.getSlides().get_Item(0);
// Add chart with default data
ChartEx chart = sld.getShapes().addChart(ChartTypeEx.Pie, 100, 100, 400, 400);
//Setting the index of chart data sheet
int defaultWorksheetIndex = 0;
//Getting the chart data worksheet
ChartDataCellFactory fact = chart.getChartData().getChartDataCellFactory();
//Delete default generated series and categories
chart.getChartData().getSeries().clear();
chart.getChartData().getCategories().clear();
//Adding new categories
chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, “First Qtr”));
chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, “2nd Qtr”));
chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, “3rd Qtr”));
//Adding new series
int Id = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, “Series 1”), chart.getType());
//Accessing added series
ChartSeriesEx series = chart.getChartData().getSeries().get_Item(Id);
//Now populating series data
series.getValues().add(fact.getCell(defaultWorksheetIndex, 1, 1, 20));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 2, 1, 50));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 3, 1, 30));
//Setting chart Title
chart.hasTitle(false);
chart.hasLegend(false);
pres.write(“D:\Aspose01.pptx”);

Hi John,

I have worked with the sample code shared by you using Aspose.Slides for Java 8.4.0 and have not been able to observe the issue of chart title still appearing even after setting chart.hasTitle(false). Please try using the specified version on your end to serve the purpose and share with us if there is still an issue.

Many Thanks,

I’m sorry, I’ve been using version 8.4, still appear such problem, the following figure;
The title of the Series 1 still exist



thanks

Hi John,

I have re-verified your exact code without any single change on my end using Aspose.Slides for Java in Windows 7 x64 with JDK 1.6_45 installed. I have not been able to observe any chart title on my end. Please observe the attached presentation and generated thumbnail for your kind reference.

Can you please provide the Java and operating system details on your end along with presentation generated from Aspose.Slides for Java 8.4.0. Please also share the PowerPoint exact version in which you are reproducing the issue on your end.

Many Thanks,

According to my provide the code above, in the following two kinds of circumstances, run results all have problems
1:using Aspose.Slides for Java 8.4.0 in Windows 7 x64 with jdk1.7.0_45 installed
2:using Aspose.Slides for Java 8.4.0 in Windows 7 x64 with jdk1.6.0_18 installed

The following is the use of the jar file
1:aspose.slides-8.4.0.jar
2:aspose.slides-8.4.0-jdk14.jar

Would you like to use my give you code, test, or I write has a problem, are looking forward to your reply,
thank
s

Hi John,

I have used the following sample code on my end for my investigation. It is the same code that you have shared with me.

PresentationEx pres = new PresentationEx();

//Access first slide
SlideEx sld = pres.getSlides().get_Item(0);

// Add chart with default data
ChartEx chart = sld.getShapes().addChart(ChartTypeEx.Pie, 100, 100, 400, 400);

//Setting the index of chart data sheet
int defaultWorksheetIndex = 0;

//Getting the chart data worksheet
ChartDataCellFactory fact = chart.getChartData().getChartDataCellFactory();

//Delete default generated series and categories
chart.getChartData().getSeries().clear();
chart.getChartData().getCategories().clear();

//Adding new categories
chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, “First Qtr”));
chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, “2nd Qtr”));
chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, “3rd Qtr”));

//Adding new series
int Id = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, “Series 1”), chart.getType());

//Accessing added series
ChartSeriesEx series = chart.getChartData().getSeries().get_Item(Id);

//Now populating series data
series.getValues().add(fact.getCell(defaultWorksheetIndex, 1, 1, 20));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 2, 1, 50));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 3, 1, 30));

//Setting chart Title
chart.hasTitle(false);
chart.hasLegend(false);

//write presentation
pres.write(“D:\Aspose Data\Aspose01.pptx”);

As requested earlier,Can you please provide the Java and operating system details on your end
along with presentation generated from Aspose.Slides for Java 8.4.0.
Please also share the exact PowerPoint version in which you are
reproducing the issue on your end. Please also share that if you are able to open the presentation Aspose01.pptx file shared by me on your end. Does it contain the chart title in it. I also suggest you to please create a sample application from scratch by using above code to verify the issue.

Many Thanks,