A pie chart is a visualization with colored arcs or sectors called slices, within a circle, each representing the value of a distinct fragment of the data as a percentage that is reflected by its size relative to that of other sectors. Most pie chart implementations have labeled slices that are animated during mouse gestures on them. However, a good label and appropriate colors for each slice usually suffice.
Create a Chart
instance, a ChartModel
, and then a PieChart
object, set the model on the chart with chart.setChartModel()
and then place the chart on the screen with a LayoutContainer
. When the data is ready, use pieChart.addSlice()
to add the slices to the chart, afterwards invoke addChartConfig()
on ChartModel
to pass in the PieChart
to it and then refresh the screen if needs be.
@Override public void onModuleLoad() { Chart chart = new Chart("resources/chart/open-flash-chart.swf"); final ChartModel model = new ChartModel("Customer Purchases"); final...