Reputation:
I need to show the data columns in multiple column chart, I have used single column charts, but I cant find the way to bind another Y-Axis column to the chart
I have data in following format
Name DataField-1 DataField-2
Emp-a 200 220
Emp-b 150 250
Upvotes: 4
Views: 16089
Reputation: 11
It's very easy.
You just go to your properties of Chart control. There is a property called series.
Click on that and give the two series you need to show in the
Chart. Eg: DataField-1
, DataField-2
in your case.
Then simply go to the chart and attach Data-Source to your chart control.
Then you will get two XAxis
and YAxis
.
Then select the correct axis values.
Upvotes: 1
Reputation:
I have found the following link useful for the problem.
http://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx
If any one have better suggestion than this please post.
Find another solution like following..
double[] array1 = { 2.8, 4.4, 6.5, 8.3, 3.6, 5.6, 7.3 };
double[] array2 = { 2.0, 4.0, 6.1, 7.8, 2.5, 5.0, 6.2 };
chart1.Series.Add("Series1");
chtStudentResult.Series["Series1"].Points.DataBindY(array1);
chtStudentResult.Series.Add("Series2");
chtStudentResult.Series["Series2"].Points.DataBindY(array2);
It will generate the desired multiple column, column chart.
Upvotes: 3