void histogramChild_Click(object sender, EventArgs e)
        {
            SpreadSheetLayer layer = (SpreadSheetLayer)layerTree.SelectedNode.Tag;

            ToolStripMenuItem item = sender as ToolStripMenuItem;

            FilterGraphTool fgt = new FilterGraphTool((SpreadSheetLayer)layerTree.SelectedNode.Tag);
            fgt.ChartType = ChartTypes.Histogram;
            fgt.StatType = StatTypes.Count;
            Earth3d.MainWindow.UiController = fgt;

            int col = 0;
            foreach (string headerName in layer.Header)
            {
                if (headerName == item.Text)
                {
                    fgt.TargetColumn = col;
                    break;
                }
                col++;
            }
            ConnectLayerUi(layer);
            layer.AddFilter(fgt);
        }
        void dateFilterChild_Click(object sender, EventArgs e)
        {
            var layer = (SpreadSheetLayer)layerTree.SelectedNode.Tag;

            var item = sender as ToolStripMenuItem;

            var fgt = new FilterGraphTool((SpreadSheetLayer)layerTree.SelectedNode.Tag);
            fgt.ChartType = ChartTypes.TimeChart;
            fgt.StatType = StatTypes.Count;
            Earth3d.MainWindow.UiController = fgt;

            var col = 0;
            foreach (var headerName in layer.Header)
            {
                if (headerName == targetItemText)
                {
                    fgt.TargetColumn = col;
                    break;
                }
                col++;
            }

            fgt.DateFilter = (DateFilter)Enum.Parse(typeof(DateFilter), item.Text);
            ConnectLayerUi(layer);
            layer.AddFilter(fgt);
        }
        void denominatorMenu_Click(object sender, EventArgs e)
        {
            SpreadSheetLayer layer = (SpreadSheetLayer)layerTree.SelectedNode.Tag;

            ToolStripMenuItem item = sender as ToolStripMenuItem;

            FilterGraphTool fgt = new FilterGraphTool((SpreadSheetLayer)layerTree.SelectedNode.Tag);
            fgt.StatType = (StatTypes)Enum.Parse(typeof(StatTypes), statTypeText);
            fgt.ChartType = ChartTypes.BarChart;
            Earth3d.MainWindow.UiController = fgt;

            fgt.DomainColumn = layer.NameColumn;
            int col = 0;
            foreach (string headerName in layer.Header)
            {
                if (headerName == targetItemText)
                {
                    fgt.TargetColumn = col;
                    break;
                }
                col++;
            }

            col = 0;
            foreach (string headerName in layer.Header)
            {
                if (headerName == item.Text)
                {
                    fgt.DenominatorColumn = col;
                    break;
                }
                col++;
            }
            ConnectLayerUi(layer);
            layer.AddFilter(fgt);
        }
 public void AddFilter(FilterGraphTool fgt )
 {
     fgt.ComputeChart();
     Filters.Add(fgt);
     primaryUI.UpdateNodes();
 }