How to change the chart type of a chart control in ASP.NET 4. I have a drop-down list containing the name of all 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),DropDownList1.SelectedValue); }
source share