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

Free Support Forum - aspose.com

Chart oreintation

I have attached the chart created through Aspose slides .
My requirement is the i want the categoryaxis as Y axis and the valueaxis as X axis and the lines plotted for each category

PresentationEx pres = new PresentationEx();
SlideEx sld = pres.getSlides().get_Item(0);
ChartEx chart = sld.getShapes().addChart(ChartTypeEx.Line, 10, 60, 700, 400);
// chart.getChartData().getSeries().clear();
chart.getChartData().getCategories().clear();

int defaultWorksheetIndex = 0;
ChartDataCellFactory fact = chart.getChartData().getChartDataCellFactory();
chart.getValueAxis().setMinValue(0);
chart.getValueAxis().setMaxValue(-5);
chart.hasLegend(false);

chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "RED"));
chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "BLUE"));
chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "GREEN"));
chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 4, 0, "YELLOW"));

ChartSeriesEx series = chart.getChartData().getSeries().get_Item(0);
series.getValues().add(fact.getCell(defaultWorksheetIndex, 1, 1,-5));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 2, 1,-5));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 3, 1,-5));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 4, 1,-5));
series.setMarkerSymbol(MarkerStyleTypeEx.Circle);
series.setMarkerSize(10);

series = chart.getChartData().getSeries().get_Item(1);
series.getValues().add(fact.getCell(defaultWorksheetIndex, 1, 2, -4));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 2, 2, -4));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 3, 2, -4));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 4, 2, -4));
series.setMarkerSymbol(MarkerStyleTypeEx.Circle);
series.setMarkerSize(10);

series = chart.getChartData().getSeries().get_Item(2);
series.getValues().add(fact.getCell(defaultWorksheetIndex, 1, 3,-3));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 2, 3,-3));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 3, 3,-3));
series.getValues().add(fact.getCell(defaultWorksheetIndex, 4, 3, -3));
series.setMarkerSymbol(MarkerStyleTypeEx.Circle);
series.setMarkerSize(10);


chart.getCategoryAxis().getMajorGridLines().getFillFormat().setFillType(FillTypeEx.NoFill);
chart.getValueAxis().getMajorGridLines().getFillFormat().setFillType(FillTypeEx.NoFill);

pres.write("E:\\Colors.pptx");

Can you help please

Hi,

I have observed the requirements shared by you and regret to share that the required chart is not possible to implement in MSO charts. If it is possible using Microsoft Office then please share with us and I will try to create it using Aspose.Slides. The only option that is possible to achieve such charts is to use scatter charts with lines whereby you can give x and y points for chart and can develop such charts. Please visit this documentation link for your kind reference in this regard.

Many Thanks,