private void seriesFilter_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Collection <SeriesInfo> seriesList = new Collection <SeriesInfo>();

            // Build a list of data points
            foreach (Series series in Chart.Series)
            {
                seriesList.Add(new SeriesInfo(series.Name, series.Enabled));
            }

            // Show the form
            using (SeriesFilterForm form = new SeriesFilterForm(seriesList, _substringFilters))
            {
                form.ShowDialog(this);

                // Apply the filter to the graph
                foreach (SeriesInfo info in form.SeriesList)
                {
                    Chart.Series.FindByName(info.Key).Enabled = info.Enabled;
                }

                _substringFilters.Clear();
                foreach (SubstringFilter filter in form.SubstringFilters)
                {
                    _substringFilters.Add(filter);
                }

                UpdateFilterStatus();
            }

            RefreshGraph();
        }
        private void seriesFilter_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Collection <SeriesInfo> seriesList = new Collection <SeriesInfo>();

            // Build a list of data points
            foreach (DataPoint point in Chart.Series[0].Points)
            {
                seriesList.Add(new SeriesInfo(point.AxisLabel));
            }
            foreach (string key in _ignoredKeys)
            {
                seriesList.Add(new SeriesInfo(key, false));
            }

            // Show the form
            using (SeriesFilterForm form = new SeriesFilterForm(seriesList, _substringFilters))
            {
                form.ShowDialog(this);

                // Add the keys that are being ignored to the list
                ClearFilters();

                foreach (SeriesInfo series in form.SeriesList.Where(n => !n.Enabled))
                {
                    _ignoredKeys.Add(series.Key);
                }

                foreach (SubstringFilter filter in form.SubstringFilters)
                {
                    _substringFilters.Add(filter);
                }
            }

            // Refresh the graph to update the displayed series
            UpdateFilterStatus();
        }