Skip to content

PieCharts

Dr. Philip Wenig edited this page Aug 21, 2020 · 6 revisions

Pie Charts

doughnut

Description

Pie charts are often used to display percentage data.

Types

Pie Chart Doughnut Chart Multilevel Pie Chart Multilevel Doughnut Chart

Examples

	public Chart createChart(Composite parent) {

		double[] values = {337309, 131646, 128948, 100123, 81708, 70478, 58226, 47806, 4067, 265783};
		String[] labels = {"USA", "Spain", "Italy", "Germany", "China", "France", "Iran", "UK", "India", "Other"};

		Chart chart = new Chart(parent, SWT.NONE);
		chart.getTitle().setText("Doughnut Chart");
		ICircularSeries<?> circularSeries = (ICircularSeries<?>)chart.getSeriesSet().createSeries(SeriesType.DOUGHNUT, "pie series");
		circularSeries.setSeries(labels, values);
		Color color = Display.getDefault().getSystemColor(SWT.COLOR_DARK_RED);
		circularSeries.setColor("India", color);
		//
		return chart;
	}
Clone this wiki locally