This question is locked. New answers and comments are not allowed.
When I call the getLegendInfos() method on a pie chart, it returns LegendItems with title = null, fillColor = 0, and strokeColor = 0. I added the following code to the Pie Series example:
ObservableCollection<LegendItem> origLegendItems = pieChart.getLegendInfos();
for (int i=0; i<origLegendItems.size(); i++) {
LegendItem origItem = origLegendItems.get(i);
Log.d("TEST", "item "+i+" title = " + origItem.getTitle());
Log.d("TEST", "item "+i+" fillColor = " + origItem.getFillColor());
Log.d("TEST", "item "+i+" strokeColor = " + origItem.getStrokeColor());
}
The resulting log:
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 0 title = null
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 0 fillColor = 0
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 0 strokeColor = 0
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 1 title = null
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 1 fillColor = 0
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 1 strokeColor = 0
Why does this happen with pie charts? I tried the same thing on the Line Series example and was able to log the correct values for the LegendItems returned.
ObservableCollection<LegendItem> origLegendItems = pieChart.getLegendInfos();
for (int i=0; i<origLegendItems.size(); i++) {
LegendItem origItem = origLegendItems.get(i);
Log.d("TEST", "item "+i+" title = " + origItem.getTitle());
Log.d("TEST", "item "+i+" fillColor = " + origItem.getFillColor());
Log.d("TEST", "item "+i+" strokeColor = " + origItem.getStrokeColor());
}
The resulting log:
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 0 title = null
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 0 fillColor = 0
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 0 strokeColor = 0
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 1 title = null
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 1 fillColor = 0
02-01 13:49:49.797 22465-22465/com.telerik.examples D/TEST: item 1 strokeColor = 0
Why does this happen with pie charts? I tried the same thing on the Line Series example and was able to log the correct values for the LegendItems returned.