private void UpdateGuidelines()
        {
            if (nChartControl1 == null)
            {
                return;
            }

            nChartControl1.Document.RootPanel.Guidelines.Clear();

            if (AlignLeftSidesCheckBox.Checked)
            {
                NSideGuideline leftSideGuideline = new NSideGuideline(PanelSide.Left);

                leftSideGuideline.Targets.Add(m_StockChart);
                leftSideGuideline.Targets.Add(m_VolumeChart);
                leftSideGuideline.Targets.Add(m_IndicatorChart);

                nChartControl1.Document.RootPanel.Guidelines.Add(leftSideGuideline);
            }

            if (AlignRightSidesCheckBox.Checked)
            {
                NSideGuideline rightSideGuideline = new NSideGuideline(PanelSide.Right);

                rightSideGuideline.Targets.Add(m_StockChart);
                rightSideGuideline.Targets.Add(m_VolumeChart);
                rightSideGuideline.Targets.Add(m_IndicatorChart);

                nChartControl1.Document.RootPanel.Guidelines.Add(rightSideGuideline);
            }

            nChartControl1.Refresh();
        }
Example #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel title = new NLabel("Data Distribution");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
            title.ContentAlignment           = ContentAlignment.BottomCenter;
            title.Margins  = new NMarginsL(5, 5, 5, 5);
            title.DockMode = PanelDockMode.Top;
            title.Location = new NPointL(
                new NLength(50, NRelativeUnit.ParentPercentage),
                new NLength(2, NRelativeUnit.ParentPercentage));

            // no legend
            nChartControl1.Legends.Clear();

            // create box and whiskers chart
            NChart boxChart = new NCartesianChart();

            boxChart.Margins    = new NMarginsL(5, 0, 5, 5);
            boxChart.BoundsMode = BoundsMode.Stretch;
            boxChart.DockMode   = PanelDockMode.Right;
            boxChart.Size       = new NSizeL(new NLength(20, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));

            // create point chart
            NChart pointChart = new NCartesianChart();

            pointChart.Margins    = new NMarginsL(5, 0, 0, 5);
            pointChart.BoundsMode = BoundsMode.Stretch;
            pointChart.DockMode   = PanelDockMode.Fill;

            // create a guide line to align the chart bottoms
            NSideGuideline bottomChartGuideline = new NSideGuideline(PanelSide.Bottom);

            nChartControl1.Document.RootPanel.Guidelines.Add(bottomChartGuideline);
            bottomChartGuideline.Targets.Add(pointChart);
            bottomChartGuideline.Targets.Add(boxChart);

            // arrange panels
            nChartControl1.Panels.Add(title);
            nChartControl1.Panels.Add(boxChart);
            nChartControl1.Panels.Add(pointChart);

            SetupCharts(pointChart, boxChart);

            bool showAverage  = ShowAverageCheckBox.Checked;
            bool showOutliers = ShowOutliersCheckBox.Checked;

            NPointSeries          pointSeries = (NPointSeries)pointChart.Series[0];
            NBoxAndWhiskersSeries boxSeries   = (NBoxAndWhiskersSeries)boxChart.Series[0];

            NBoxAndWhiskersDataPoint bwdp = new NBoxAndWhiskersDataPoint(pointSeries.Values, showAverage, showOutliers);

            boxSeries.ClearDataPoints();
            boxSeries.AddDataPoint(bwdp);
        }
Example #3
0
        public override void Initialize()
        {
            base.Initialize();

            // disable the legend
            nChartControl1.Legends[0].Mode = LegendMode.Disabled;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Axis Scroll Tool");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

            // configure stock and volume charts
            ConfigureStockValuesChart();
            ConfigureStockVolumesChart();

            // Configure axes
            ConfigureAxes();

            // configure cursors
            ConfigureAxisCursors();

            // configure range selections
            ConfigureRangeSelections();

            // add a guide line on the left
            NSideGuideline guideLine = new NSideGuideline(PanelSide.Left);

            guideLine.Targets.Add(m_ChartStockValues);
            guideLine.Targets.Add(m_ChartStockVolumes);

            nChartControl1.Document.RootPanel.Guidelines.Add(guideLine);

            // configure interactivity
            m_DataZoomTool = new NDataZoomTool();
            m_DataZoomTool.AlwaysZoomIn = false;

            m_AxisScrollTool = new NAxisScrollTool();

            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NDataCursorTool());
            nChartControl1.Controller.Tools.Add(m_AxisScrollTool);
            nChartControl1.Controller.Tools.Add(m_DataZoomTool);

            PagingViewResetModeComboBox.FillFromEnum(typeof(PagingViewResetMode));
            PagingViewResetModeComboBox.SelectedIndex = 0;
        }
Example #4
0
        public override void Initialize()
        {
            base.Initialize();

            nChartControl1.Panels.Clear();

            // create a guide line to align the chart bottoms
            NSideGuideline bottomChartGuideline = new NSideGuideline(PanelSide.Bottom);

            nChartControl1.Document.RootPanel.Guidelines.Add(bottomChartGuideline);

            // top panel
            NDockPanel topPanel = new NDockPanel();

            topPanel.DockMode = PanelDockMode.Top;
            topPanel.Size     = new NSizeL(new NLength(0), new NLength(20, NRelativeUnit.ParentPercentage));

            // bottom panel
            NDockPanel bottomPanel = new NDockPanel();

            bottomPanel.DockMode = PanelDockMode.Bottom;
            bottomPanel.Size     = new NSizeL(new NLength(0), new NLength(20, NRelativeUnit.ParentPercentage));

            // center panel
            NDockPanel centerPanel = new NDockPanel();

            centerPanel.DockMode = PanelDockMode.Fill;

            // left panel
            NDockPanel leftPanel = new NDockPanel();

            leftPanel.DockMode = PanelDockMode.Left;
            leftPanel.Size     = new NSizeL(new NLength(40.0f, NGraphicsUnit.Point), new NLength(0));

            // right panel
            NDockPanel rightPanel = new NDockPanel();

            rightPanel.DockMode = PanelDockMode.Right;
            rightPanel.Size     = new NSizeL(new NLength(40.0f, NGraphicsUnit.Point), new NLength(0));

            // middle panel
            NDockPanel middlePanel = new NDockPanel();

            middlePanel.DockMode = PanelDockMode.Right;
            middlePanel.Size     = new NSizeL(new NLength(10.0f, NGraphicsUnit.Point), new NLength(0));

            // right chart panel
            NDockPanel rightChartPanel = new NDockPanel();

            rightChartPanel.Size     = new NSizeL(new NLength(10.0f, NRelativeUnit.ParentPercentage), new NLength(0));
            rightChartPanel.DockMode = PanelDockMode.Right;

            // left chart panel
            NDockPanel leftChartPanel = new NDockPanel();

            leftChartPanel.Size     = new NSizeL(new NLength(10.0f, NRelativeUnit.ParentPercentage), new NLength(0));
            leftChartPanel.DockMode = PanelDockMode.Fill;

            // chart title
            NLabel title = new NLabel("Data Distribution");

            title.TextStyle.FontStyle         = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle         = new NColorFillStyle(GreyBlue);
            title.TextStyle.ShadowStyle.Type  = ShadowType.Solid;
            title.TextStyle.ShadowStyle.Color = Color.White;
            title.DockMode = PanelDockMode.Top;
            title.Padding  = new NMarginsL(5, 8, 5, 4);

            // create point chart
            NChart pointChart = new NCartesianChart();

            pointChart.BoundsMode = BoundsMode.Stretch;
            pointChart.DockMode   = PanelDockMode.Fill;
            bottomChartGuideline.Targets.Add(pointChart);

            // create box and whiskers chart
            NChart boxChart = new NCartesianChart();

            boxChart.BoundsMode = BoundsMode.Stretch;
            boxChart.DockMode   = PanelDockMode.Fill;
            bottomChartGuideline.Targets.Add(boxChart);

            // arrange panels
            nChartControl1.Panels.Add(topPanel);
            nChartControl1.Panels.Add(bottomPanel);
            nChartControl1.Panels.Add(centerPanel);

            centerPanel.ChildPanels.Add(rightPanel);
            centerPanel.ChildPanels.Add(rightChartPanel);
            centerPanel.ChildPanels.Add(middlePanel);
            centerPanel.ChildPanels.Add(leftPanel);
            centerPanel.ChildPanels.Add(leftChartPanel);

            topPanel.ChildPanels.Add(title);
            leftChartPanel.ChildPanels.Add(pointChart);
            rightChartPanel.ChildPanels.Add(boxChart);

            SetupCharts(pointChart, boxChart);

            ShowAverageCheck.Checked  = true;
            ShowOutliersCheck.Checked = true;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                WebExamplesUtilities.FillComboWithValues(PeriodDropDownList, 0, 100, 10);
                PeriodDropDownList.SelectedIndex = 2;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            NFunctionCalculator calc = new NFunctionCalculator();

            nChartControl1.Settings.ShapeRenderingMode = ShapeRenderingMode.None;

            NChart chart = nChartControl1.Charts[0];

            chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            chart.BoundsMode = BoundsMode.Stretch;
            chart.Location   = new NPointL(
                new NLength(5, NRelativeUnit.ParentPercentage),
                new NLength(20, NRelativeUnit.ParentPercentage));
            chart.Size = new NSizeL(
                new NLength(90, NRelativeUnit.ParentPercentage),
                new NLength(75, NRelativeUnit.ParentPercentage));

            NLegend legend = nChartControl1.Legends[0];

            legend.Data.ExpandMode = LegendExpandMode.ColsOnly;
            legend.Location        = new NPointL(
                new NLength(98, NRelativeUnit.ParentPercentage),
                new NLength(12, NRelativeUnit.ParentPercentage));

            // align the chart and the legend
            NSideGuideline guideline = new NSideGuideline(PanelSide.Right);

            guideline.Targets.Add(legend);
            guideline.Targets.Add(chart);
            nChartControl1.Document.RootPanel.Guidelines.Add(guideline);

            // setup X axis
            NValueTimelineScaleConfigurator scaleX = new NValueTimelineScaleConfigurator();

            scaleX.FirstRow.GridStyle.ShowAtWalls   = new ChartWallType[] { ChartWallType.Back };
            scaleX.FirstRow.GridStyle.LineStyle     = new NStrokeStyle(1, Color.FromArgb(225, 225, 225));
            scaleX.FirstRow.UseGridStyle            = true;
            scaleX.FirstRow.InnerTickStyle.Visible  = false;
            scaleX.SecondRow.GridStyle.ShowAtWalls  = new ChartWallType[] { ChartWallType.Back };
            scaleX.SecondRow.GridStyle.LineStyle    = new NStrokeStyle(1, Color.FromArgb(215, 215, 215));
            scaleX.SecondRow.UseGridStyle           = true;
            scaleX.SecondRow.InnerTickStyle.Visible = false;
            scaleX.ThirdRow.GridStyle.ShowAtWalls   = new ChartWallType[] { ChartWallType.Back };
            scaleX.ThirdRow.GridStyle.LineStyle     = new NStrokeStyle(1, Color.FromArgb(205, 205, 205));
            scaleX.ThirdRow.UseGridStyle            = true;
            scaleX.ThirdRow.InnerTickStyle.Visible  = false;
            // calendar
            NWeekDayRule wdr = new NWeekDayRule(WeekDayBit.All);

            wdr.Saturday = false;
            wdr.Sunday   = false;
            scaleX.Calendar.Rules.Add(wdr);
            scaleX.EnableCalendar = true;
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX;

            // setup primary Y axis
            NAxis axisY1 = chart.Axis(StandardAxis.PrimaryY);

            axisY1.Anchor = new NDockAxisAnchor(AxisDockZone.FrontLeft, false, 45, 100);

            NLinearScaleConfigurator scaleY1 = (NLinearScaleConfigurator)axisY1.ScaleConfigurator;

            scaleY1.RulerStyle.Height                   = new NLength(2, NGraphicsUnit.Pixel);
            scaleY1.MajorGridStyle.ShowAtWalls          = new ChartWallType[] { ChartWallType.Back };
            scaleY1.InnerMajorTickStyle.LineStyle.Width = new NLength(0);

            // setup secondary Y axis
            NAxis axisY2 = chart.Axis(StandardAxis.SecondaryY);

            axisY2.Visible = true;
            axisY2.Anchor  = new NDockAxisAnchor(AxisDockZone.FrontLeft, false, 0, 40);

            NLinearScaleConfigurator scaleY2 = (NLinearScaleConfigurator)axisY2.ScaleConfigurator;

            scaleY2.RulerStyle.Height                   = new NLength(2, NGraphicsUnit.Pixel);
            scaleY2.MajorGridStyle.ShowAtWalls          = new ChartWallType[] { ChartWallType.Back };
            scaleY2.InnerMajorTickStyle.LineStyle.Width = new NLength(0);

            Color color1 = Color.FromArgb(100, 100, 150);
            Color color2 = Color.FromArgb(200, 120, 120);
            Color color3 = Color.FromArgb(100, 150, 100);

            // setup the stock series
            NStockSeries stock = (NStockSeries)chart.Series.Add(SeriesType.Stock);

            stock.DataLabelStyle.Visible = false;
            stock.CandleStyle            = CandleStyle.Stick;
            stock.UpStrokeStyle.Color    = color1;
            stock.DownStrokeStyle.Color  = color2;
            stock.Legend.Mode            = SeriesLegendMode.None;
            stock.CandleWidth            = new NLength(0.5f, NRelativeUnit.ParentPercentage);
            stock.UseXValues             = true;
            stock.InflateMargins         = true;

            // Add line series for ADX
            NLineSeries lineADX = (NLineSeries)chart.Series.Add(SeriesType.Line);

            lineADX.DisplayOnAxis(StandardAxis.PrimaryY, false);
            lineADX.DisplayOnAxis(StandardAxis.SecondaryY, true);
            lineADX.BorderStyle.Color = Color.LimeGreen;
            lineADX.Name = "ADX";
            lineADX.DataLabelStyle.Visible = false;

            // Add line series for +DI
            NLineSeries lineDIPos = (NLineSeries)chart.Series.Add(SeriesType.Line);

            lineDIPos.MultiLineMode = MultiLineMode.Overlapped;
            lineDIPos.DisplayOnAxis(StandardAxis.PrimaryY, false);
            lineDIPos.DisplayOnAxis(StandardAxis.SecondaryY, true);
            lineDIPos.BorderStyle.Color = Color.Red;
            lineDIPos.Name = "+DI";
            lineDIPos.DataLabelStyle.Visible = false;

            // Add line series for -DI
            NLineSeries lineDINeg = (NLineSeries)chart.Series.Add(SeriesType.Line);

            lineDINeg.MultiLineMode = MultiLineMode.Overlapped;
            lineDINeg.DisplayOnAxis(StandardAxis.PrimaryY, false);
            lineDINeg.DisplayOnAxis(StandardAxis.SecondaryY, true);
            lineDINeg.BorderStyle.Color = Color.Blue;
            lineDINeg.Name = "-DI";
            lineDINeg.DataLabelStyle.Visible = false;

            // add arguments for function calculator
            stock.CloseValues.Name = "close";
            stock.HighValues.Name  = "high";
            stock.LowValues.Name   = "low";
            calc.Arguments.Add(stock.CloseValues);
            calc.Arguments.Add(stock.HighValues);
            calc.Arguments.Add(stock.LowValues);

            // form controls
            lineDIPos.Visible = ShowPosDICheckBox.Checked;
            lineDINeg.Visible = ShowNegDICheckBox.Checked;
            lineADX.Visible   = ShowADXCheckBox.Checked;

            // add header
            NLabel header = nChartControl1.Labels.AddHeader("Directional Movement");

            header.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
            header.ContentAlignment           = ContentAlignment.BottomRight;
            header.Location = new NPointL(
                new NLength(2, NRelativeUnit.ParentPercentage),
                new NLength(2, NRelativeUnit.ParentPercentage));

            GenerateData(stock);

            UpdateFunctions(stock, lineDIPos, lineDINeg, lineADX, calc);
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            nFunction = new NFunctionCalculator();

            if (!IsPostBack)
            {
                FunctionDropDownList.Items.Add("Simple Moving Average");
                FunctionDropDownList.Items.Add("Weighted Moving Average");
                FunctionDropDownList.Items.Add("Exponential Moving Average");
                FunctionDropDownList.Items.Add("Modified Moving Average");
                FunctionDropDownList.SelectedIndex = 0;

                // form controls
                ApplyFunctionToDropDownList.Items.Add("Open");
                ApplyFunctionToDropDownList.Items.Add("High");
                ApplyFunctionToDropDownList.Items.Add("Low");
                ApplyFunctionToDropDownList.Items.Add("Close");
                ApplyFunctionToDropDownList.SelectedIndex = 3;

                WebExamplesUtilities.FillComboWithFloatValues(PeriodDropDownList, 0, 50, 1);
                PeriodDropDownList.SelectedIndex = 10;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // add header
            NLabel header = nChartControl1.Labels.AddHeader("Moving Averages");

            header.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
            header.ContentAlignment           = ContentAlignment.BottomRight;
            header.Location = new NPointL(
                new NLength(2, NRelativeUnit.ParentPercentage),
                new NLength(2, NRelativeUnit.ParentPercentage));

            NLegend legend = nChartControl1.Legends[0];

            legend.Location = new NPointL(
                new NLength(98, NRelativeUnit.ParentPercentage),
                new NLength(12, NRelativeUnit.ParentPercentage));

            NChart chart = nChartControl1.Charts[0];

            chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            chart.LightModel.EnableLighting         = false;
            chart.Axis(StandardAxis.Depth).Visible  = false;
            chart.Wall(ChartWallType.Floor).Visible = false;
            chart.Wall(ChartWallType.Left).Visible  = false;
            chart.BoundsMode = BoundsMode.Stretch;
            chart.Location   = new NPointL(
                new NLength(5, NRelativeUnit.ParentPercentage),
                new NLength(20, NRelativeUnit.ParentPercentage));
            chart.Size = new NSizeL(
                new NLength(90, NRelativeUnit.ParentPercentage),
                new NLength(75, NRelativeUnit.ParentPercentage));

            // align the chart and the legend
            NSideGuideline guideline = new NSideGuideline(PanelSide.Right);

            guideline.Targets.Add(legend);
            guideline.Targets.Add(chart);
            nChartControl1.Document.RootPanel.Guidelines.Add(guideline);

            // setup X axis
            NRangeTimelineScaleConfigurator scaleX = new NRangeTimelineScaleConfigurator();

            scaleX.FirstRow.GridStyle.ShowAtWalls  = new ChartWallType[] { ChartWallType.Back };
            scaleX.FirstRow.GridStyle.LineStyle    = new NStrokeStyle(1, Color.FromArgb(225, 225, 225));
            scaleX.FirstRow.UseGridStyle           = true;
            scaleX.SecondRow.GridStyle.ShowAtWalls = new ChartWallType[] { ChartWallType.Back };
            scaleX.SecondRow.GridStyle.LineStyle   = new NStrokeStyle(1, Color.FromArgb(215, 215, 215));
            scaleX.SecondRow.UseGridStyle          = true;
            scaleX.ThirdRow.GridStyle.ShowAtWalls  = new ChartWallType[] { ChartWallType.Back };
            scaleX.ThirdRow.GridStyle.LineStyle    = new NStrokeStyle(1, Color.FromArgb(205, 205, 205));
            scaleX.ThirdRow.UseGridStyle           = true;
            // calendar
            NWeekDayRule wdr = new NWeekDayRule(WeekDayBit.All);

            wdr.Saturday = false;
            wdr.Sunday   = false;
            scaleX.Calendar.Rules.Add(wdr);
            scaleX.EnableCalendar = true;
            // set configurator
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX;

            // setup primary Y axis
            NAxis axis = chart.Axis(StandardAxis.PrimaryY);
            NLinearScaleConfigurator linearScaleConfigurator = (NLinearScaleConfigurator)axis.ScaleConfigurator;

            linearScaleConfigurator.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            linearScaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Left, false);
            linearScaleConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0, NGraphicsUnit.Pixel);

            // line series for the function
            NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line);

            line.DataLabelStyle.Visible = false;
            line.BorderStyle.Color      = Color.Red;
            line.BorderStyle.Width      = new NLength(2, NGraphicsUnit.Pixel);
            line.UseXValues             = true;

            Color customColor = Color.FromArgb(100, 100, 150);

            // setup the stock series
            NStockSeries stock = (NStockSeries)chart.Series.Add(SeriesType.Stock);

            stock.DataLabelStyle.Visible   = false;
            stock.CandleStyle              = CandleStyle.Bar;
            stock.CandleWidth              = new NLength(1, NRelativeUnit.ParentPercentage);
            stock.HighLowStrokeStyle.Color = customColor;
            stock.UpStrokeStyle.Color      = customColor;
            stock.DownStrokeStyle.Color    = customColor;
            stock.UpFillStyle              = new NColorFillStyle(Color.White);
            stock.DownFillStyle            = new NColorFillStyle(customColor);
            stock.Legend.Mode              = SeriesLegendMode.None;
            stock.OpenValues.Name          = "open";
            stock.HighValues.Name          = "high";
            stock.LowValues.Name           = "low";
            stock.CloseValues.Name         = "close";
            stock.UseXValues     = true;
            stock.InflateMargins = true;

            GenerateData(stock);
            BuildExpression(stock, line);

            line.XValues = (NDataSeriesDouble)stock.XValues.Clone();
            line.Values  = nFunction.Calculate();
        }
Example #7
0
        public override void Initialize()
        {
            base.Initialize();

            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel title = new NLabel("Heat Map Cross Section");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);
            title.DockMode            = PanelDockMode.Top;
            nChartControl1.Panels.Add(title);

            {
                NCartesianChart heatMapChart = new NCartesianChart();
                nChartControl1.Panels.Add(heatMapChart);

                heatMapChart.DockMode   = PanelDockMode.Left;
                heatMapChart.Size       = new NSizeL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(0));
                heatMapChart.BoundsMode = BoundsMode.Stretch;
                heatMapChart.Margins    = new NMarginsL(10);
                heatMapChart.Axis(StandardAxis.PrimaryX).ScaleConfigurator            = new NLinearScaleConfigurator();
                heatMapChart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.Title.Text = "X Value";
                heatMapChart.Axis(StandardAxis.PrimaryY).ScaleConfigurator.Title.Text = "Y Value";

                // create the heat map
                m_HeatMap = new NHeatMapSeries();
                heatMapChart.Series.Add(m_HeatMap);

                m_HeatMap.Palette.Add(0.0, Color.Purple);
                m_HeatMap.Palette.Add(1.5, Color.MediumSlateBlue);
                m_HeatMap.Palette.Add(3.0, Color.CornflowerBlue);
                m_HeatMap.Palette.Add(4.5, Color.LimeGreen);
                m_HeatMap.Palette.Add(6.0, Color.LightGreen);
                m_HeatMap.Palette.Add(7.5, Color.Yellow);
                m_HeatMap.Palette.Add(9.0, Color.Orange);
                m_HeatMap.Palette.Add(10.5, Color.Red);
                m_HeatMap.XValuesMode      = HeatMapValuesMode.OriginAndStep;
                m_HeatMap.YValuesMode      = HeatMapValuesMode.OriginAndStep;
                m_HeatMap.InterpolateImage = true;

                m_HeatMap.ContourDisplayMode = ContourDisplayMode.None;
                m_HeatMap.Legend.Mode        = SeriesLegendMode.SeriesLogic;
                m_HeatMap.Legend.Format      = "<zone_value>";

                m_XCursor = new NAxisCursor();
                m_XCursor.BeginEndAxis      = (int)StandardAxis.PrimaryY;
                m_XCursor.StrokeStyle.Width = new NLength(2);
                heatMapChart.Axis(StandardAxis.PrimaryX).Cursors.Add(m_XCursor);
                m_XCursor.ValueChanged += new EventHandler(OnXCursorValueChanged);

                m_YCursor = new NAxisCursor();
                m_YCursor.BeginEndAxis      = (int)StandardAxis.PrimaryX;
                m_YCursor.StrokeStyle.Width = new NLength(2);
                heatMapChart.Axis(StandardAxis.PrimaryY).Cursors.Add(m_YCursor);
                m_YCursor.ValueChanged += new EventHandler(OnYCursorValueChanged);

                GenerateData();
            }

            {
                NDockPanel dockPanel = new NDockPanel();
                dockPanel.DockMode = PanelDockMode.Fill;
                dockPanel.PositionChildPanelsInContentBounds = true;
                dockPanel.Margins = new NMarginsL(10);

                NCartesianChart xCrossSectionChart;
                CreateCrossSectionChart(out xCrossSectionChart, out m_XCrossLineSeries);
                xCrossSectionChart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.Title.Text = "X Value";
                xCrossSectionChart.Axis(StandardAxis.PrimaryY).ScaleConfigurator.Title.Text = "Value";
                dockPanel.ChildPanels.Add(xCrossSectionChart);

                NCartesianChart yCrossSectionChart;
                CreateCrossSectionChart(out yCrossSectionChart, out m_YCrossLineSeries);
                yCrossSectionChart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.Title.Text = "Y Value";
                yCrossSectionChart.Axis(StandardAxis.PrimaryY).ScaleConfigurator.Title.Text = "Value";
                dockPanel.ChildPanels.Add(yCrossSectionChart);

                nChartControl1.Panels.Add(dockPanel);

                // align the two charts
                NSideGuideline guideline = new NSideGuideline(PanelSide.Left);

                guideline.Targets.Add(xCrossSectionChart);
                guideline.Targets.Add(yCrossSectionChart);

                nChartControl1.Document.RootPanel.Guidelines.Add(guideline);
            }

            m_XCursor.Value = m_GridSizeX / 2.0;
            m_YCursor.Value = m_GridSizeY / 2.0;

            nChartControl1.Controller.Tools.Add(new NSelectorTool());
            nChartControl1.Controller.Tools.Add(new NAxisCursorDragTool());
        }