I am working on Pie charts using AChartEngine library. Here I want to disable chart values to show on charts, but only those whose content value is 0.
Now I am using it like:
public Intent execute_assetLifecycle(Context context,RelativeLayout parent) {
int[] colors = new int[] { Color.RED, Color.DKGRAY, Color.BLUE, Color.CYAN,Color.GREEN,Color.GRAY };
DefaultRenderer renderer = buildCategoryRenderer(colors);
CategorySeries categorySeries = new CategorySeries("Title1");
categorySeries.add("30 Days=" days_count_30);
categorySeries.add("60 Days=", days_count_60);
categorySeries.add("90 Days=", days_count_90);
categorySeries.add("180 Days=", days_count_180);
mChartView2=ChartFactory.getPieChartView(context, categorySeries,renderer);
parent.addView(mChartView2);
return ChartFactory.getPieChartIntent(context, categorySeries, renderer,null);
}
protected DefaultRenderer buildCategoryRenderer(int[] colors) {
DefaultRenderer renderer = new DefaultRenderer();
for (int color : colors) {
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
renderer.addSeriesRenderer(r);
}
return renderer;
}
I am using the above code to display pie chart with display values, but I want to show only those display values which are >0 otherwise They will not be shown on the charts as label like: 30 days=0
Please suggest any method that would stop displaying chart values when its value ==0