Completed
Last Updated: 28 Jan 2015 16:21 by ADMIN
ADMIN
George
Created on: 30 Apr 2014 13:02
Category: ChartView
Type: Bug Report
0
FIX. RadChartView - Changing the view using DrillDownController and re-adding series will will not update the legend
To reproduce:


You need a RadChartView with some series. You need to add a new View - 


radChartView1.Views.AddNew("Bigger");


You also need to add a DrillDownController:


DrillDownController drillcontrol = new DrillDownController();
radChartView1.Controllers.Add(drillcontrol);
radChartView1.ShowDrillNavigation = true;


On the Drill event of RadChartView you need to reload the chart. This must clear the axes on the current view (determined by the drill level) and add new ones. You will see that the legend will not update. 


Additional details can be found in the attached project.


Workaround:


Re-add the legend items manually:


private void radChartView1_Drill(object sender, DrillEventArgs e)
{
    if (e.Level == 0)
        BiggerView = false;
    else
        BiggerView = true;


    ReloadChart();

    this.radChartView1.ChartElement.LegendElement.StackElement.Children.Clear();
    ChartView currentView = this.radChartView1.Views[BiggerView ? 1 : 0];
    foreach (ChartSeries series in currentView.Series)
    {
        LegendItem item = new LegendItem(series)
        {
            Title = series.Name
        };


        LegendItemElement element = new LegendItemElement(item);
        this.radChartView1.ChartElement.LegendElement.StackElement.Children.Add(element);
    }
}


Attached Files:
0 comments