Changing Chart type of Chart control in ASP.NET 4
How can I change the chart type of the chart control in ASP.NET 4. I have a drop down list that contains name of all the chart types.
This is the code I came up with :
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Chart2.Series["Series1"].ChartType = (SeriesChartType)
Enum.Parse(typeof(SeriesChartType),D开发者_如何学CropDownList1.SelectedValue);
}
You might have to call DataBind() on the chart to get it to rerender.
(If that's the problem).
Here is a sample but not using asp.net chart control, instead fusion charts.
http://liberofusioncharts.codeplex.com/wikipage?title=AJAX%20sample&referringTitle=Documentation
精彩评论