public override void Initialize()
        {
            base.Initialize();

            m_Chart = nChartControl1.Charts[0];
            m_Chart.Axis(StandardAxis.Depth).Visible = false;

            m_Bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar);
            m_Bar.Values.FillRandom(Random, 10);
            m_Bar.Legend.Mode = SeriesLegendMode.None;

            m_Subset.AddRange(0, 9);
            Subset.Text = m_Subset.ToString();
            FunctionCombo.SelectedIndex = 0;

            ApplyColorToSubset();

            // add a label
            NLabel title = nChartControl1.Labels.AddHeader("Evaluating data");

            title.TextStyle.FontStyle         = new NFontStyle("Times New Roman", 20, FontStyle.Italic);
            title.TextStyle.FillStyle         = new NColorFillStyle(Color.MidnightBlue);
            title.TextStyle.ShadowStyle.Type  = ShadowType.Solid;
            title.TextStyle.ShadowStyle.Color = Color.White;
            title.ContentAlignment            = ContentAlignment.BottomCenter;
            title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));
        }
        private void ResetFilter()
        {
            m_SubsetAll.Clear();
            m_SubsetFilter.Clear();

            if (m_Bar.Values.Count > 0)
            {
                m_SubsetAll.AddRange(0, m_Bar.Values.Count - 1);
                m_SubsetFilter.AddRange(0, m_Bar.Values.Count - 1);
            }

            OperationList.Items.Clear();
            OperationList.Items.Add("f = all");
            CurrentFilter.Text = m_SubsetFilter.ToString();

            ApplyColorToSubset(m_SubsetFilter, Color.Red);
        }
        private void ApplyFilter_Click(object sender, System.EventArgs e)
        {
            double dValue;
            string sFilter    = "";
            string sOperation = "";

            // make all colors blue
            ApplyColorToSubset(m_SubsetAll, Color.Blue);

            try
            {
                dValue = Double.Parse(Value.Text);
            }
            catch
            {
                return;
            }

            Nevron.Chart.CompareMethod compareMethod = (Nevron.Chart.CompareMethod)compareMethodCombo.SelectedIndex;

            NDataSeriesSubset subset = m_Bar.Values.Filter(compareMethod, dValue);

            switch (compareMethodCombo.SelectedIndex)
            {
            case 0:
                sFilter = "(> " + dValue.ToString() + ")";
                break;

            case 1:
                sFilter = "(< " + dValue.ToString() + ")";
                break;

            case 2:
                sFilter = "(==" + dValue.ToString() + ")";
                break;

            case 3:
                sFilter = "(>=" + dValue.ToString() + ")";
                break;

            case 4:
                sFilter = "(<=" + dValue.ToString() + ")";
                break;

            case 5:
                sFilter = "(!=" + dValue.ToString() + ")";
                break;
            }

            switch (subsetOperationCombo.SelectedIndex)
            {
            case 0:                     // replace
                m_SubsetFilter = subset;
                OperationList.Items.Clear();
                sOperation = "f = ";
                break;

            case 1:                     // combine
                m_SubsetFilter.Combine(subset);
                sOperation = "f = f combine ";
                break;

            case 2:                     // intersect
                m_SubsetFilter.Intersect(subset);
                sOperation = "f = f intersect ";
                break;

            case 3:                     // subtract
                m_SubsetFilter.Subtract(subset);
                sOperation = "f = f subtract ";
                break;
            }

            OperationList.Items.Add(sOperation + sFilter);
            CurrentFilter.Text = m_SubsetFilter.ToString();

            // apply red color only on the bars in the filter subset
            ApplyColorToSubset(m_SubsetFilter, Color.Red);

            nChartControl1.Refresh();
        }