Hello,
I want to allow the user to change the series color on a line chart by picking a new color from a RadColorSelector. With this color I have tried several ways to assign it to my series, but even if the debugger shows that the series color attribute changes, the displayed chart is not updated.
This is what I have tried:
I want to allow the user to change the series color on a line chart by picking a new color from a RadColorSelector. With this color I have tried several ways to assign it to my series, but even if the debugger shows that the series color attribute changes, the displayed chart is not updated.
This is what I have tried:
aChart.DefaultView.ChartArea.DataSeries[0].Definition.Appearance.Stroke = new SolidColorBrush(clrSel.SelectedColor); |
aChart.DefaultView.ChartArea.DataSeries[0].Definition.Appearance.Fill = new SolidColorBrush(clrSel.SelectedColor); |
OR
aChart.SeriesMappings[0].SeriesDefinition.Appearance.Stroke = new SolidColorBrush(clrSel.SelectedColor); |
aChart.SeriesMappings[0].SeriesDefinition.Appearance.Fill = new SolidColorBrush(clrSel.SelectedColor); |
Neither updates the chart.
As a comment, if the same user tries to switch on or off ItemLabels, this code works and updates the chart:
aChart.DefaultView.ChartArea.DataSeries[0].Definition.ShowItemLabels = menuItem.IsChecked; |
this one doesn't:
aChart.SeriesMappings[0].SeriesDefinition.ShowItemLabels = menuItem.IsChecked; |
Can anybody explain?
How do I change a series color after the chart is displayed?
Anne