This question is locked. New answers and comments are not allowed.
I create a bunch of lines in a chart and then set them all but the first to invisible like this:
Visibility of these lines is controlled via checkboxes in a databound listbox in a radexpander and the lines are shown and hidden like this and this works great.
Things go bad when scroll and zoom get involved ... Zooming or unzooming a section of the chart enables visibility of all the lines which throws all of the checkboxes out of sync...
Ideas ?
// set invisible to start with
for (int i=1 ; i < Chart.DefaultView.ChartArea.DataSeries.Count() ; i++)
Chart.DefaultView.ChartArea.DataSeries[i].Definition.Visibility = SeriesVisibility.Hidden;
Visibility of these lines is controlled via checkboxes in a databound listbox in a radexpander and the lines are shown and hidden like this and this works great.
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
CheckBox cb = sender as CheckBox;
string t = cb.Content.ToString();
for (int i = 1; i < Chart.DefaultView.ChartArea.DataSeries.Count(); i++)
if (Chart.DefaultView.ChartArea.DataSeries[i].LegendLabel == t)
{
if (cb.IsChecked == false)
Chart.DefaultView.ChartArea.DataSeries[i].Definition.Visibility = SeriesVisibility.Hidden;
else
Chart.DefaultView.ChartArea.DataSeries[i].Definition.Visibility = SeriesVisibility.Visible;
break;
}
}
Things go bad when scroll and zoom get involved ... Zooming or unzooming a section of the chart enables visibility of all the lines which throws all of the checkboxes out of sync...
Ideas ?