private void ChartListBox_SelectedValueChanged(object sender, EventArgs e) { for (int i = 0; i < ChartListBox.Items.Count; i++) { NetworkChart.Series[i].Enabled = ChartListBox.GetItemChecked(i); } // Reset scale based on visible graphs. NetworkChart.ChartAreas["DefaultChartArea"].RecalculateAxesScale(); NetworkChart.ResetAutoValues(); }
private void ChartListBoxItemToggle(bool bCheck) { IPlottable[] Plots = NetworkChart.Plot.GetPlottables(); for (int i = 0; i < ChartListBox.Items.Count; i++) { DefaultSeriesTypes[i].bVisible = (bool)((CheckBox)ChartListBox.Items[i]).IsChecked; Plots[i].IsVisible = DefaultSeriesTypes[i].bVisible; } NetworkChart.Render(); }
private void ChartListBox_SelectedValueChanged(object sender, EventArgs e) { // Save old scroll position double OldPosition = NetworkChart.ChartAreas["DefaultChartArea"].AxisX.ScaleView.Position; for (int i = 0; i < ChartListBox.Items.Count; i++) { NetworkChart.Series[i].Enabled = ChartListBox.GetItemChecked(i); } // Reset scale based on visible graphs. NetworkChart.ChartAreas["DefaultChartArea"].RecalculateAxesScale(); NetworkChart.ResetAutoValues(); // Restore scroll position NetworkChart.ChartAreas["DefaultChartArea"].AxisX.ScaleView.Position = OldPosition; }
/** * Single clicking in the graph will change the summary to be the current frame. */ private void NetworkChart_CursorPositionChanged(object sender, System.Windows.Forms.DataVisualization.Charting.CursorEventArgs e) { CurrentFrame = (int)e.NewPosition; if (CurrentNetworkStream != null && CurrentFrame >= 0 && CurrentFrame < CurrentNetworkStream.Frames.Count) { // Cancel range select so we stop highlighting that on the chart (there will be the red line now showing the single frame selection) RangeSelectStart = -1; RangeSelectEnd = -1; // Force chart repaint NetworkChart.Invalidate(); SetCurrentStreamSelection(CurrentNetworkStream, CurrentNetworkStream.Frames[CurrentFrame].Filter(CurrentFilterValues), true); } }
private void ChartShowLegendCheckBox_Unchecked(object sender, RoutedEventArgs e) { NetworkChart.Plot.Legend(false); NetworkChart.Render(); }
private void ChartShowLegendCheckBox_Checked(object sender, RoutedEventArgs e) { NetworkChart.Plot.Legend(true, ScottPlot.Alignment.UpperLeft); NetworkChart.Render(); }
private void PlotStyleSelector_SelectionChanged(object sender, SelectionChangedEventArgs e) { NetworkChart.Plot.Style((ScottPlot.Style)PlotStyleSelector.SelectedIndex); NetworkChart.Render(); }