Changing chart types runtime

Thread is closed for posting
2 posts, 0 answers
  1. Debashis Pyne
    Debashis Pyne avatar
    66 posts
    Member since:
    Apr 2010

    Posted 28 Aug 2010 Link to this post


    I have a drop down control which lists 4 of the chart types (Area, Pie, Line and Bar).

    My default chart type is Pie.
    I would like to change the chart type dynamically during run time based on the selection in the drop down.

    The folllowing the code I have used:

    protected void DdlChartType_SelectedIndexChanged(object sender, EventArgs e)

    TextBox1.Text = DdlChartType.SelectedValue.ToString();
    if (DdlChartType.SelectedValue == "ChartSeriesType.Area")
    chartSeries.Type = ChartSeriesType.Area;
    else if (DdlChartType.SelectedValue == "ChartSeriesType.Pie")
    chartSeries.Type = ChartSeriesType.Pie;

    protected void Chart1()
    radChart.ChartTitle.TextBlock.Text = "My RadChart";
    chartSeries.Name = "Sales";
    chartSeries.AddItem(120, "Internet");
    chartSeries.AddItem(140, "Retail");
    chartSeries.AddItem(35, "Wholesale");

    The problem is I am always getting the same chart type and it does not change.
    is it beacuse if cache?
    Any ideas?

  2. Yavor
    Yavor avatar
    11 posts

    Posted 01 Sep 2010 Link to this post

    Hello Debashis,

    Attached to this message, is a small application, which handles a functionality close to the one which you mentioned. I hope it gets you started properly.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top