/*All pie Chart Align in horizontal Order*/
using System.Web.UI.DataVisualization.Charting;
using System.Drawing;
public partial class MultiPieChartLayout: System.Web.UI.Page
{
Random rand =new Random();
protected void Page_Load(object sender, EventArgs e)
{
// Clear all series and chart areas so we can re-add them
Chart2.Series.Clear();
Chart2.ChartAreas.Clear();
for (int i = 0; i < 3; i++)
{
// Create four new series and four new chart areas
Chart1.Series.Add("Series" + i.ToString());
Chart1.ChartAreas.Add("ChartArea" + i.ToString());
// Assign each series to a separate chart area
Chart1.Series[i].ChartArea = "ChartArea" + i.ToString();
// Set all series to be pie
Chart1.Series[i].ChartType = SeriesChartType.Pie;
// Add 3 random points to each pie chart
for (int j = 0; j < 3; j++)
Chart2.Series[i].Points.AddXY(i, rand.Next(20, 40));
}
// chart area position for the first chart area.
Chart2.ChartAreas["ChartArea0"].Position.X = 5;
Chart2.ChartAreas["ChartArea0"].Position.Y = 15;
Chart2.ChartAreas["ChartArea0"].Position.Width = 15;
Chart2.ChartAreas["ChartArea0"].Position.Height = 40;
//chart area position for the second chart area.
Chart2.ChartAreas["ChartArea1"].Position.X = 30;
Chart2.ChartAreas["ChartArea1"].Position.Y = 15;
Chart2.ChartAreas["ChartArea1"].Position.Width = 15;
Chart2.ChartAreas["ChartArea1"].Position.Height = 40;
//chart area position for the third chart area.
Chart2.ChartAreas["ChartArea2"].Position.X = 55;
Chart2.ChartAreas["ChartArea2"].Position.Y = 15;
Chart2.ChartAreas["ChartArea2"].Position.Width = 15;
Chart2.ChartAreas["ChartArea2"].Position.Height = 40;
}
}