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

Free Support Forum - aspose.com

Need information on creating more than one slide in a presentation

Hi,

kindly porvide me some inputs on creating more than one slide in a presentation(pptx format).

I tried creating a table and a chart in two different slides in a same ppt but chart is displayed on top of table in the first slide.So kindly help me to overcome this issue.

Thanks in advance

Manjunath

Hi Manjunath,

Thanks for your growing interest in Aspose.Slides.

I have observed your requirement and like to share that you can add as many slide as you like using Aspose.Slides in your presentation with defined layout type. Please visit this documentation link for your kind reference in this regard to see how the slides can be added in presentation.

For second part of your query, I like to share that each slide has its own collection of shapes. You need to select the desired slide by its index and then add the shapes to that. The position of the added shape is in your control and you can set the values as per your requirement where you want to please them on slide.

If there is still an issue then please share the sample application that you wish to build using Aspose.Slides and I will try my best to help you further.

Many Thanks,

Hi,

Kindly find the attached code and output generated file of mine.I tried following the approach you suggested me but not able to access some of the methods in this case.

In tablewithchart.pptx,you will notice chart is being displayed on top of a table.I need this to be displayed in different slides.

Kindly let me know,how to achieve this.

Hi Manjunath,

I have observed the sample code shared by you. You are actually adding both chart and table on same first slide, which is wrong. When you instantiate PresentationEx object, Aspose.Slides creates a default empty slide for you. You need to add the slides for your use in your presentation if you need them. Please use the attached sample code on your end to serve the purpose.

Please share, if I may help you further in this regard.

Many Thanks,

Hi,

I didnt see any attachments in your reply.

Hi,


I am sorry for your inconvenience. Please find the file attached in this post.

Many Thanks,

Hi Mudassir,

Thanks a lot for providing me the solution.

Now I am struck up with two issues mentioned below while displaying charts in slides.

1.How Can I display legends below the chart ?

2.How to display all data labels in a chart ? I tried achieving with below mentioned piece of code.

//Set the DataLabels in the chart DataLabels datalabels;
for (int i = 0; i < chart.getNSeries().getCount(); i++)
{
datalabels = chart.getNSeries().get(i).getDataLabels();
//Set the position of DataLabels datalabels.setPosition(LabelPositionType.INSIDE_BASE);
//Show the category name in the DataLabels datalabels.setCategoryNameShown(true);
//Show the value in the DataLabels datalabels.setValueShown(true);
//Not show the percentage in the DataLabels datalabels.setPercentageShown(false);
//Not show the legend key. datalabels.setLegendKeyShown(false);
}

Methods like getNSeries,getCount are not acessible for me.

Kindly let me know how to achieve these functionalities.

For your reference ,I am attaching code containing these two issues.

Hi Manjunath,

I have observed your requirement for setting legend position and enabling chart labels. I like to share that I have just shared the sample code for displaying labels and setting chart legend position with you in another thread. Please visit this thread link for your kind reference in this regard. For more about setting different chart series labels, please visit the sample code shared over this documentation link as well.

Many Thanks,

Thanks a lot for providing information.

Hi,

Below mentioned piece of code is not working.Irrespective of the color used,series is being displayed in blue color. For your reference,I am attaching the piece of code and slide.

series2.getFormat().getFill().setFillType(FillTypeEx.Solid);

series2.getFormat().getFill().getSolidFillColor().setColorType(PresetColorEx.Cyan);

chart2.getLegend().setPosition(LegendPositionTypeEx.Bottom);

Kindly let me know,how to achieve this.

v

Hi,

I have observed your requirement and suggest you to please try using java.awt.Color for setting the color. Please try using the following mechanism on your end.

series.getFormat().getFill().getSolidFillColor().setColor(java.awt.Color.BLUE);

You can also set the custom color by selecting RGB values and I have already shared the mechanism for that with you in this thread link. Please try using the suggested options and share with us if there is still an issue on your end.

Many Thanks,