Exemplo n.º 1
0
		private void createPieChart() {

			int offset = 10;
			PieChartData data = (PieChartData)this.chartData;
			this.Label = data.Title;

			// Create a PieChart object
            ChartDirector.PieChart c = 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
			c.setPieSize(this.chartPanel.Size.Width/2, this.chartPanel.Size.Height/2, radius);

			// Set the pie data and the pie labels
			c.setData(data.Data);
			c.setLabelFormat("{label}");

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