Example #1
0
		private void buildPieChart() {

			int offset = 20;
			PieChartData data = (PieChartData)this.chartData;
            ChartDirector.PieChart pieChart = new ChartDirector.PieChart(this.chartPanel.Size.Width, this.chartPanel.Size.Height);

			int radius = (Math.Min(this.chartPanel.Size.Width, this.chartPanel.Size.Height) - (2 * offset)) / 2;
			// Set the center of the pie
			pieChart.setPieSize(this.chartPanel.Size.Width/2, this.chartPanel.Size.Height/2, radius);
			pieChart.addTitle(data.Title);

			pieChart.setData(data.Data, data.Labels);

			pieChart.setLabelStyle("", 8);
			pieChart.set3D();
			pieChart.setLabelLayout(1);

			// output the chart
			this.chartPanel.Image = pieChart.makeImage();  				
		}