Reputation: 2870
I am using Android Plot(http://androidplot.com/) library to draw a Pie chart and Pie chart draw is fine but I want legend and its customisation as shown in attached image so please guide me to do same in Android Plot library.
Upvotes: 1
Views: 2015
Reputation: 8317
Pie chart legends were added in Androidplot 1.5.0 but is disabled by default. To enable:
pieChart.legend.setVisible(true);
Configuration of the legend works the same way it does for other series types in Androidplot. For example, you can configure a single column with 4 rows:
pie.getLegend().setTableModel(new DynamicTableModel(1, 4));
Or a single row with 4 columns (shown below):
pie.getLegend().setTableModel(new DynamicTableModel(4, 1));
Upvotes: 1