I’m creating a piechart on PowerPoint with 5 rows of data but, when the PowerPoint is created, only the first 4 appear.
- Code: Select all
String [] names = new String []{“name1”,”name2”, “name3”, “name4”, “name5”};
int [] values ={1,2,3,4,5};
pieChart.getChartData().get(0,0).setText(“Names”);
pieChart.getChartData().get(0,1).setText(“Values”);
for (int i=0;i<names.length();i ++){
pieChart.getChartData().get(i+1,0).setText(names[i]);
pieChart.getChartData().get(i+1,1).setText(values[i]);
}
The 5 rows are present in the excel but are not plotted on the graph.
If I only add 2 values, 2 other “dummy” values are added. It seems there’s a problem which fixes the number of values to 4.
I have read in another post that I can solve this by adding “false” to the IChart constructor but, when I do that, the PieChart appears empty in the presentation.
How can I solve this ?
Can you help?