Hi,
We are trying to export PPT and PDF just like the PPT.
Issue 1 : Is there any way to get the error bars for the line chart of a powerpoint slides ? I didn’t find it in this short time. Please, provide me the code how to get error bars in Aspose.Slides.Pptx.Charts.ChartSeriesEx.
Issue 2 : We are doing PPT export basis on a template file. Please, see the SampleTemplate.pptx file which is our template and ChartHolder Chart is our target. In this chart, “Switch Row/Column” has been done for the selected data and we provide some sample data, for example- upto ‘Column12’.
Our concept is something like that if we provide less than these sample data eg. A1:G7 then our chart will draw with the less data eg. A1:D6 and category would not be shown on chart with E,F & G column.
We use these code to draw chart :
ShapeEx shape = GetShape(“ChartHolder”);
ChartEx chart = (ChartEx)shape;
int prevSeries = chart.ChartData.Series.Count;
int prevCat = chart.ChartData.Categories.Count;
Workbook wb = new Workbook(chart.ChartData.ReadWorkbookStream());
wb.Worksheets[0].Cells[0, 0].PutValue("");
wb.Worksheets[0].Cells[0, 1].PutValue(“Series1”);
wb.Worksheets[0].Cells[0, 2].PutValue(“Series2”);
wb.Worksheets[0].Cells[0, 3].PutValue(“Series3”);
wb.Worksheets[0].Cells[1, 0].PutValue(“Category1”);
wb.Worksheets[0].Cells[1, 1].PutValue(“2”);
wb.Worksheets[0].Cells[1, 2].PutValue(“6”);
wb.Worksheets[0].Cells[1, 3].PutValue(“0”);
wb.Worksheets[0].Cells[2, 0].PutValue(“Category2”);
wb.Worksheets[0].Cells[2, 1].PutValue(“6”);
wb.Worksheets[0].Cells[2, 2].PutValue(“2”);
wb.Worksheets[0].Cells[2, 3].PutValue(“6”);
wb.Worksheets[0].Cells[3, 0].PutValue(“Category3”);
wb.Worksheets[0].Cells[3, 1].PutValue(“6”);
wb.Worksheets[0].Cells[3, 2].PutValue(“8”);
wb.Worksheets[0].Cells[3, 3].PutValue(“3”);
wb.Worksheets[0].Cells[4, 0].PutValue(“Category4”);
wb.Worksheets[0].Cells[4, 1].PutValue(“7”);
wb.Worksheets[0].Cells[4, 2].PutValue("-8");
wb.Worksheets[0].Cells[4, 3].PutValue("-5");
wb.Worksheets[0].Cells[5, 0].PutValue(“Category5”);
wb.Worksheets[0].Cells[5, 1].PutValue(“3”);
wb.Worksheets[0].Cells[5, 2].PutValue(“4”);
wb.Worksheets[0].Cells[5, 3].PutValue(“15”);
if (prevCat >= 3)
{
for (int i = prevCat; i >= 3; i–)
wb.Worksheets[0].Cells.HideColumn(i); // Hide the extra columns
}
MemoryStream ms2 = new MemoryStream();
wb.Save(ms2, Aspose.Cells.SaveFormat.Xlsx);
ms2.Position = 0;
chart.ChartData.WriteWorkbookStream(ms2);
if ( prevSeries >= 5)
{
for (int i = prevSeries; i >= 5; i–)
chart.ChartData.Series.RemoveAt(4); //Delete the extra row
}
chart.PlotVisibleCellsOnly = true;
With these code, PPT export is just fine. Please, see attached file Saved.pptx. (We also use Marker Formatting and series Line Dash Type which you can see in the Saved.pptx).
MemoryStream fileStream = new MemoryStream()
_presentation.Save(fileStream, SaveFormat.Pdf);
byte[] bytes = fileStream.ToArray();
But, problem is whenever we save it as pdf we got the issues with
1. See Saved.pptx , there are Series1, Series2, Series3, but in PDF there is a space after Series3 in the chart.
2. Marker formatting (marker size and marker border color) isn’t applied, please see pptx and pdf files ofr Category2 (if you need code for this, please ask)
3. Series Line Dash Type isn’t applied in Category2 between Series2 and Series3, , please see pptx and pdf files ofr Category2 (if you need code for this, please ask)
Need help urgently…