Add Secondary Categorries

Hi,


I want to add SecondaryCategories in my chart.
i.e. i want to allow multiple category label .
How should i add Secondary categories in my chart ?



Thanks

Hi,


I have observed your requirements. Please follow guidelines on this link. This link will help you to achieve your requirements.

Best Regards,

Hi,


I am unable to get the suitable example.
Can you give one example where there are categories and SecondaryCategories added in a same chart ?

Thanks



Hi,


I have observed your comments. Please check this link for code examples. I hope this will help you to achieve your requirements.

Best Regards,

Hi,


Actually I want like Below ,

Category 1
SubCategory 1
SubCategory 2
SubCategory 3
Category 2
SubCategory 1
SubCategory 2
SubCategory 3


Can you help me for this ?



Thanks




Hi,

I have observed the requirements of multi level chart categories shared by you and like to share that the support is available in Aspose.Slides but there is some issue in using that. An issue with ID SLIDESJAVA-35840 has been created in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

We are sorry for your inconvenience,

Hi,

I have worked further over the requirement shared and suggest you to please try using following sample code on your end to achieve the goal of multilevel chart categories. I hope this will be helpful.

public static void testMultilevel()
{

Presentation pres = new Presentation();
IChart ch = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.ClusteredColumn, 100, 100, 600, 450);
ch.getChartData().getSeries().clear();
ch.getChartData().getCategories().clear();


IChartDataWorkbook fact = ch.getChartData().getChartDataWorkbook();
fact.clear(0);
int defaultWorksheetIndex = 0;

IChartCategory category = ch.getChartData().getCategories().add(fact.getCell(0, “c2”, “A”));
category.getGroupingLevels().setGroupingItem(1, “Group1”);
category = ch.getChartData().getCategories().add(fact.getCell(0, “c3”, “B”));

category = ch.getChartData().getCategories().add(fact.getCell(0, “c4”, “C”));
category.getGroupingLevels().setGroupingItem(1, “Group2”);
category = ch.getChartData().getCategories().add(fact.getCell(0, “c5”, “D”));

category = ch.getChartData().getCategories().add(fact.getCell(0, “c6”, “E”));
category.getGroupingLevels().setGroupingItem(1, “Group3”);
category = ch.getChartData().getCategories().add(fact.getCell(0, “c7”, “F”));

category = ch.getChartData().getCategories().add(fact.getCell(0, “c8”, “G”));
category.getGroupingLevels().setGroupingItem(1, “Group4”);
category = ch.getChartData().getCategories().add(fact.getCell(0, “c9”, “H”));

// Adding Series
IChartSeries series = ch.getChartData().getSeries().add(fact.getCell(0, “D1”, “Series 1”),
ChartType.ClusteredColumn);

series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D2”, 10));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D3”, 20));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D4”, 30));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D5”, 40));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D6”, 50));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D7”, 60));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D8”, 70));
series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, “D9”, 80));


pres.save(“C:\Aspose Data\genlevel.pptx”, SaveFormat.Pptx);
}

Many Thanks,

The issues you have found earlier (filed as SLIDESJAVA-35840) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.