private void LvLines_SelectionChanged(object sender, SelectionChangedEventArgs e) { AssetsChart.clearChart(); for (int i = 0; i < graphNames.Count; i++) { if (lvLines.SelectedItems.Contains(graphNames[i])) { AssetsChart.addChartToSeriesColllection(selectedSeries[i]); } } }
private void Rb_Click(object sender, RoutedEventArgs e) { graphNames.Clear(); AssetsChart.clearChart(); if (rbOpen.IsChecked == true) { selectedSeries = openSeries; } else if (rbHigh.IsChecked == true) { selectedSeries = highSeries; } else if (rbLow.IsChecked == true) { selectedSeries = lowSeries; } else if (rbClose.IsChecked == true) { selectedSeries = closeSeries; } else if (rbVolume.IsChecked == true) { selectedSeries = volumeSeries; } Random rnd = new Random(); for (int i = 0; i < selectedSeries.Count; i++) { selectedSeries[i].Stroke = new SolidColorBrush(Color.FromRgb((byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255), (byte)rnd.Next(0, 255))); selectedSeries[i].Fill = Brushes.Transparent; } foreach (LineSeries line in selectedSeries) { graphNames.Add(line.Title); } lvLines.Items.Refresh(); for (int i = 0; i < graphNames.Count; i++) { if (lvLines.SelectedItems.Contains(graphNames[i])) { AssetsChart.addChartToSeriesColllection(selectedSeries[i]); } } }