private void GraphViewDataCallbackFn(ChartViewData[] data) {
     this.flowLayoutPanel.Controls.Clear();
     this.expandedGraphTab.Controls.Clear();
     this.loadGraphData(data);
     this.resultsTabControl.SelectTab(SMALLGRAPHPANEL);
 }
        private void okButton_Click(object sender, EventArgs e) {

            ChartViewData[] data = new ChartViewData[this.getNumberToDisplay()];
            GraphSetupTabPage page = null;
            for (int i = 0; i < data.Length; i++) {
                page = (GraphSetupTabPage)((TabPage)this.graphPanel.Controls[i]).Controls[0];
                data[i] = page.getGraphingData();
            }

            ChartForm form = new ChartForm();
            form.loadGraphData(data[0]);
            form.Show();

            //for (int i = 0; i < this.tabCount; i++) {
            //    page = (GraphSetupTabPage)((TabPage)this.graphPanel.Controls[i]).Controls[0];
            //    data = page.getGraphingData();
            //    if (page.isDisplayed() && data2 != null)
            //        graphData.Add(data2);
            //    else
            //        continue;
            //}

            //if (graphData.Count == 0)
            //    return;
            //TO DO: do the actual graphing
        }
        private void loadGraphData(ChartViewData[] data) {

            int width = (this.flowLayoutPanel.Size.Width / 2) - 20;
            int height = (3 * width) / 4;

            ChartView view = null;
            for (int i = 0; i < data.Length; i++) {
                view = new ChartView();
                try {
                    view.Title = data[i].Title;
                    view.XAxisLabel = data[i].XAxisLabel;
                    view.XAxisValues = data[i].XValues;
                    view.YAxisLabel = data[i].YAxisLabel;
                    view.YAxisDataDict = data[i].YValues;
                }
                catch (NullReferenceException) {
                    continue;
                }
                view.Size = new Size(width, height);
                view.MouseClick += new System.Windows.Forms.MouseEventHandler(this.smallGraph_MouseClick);
                view.MouseEnter += new System.EventHandler(this.view_MouseEnter);
                view.MouseLeave += new System.EventHandler(this.view_MouseLeave);

                view.drawGraph(false);
                this.flowLayoutPanel.Controls.Add(view);

            }
        }
        private void okButton_Click(object sender, EventArgs e) {

            ChartViewData[] data = new ChartViewData[this.getNumberToDisplay()];
            GraphSetupTabPage page = null;
            for (int i = 0; i < data.Length; i++) {
                page = (GraphSetupTabPage)((TabPage)this.graphPanel.Controls[i]).Controls[0];
                try {
                    data[i] = page.getGraphingData();

                }
                catch (FormatException ex) {
                    logger.Warn(ex.Message);
                    this.graphPanel.SelectTab(i);
                    MessageBox.Show(this, ex.Message, "Assessment Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }

            GraphViewDataCallback(data);
            this.Close();
        }