private void SetUpChart()
        {
            //try
            {
                scatterplot.Title = DataSetTitle;
                //use a higher than normal height since page's title is long, Y-Axis Labels are long, and scatterplot benefits in readbility
                scatterplot.Height = ((int)scatterplot.Height.Value) + 100;

                #region X-Axis settings

                Rel    relatedTo        = GlobalValues.Rel;
                string xValueColumnName = string.Empty;
                int    xMin             = 0;
                int    xMax             = 100;
                int    xStep            = 10;
                string axisXDescription = string.Empty;
                int    maxValueInResult = 0;

                xValueColumnName = GetGraphXAxisColumn();

                if (relatedTo.CompareToKey(RelKeys.DistrictSize) ||
                    relatedTo.CompareToKey(RelKeys.DistrictSpending))
                {
                    foreach (DataRow row in DataSet.Tables[0].Rows)
                    {
                        try
                        {
                            if (maxValueInResult < (int)Convert.ToDouble(row[xValueColumnName].ToString().Trim()))
                            {
                                maxValueInResult = (int)Convert.ToDouble(row[xValueColumnName].ToString().Trim());
                            }
                        }
                        catch
                        {
                            continue;
                        }
                    }
                }


                if (relatedTo.CompareToKey(RelKeys.DistrictSpending))
                {
                    axisXDescription = "District Current Education Cost Per Member";
                    xMax             = maxValueInResult + 1;
                    xStep            = 2000;
                    scatterplot.AxisX.LabelsFormat.Format = ChartFX.WebForms.AxisFormat.Currency;
                }
                else if (relatedTo.CompareToKey(RelKeys.DistrictSize))
                {
                    axisXDescription = "District Size -- Number of Students Enrolled";
                    xMax             = maxValueInResult + 1;
                    xStep            = 10000;
                    scatterplot.AxisX.LabelsFormat.Format = ChartFX.WebForms.AxisFormat.Number;
                }
                else if (relatedTo.CompareToKey(RelKeys.EconDisadvantaged))
                {
                    axisXDescription = relatedTo.Key + " FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                else if (relatedTo.CompareToKey(RelKeys.LEP))
                {
                    axisXDescription = relatedTo.Key + " FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                else if (relatedTo.CompareToKey(RelKeys.Disabilities))
                {
                    axisXDescription = relatedTo.Key + " FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                else if (relatedTo.CompareToKey(RelKeys.Native))
                {
                    axisXDescription = relatedTo.Key + " FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                else if (relatedTo.CompareToKey(RelKeys.Asian))
                {
                    axisXDescription = relatedTo.Key + " FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                else if (relatedTo.CompareToKey(RelKeys.Black))
                {
                    axisXDescription = relatedTo.Key + " FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                else if (relatedTo.CompareToKey(RelKeys.Hispanic))
                {
                    axisXDescription = relatedTo.Key + " FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                else if (relatedTo.CompareToKey(RelKeys.White))
                {
                    axisXDescription = relatedTo.Key + "(Not of Hispanic Origin) FAY";
                    scatterplot.AxisX.LabelsFormat.CustomFormat = "0" + "\\%";
                }
                scatterplot.XValueColumnName = xValueColumnName;
                scatterplot.AxisXMin         = xMin;
                scatterplot.AxisXMax         = xMax;
                scatterplot.AxisXStep        = xStep;
                scatterplot.AxisXDescription = axisXDescription;
                #endregion

                #region Y-Axis settings

                string yValueColumnName = string.Empty;
                yValueColumnName = GetGraphYAxisColumn();

                scatterplot.YValueColumnName = yValueColumnName;
                scatterplot.AxisYMin         = 0;
                scatterplot.AxisYMax         = 100;
                scatterplot.AxisYStep        = 10;
                scatterplot.AxisYDescription = GetYAxisDescription();
                scatterplot.AxisY.LabelsFormat.CustomFormat = "0" + "\\%";

                #endregion

                ArrayList friendlySeriesName = new ArrayList();
                if (GlobalValues.OrgLevel.Key == OrgLevelKeys.School)
                {
                    friendlySeriesName.Add("Current School");
                    friendlySeriesName.Add("Other Schools");
                }
                else
                {
                    friendlySeriesName.Add("Current District");

                    friendlySeriesName.Add("Other Districts");
                }

                if (GlobalValues.Group2.Key == Group2Keys.None)
                {
                    scatterplot.FriendlySeriesName = friendlySeriesName;
                }
                else
                {
                    scatterplot.FriendlySeriesName = GetGraphSeriesLabels();
                }

                //only stratify series when:
                if (GlobalValues.Group2.Key != Group2Keys.None)
                {
                    scatterplot.SeriesByStrata = GetSeriesStrata();
                }

                scatterplot.SeriesColumnName = GetSeriesColumnName();
            }

            /*catch (Exception ex)
             * {
             *  System.Diagnostics.Debug.WriteLine(ex.Message);
             * }*/

            ChartFX.WebForms.TitleDockable title = new ChartFX.WebForms.TitleDockable(GetLegendTitleText());
            scatterplot.LegendBox.Titles.Add(title);
        }