Пример #1
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // remove all legends
            nChartControl1.Legends.Clear();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Renko Chart");

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

            NChart chart = nChartControl1.Charts[0];

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator   = priceConfigurator;

            // setup Y axis
            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            linearScale.StripStyles.Add(stripStyle);

            // setup Renko series
            NRenkoSeries renko = (NRenkoSeries)chart.Series.Add(SeriesType.Renko);

            renko.UseXValues = true;

            GenerateData(renko);

            // apply layout
            ConfigureStandardLayout(chart, title, null);

            BoxSizeComboBox.Items.Add("0.5");
            BoxSizeComboBox.Items.Add("1");
            BoxSizeComboBox.Items.Add("2");
            BoxSizeComboBox.Items.Add("2%");
            BoxSizeComboBox.Items.Add("5%");
            BoxSizeComboBox.Items.Add("10%");

            BoxWidthPercentComboBox.Items.Add("50%");
            BoxWidthPercentComboBox.Items.Add("75%");
            BoxWidthPercentComboBox.Items.Add("100%");

            BoxSizeComboBox.SelectedIndex         = 1;
            BoxWidthPercentComboBox.SelectedIndex = 2;
        }
Пример #2
0
        public override void Initialize()
        {
            base.Initialize();

            // remove all legends
            nChartControl1.Legends.Clear();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Kagi Chart");

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

            NChart chart = nChartControl1.Charts[0];

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator   = priceConfigurator;

            // setup Y axis
            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            linearScale.StripStyles.Add(stripStyle);

            // setup Kagi series
            NKagiSeries kagi = (NKagiSeries)chart.Series.Add(SeriesType.Kagi);

            kagi.UpStrokeStyle.Color   = Color.MidnightBlue;
            kagi.DownStrokeStyle.Color = Color.MidnightBlue;
            kagi.UseXValues            = true;

            GenerateData(kagi);

            // apply layout
            ConfigureStandardLayout(chart, title, null);

            ReversalAmountCombo.SelectedIndex = 0;

            nChartControl1.MouseMove += new MouseEventHandler(nChartControl1_MouseMove);
        }
Пример #3
0
        public override void Initialize()
        {
            base.Initialize();

            // remove all legends
            nChartControl1.Legends.Clear();

            // set a chart title
            NLabel title = new NLabel("Three Line Break");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            NChart chart = nChartControl1.Charts[0];

            NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            scaleY.StripStyles.Add(stripStyle);

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            priceConfigurator.MajorGridStyle.ShowAtWalls          = new ChartWallType[] { ChartWallType.Back };
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator   = priceConfigurator;

            // setup line break series
            m_ThreeLineBreak            = (NThreeLineBreakSeries)chart.Series.Add(SeriesType.ThreeLineBreak);
            m_ThreeLineBreak.UseXValues = true;

            GenerateData(m_ThreeLineBreak);

            // apply layout
            ConfigureStandardLayout(chart, title, null);

            BoxWidthPercentCombo.SelectedIndex = 2;
            LinesToBreakNumericUpDown.Value    = 3;

            nChartControl1.MouseMove += new MouseEventHandler(nChartControl1_MouseMove);
        }
Пример #4
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // remove all legends
            nChartControl1.Legends.Clear();

            // set a chart title
            NLabel title = new NLabel("Three Line Break");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, System.Drawing.FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            NChart chart = nChartControl1.Charts[0];

            NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            scaleY.StripStyles.Add(stripStyle);

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            priceConfigurator.MajorGridStyle.ShowAtWalls          = new ChartWallType[] { ChartWallType.Back };
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator   = priceConfigurator;

            // setup line break series
            m_ThreeLineBreak = new NThreeLineBreakSeries();
            chart.Series.Add(m_ThreeLineBreak);
            m_ThreeLineBreak.UseXValues = true;

            GenerateData(m_ThreeLineBreak);

            // apply layout
            ConfigureStandardLayout(chart, title, null);

            NExampleHelpers.FillComboWithValues(BarWidthPercentComboBox, 0, 100, 10);
            BarWidthPercentComboBox.SelectedIndex = 2;

            NExampleHelpers.FillComboWithValues(NumberOfLinesToBreakComboBox, 1, 10, 1);
            NumberOfLinesToBreakComboBox.SelectedIndex = 4;
        }
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // remove all legends
            nChartControl1.Legends.Clear();

            // set a chart title
            NLabel title = new NLabel("Point and Figure");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, System.Drawing.FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            const int nInitialBoxSize = 5;

            NChart chart = nChartControl1.Charts[0];

            chart.BoundsMode = BoundsMode.Stretch;

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.LabelValueFormatter                 = new NDateTimeValueFormatter(DateTimeValueFormat.Date);
            priceConfigurator.MajorTickMode                       = MajorTickMode.AutoMaxCount;
            priceConfigurator.MajorGridStyle.ShowAtWalls          = new ChartWallType[] { ChartWallType.Back };
            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            priceConfigurator.MaxTickCount = 8;

            NNumericRangeSamplerProvider provider = new NNumericRangeSamplerProvider();

            provider.SamplingMode = SamplingMode.CustomStep;
            provider.CustomStep   = 1;
            provider.UseOrigin    = true;
            provider.Origin       = -0.5;
            priceConfigurator.MajorGridStyle.RangeSamplerProvider = provider;

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = priceConfigurator;

            // setup Y axis
            NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            scaleY.MajorTickMode                  = MajorTickMode.CustomStep;
            scaleY.CustomStep                     = nInitialBoxSize;
            scaleY.OuterMajorTickStyle.Width      = new NLength(0);
            scaleY.InnerMajorTickStyle.Width      = new NLength(0);
            scaleY.AutoMinorTicks                 = true;
            scaleY.MinorTickCount                 = 1;
            scaleY.RoundToTickMin                 = false;
            scaleY.RoundToTickMax                 = false;
            scaleY.MajorGridStyle.LineStyle.Width = new NLength(0);
            scaleY.MinorGridStyle.LineStyle.Width = new NLength(1);
            scaleY.MinorGridStyle.ShowAtWalls     = new ChartWallType[] { ChartWallType.Back };

            float[] highValues = new float[20] {
                21.3F, 42.4F, 11.2F, 65.7F, 38.0F, 71.3F, 49.54F, 83.7F, 13.9F, 56.12F, 27.43F, 23.1F, 31.0F, 75.4F, 9.3F, 39.12F, 10.0F, 44.23F, 21.76F, 49.2F
            };
            float[] lowValues = new float[20] {
                12.1F, 14.32F, 8.43F, 36.0F, 13.5F, 47.34F, 24.54F, 68.11F, 6.87F, 23.3F, 12.12F, 14.54F, 25.0F, 37.2F, 3.9F, 23.11F, 1.9F, 14.0F, 8.23F, 34.21F
            };

            // setup Point & Figure series
            m_PointAndFigure            = (NPointAndFigureSeries)chart.Series.Add(SeriesType.PointAndFigure);
            m_PointAndFigure.UseXValues = true;

            // fill data
            m_PointAndFigure.HighValues.AddRange(highValues);
            m_PointAndFigure.LowValues.AddRange(lowValues);

            DateTime dt = new DateTime(2007, 1, 1);

            for (int i = 0; i < 20; i++)
            {
                m_PointAndFigure.XValues.Add(dt);
                dt = dt.AddDays(1);
            }

            // apply layout
            ConfigureStandardLayout(chart, title, null);

            NExampleHelpers.FillComboWithValues(BoxSizeComboBox, 1, 10, 1);
            BoxSizeComboBox.SelectedIndex = nInitialBoxSize + 1;

            NExampleHelpers.FillComboWithValues(ReversalAmountComboBox, 1, 10, 1);
            ReversalAmountComboBox.SelectedIndex = 3;
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                WebExamplesUtilities.FillComboWithColorNames(UpColorDropDownList, KnownColor.Red);
                WebExamplesUtilities.FillComboWithColorNames(DownColorDropDownList, KnownColor.Black);
                ProportionalXCheckBox.Checked = false;
                ProportionalYCheckBox.Checked = false;
                WebExamplesUtilities.FillComboWithFloatValues(BoxSizeDropdownlist, 0.5F, 10, 0.5F);
                BoxSizeDropdownlist.SelectedIndex = 9;
                WebExamplesUtilities.FillComboWithValues(ReversalAmountDropDownList, 1, 5, 1);
                ReversalAmountDropDownList.SelectedIndex = 2;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Point and Figure");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            chart.BoundsMode = BoundsMode.Stretch;

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.LabelValueFormatter                 = new NDateTimeValueFormatter(DateTimeValueFormat.Date);
            priceConfigurator.MajorTickMode                       = MajorTickMode.AutoMaxCount;
            priceConfigurator.MajorGridStyle.ShowAtWalls          = new ChartWallType[] { ChartWallType.Back };
            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            priceConfigurator.MaxTickCount = 8;

            NNumericRangeSamplerProvider provider = new NNumericRangeSamplerProvider();

            provider.SamplingMode = SamplingMode.CustomStep;
            provider.CustomStep   = 1;
            provider.UseOrigin    = true;
            provider.Origin       = -0.5;
            priceConfigurator.MajorGridStyle.RangeSamplerProvider = provider;

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = priceConfigurator;

            // setup Y axis
            NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            scaleY.MajorTickMode                  = MajorTickMode.CustomStep;
            scaleY.CustomStep                     = 5;
            scaleY.OuterMajorTickStyle.Width      = new NLength(0);
            scaleY.InnerMajorTickStyle.Width      = new NLength(0);
            scaleY.AutoMinorTicks                 = true;
            scaleY.MinorTickCount                 = 1;
            scaleY.RoundToTickMin                 = false;
            scaleY.RoundToTickMax                 = false;
            scaleY.MajorGridStyle.LineStyle.Width = new NLength(0);
            scaleY.MinorGridStyle.LineStyle.Width = new NLength(1);
            scaleY.MinorGridStyle.ShowAtWalls     = new ChartWallType[] { ChartWallType.Back };

            float[] highValues = new float[20] {
                21.3F, 42.4F, 11.2F, 65.7F, 38.0F, 71.3F, 49.54F, 83.7F, 13.9F, 56.12F, 27.43F, 23.1F, 31.0F, 75.4F, 9.3F, 39.12F, 10.0F, 44.23F, 21.76F, 49.2F
            };
            float[] lowValues = new float[20] {
                12.1F, 14.32F, 8.43F, 36.0F, 13.5F, 47.34F, 24.54F, 68.11F, 6.87F, 23.3F, 12.12F, 14.54F, 25.0F, 37.2F, 3.9F, 23.11F, 1.9F, 14.0F, 8.23F, 34.21F
            };

            // setup Point & Figure series
            NPointAndFigureSeries pointAndFigure = (NPointAndFigureSeries)chart.Series.Add(SeriesType.PointAndFigure);

            pointAndFigure.UseXValues = true;

            // fill data
            pointAndFigure.HighValues.AddRange(highValues);
            pointAndFigure.LowValues.AddRange(lowValues);

            DateTime dt = new DateTime(2007, 1, 1);

            for (int i = 0; i < 20; i++)
            {
                pointAndFigure.XValues.Add(dt);
                dt = dt.AddDays(1);
            }

            double dBoxSize = Convert.ToDouble(BoxSizeDropdownlist.SelectedValue);

            pointAndFigure.BoxSize = dBoxSize;
            scaleY.CustomStep      = dBoxSize;

            pointAndFigure.ProportionalX         = ProportionalXCheckBox.Checked;
            pointAndFigure.ProportionalY         = ProportionalYCheckBox.Checked;
            pointAndFigure.ReversalAmount        = Convert.ToInt32(ReversalAmountDropDownList.SelectedValue);
            pointAndFigure.UpStrokeStyle.Color   = WebExamplesUtilities.ColorFromDropDownList(UpColorDropDownList);
            pointAndFigure.DownStrokeStyle.Color = WebExamplesUtilities.ColorFromDropDownList(DownColorDropDownList);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, null);
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                WebExamplesUtilities.FillComboWithColorNames(UpColorDropDownList, KnownColor.Black);
                WebExamplesUtilities.FillComboWithColorNames(DownColorDropDownList, KnownColor.Black);
                WebExamplesUtilities.FillComboWithValues(UpStrokeDropDownList, 1, 3, 1);
                UpStrokeDropDownList.SelectedIndex = 1;
                WebExamplesUtilities.FillComboWithValues(DownStrokeDropDownList, 1, 3, 1);
                reversalAmountDropdownlist.Items.AddRange(new ListItem[]
                                                          { new ListItem("0.5"),
                                                            new ListItem("1"),
                                                            new ListItem("2"),
                                                            new ListItem("1%"),
                                                            new ListItem("2%"),
                                                            new ListItem("5%") });
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

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

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Kagi Chart");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

            NChart chart = nChartControl1.Charts[0];

            chart.BoundsMode = BoundsMode.Stretch;

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator   = priceConfigurator;

            // setup Y axis
            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            linearScale.StripStyles.Add(stripStyle);

            //Setup Kagi series
            NKagiSeries kagi = (NKagiSeries)chart.Series.Add(SeriesType.Kagi);

            kagi.UpStrokeStyle.Color   = WebExamplesUtilities.ColorFromDropDownList(UpColorDropDownList);
            kagi.DownStrokeStyle.Color = WebExamplesUtilities.ColorFromDropDownList(DownColorDropDownList);
            kagi.UpStrokeStyle.Width   = new NLength(Convert.ToInt32(UpStrokeDropDownList.SelectedValue));
            kagi.DownStrokeStyle.Width = new NLength(Convert.ToInt32(DownStrokeDropDownList.SelectedValue));
            kagi.UseXValues            = true;

            switch (reversalAmountDropdownlist.SelectedIndex)
            {
            case 0:
                kagi.ReversalAmount           = 0.5;
                kagi.ReversalAmountInPercents = false;
                break;

            case 1:
                kagi.ReversalAmount           = 1;
                kagi.ReversalAmountInPercents = false;
                break;

            case 2:
                kagi.ReversalAmount           = 2;
                kagi.ReversalAmountInPercents = false;
                break;

            case 3:
                kagi.ReversalAmount           = 1;
                kagi.ReversalAmountInPercents = true;
                break;

            case 4:
                kagi.ReversalAmount           = 2;
                kagi.ReversalAmountInPercents = true;
                break;

            case 5:
                kagi.ReversalAmount           = 5;
                kagi.ReversalAmountInPercents = true;
                break;
            }

            GenerateData(kagi);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, null);
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                WebExamplesUtilities.FillComboWithColorNames(UpColorDropDownList, KnownColor.White);
                WebExamplesUtilities.FillComboWithColorNames(DownColorDropDownList, KnownColor.Black);
                BoxSizeDropDownList.Items.AddRange(new ListItem[]
                {
                    new ListItem("0.5"),
                    new ListItem("1"),
                    new ListItem("2"),
                    new ListItem("2%"),
                    new ListItem("5%"),
                    new ListItem("10%")
                });
                BoxSizeDropDownList.SelectedIndex = 1;
                BoxWidthDropDownList.Items.AddRange(new ListItem[]
                {
                    new ListItem("50%"),
                    new ListItem("75%"),
                    new ListItem("100%")
                });
                BoxWidthDropDownList.SelectedIndex = 2;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Renko Chart");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            chart.BoundsMode = BoundsMode.Stretch;

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator   = priceConfigurator;

            // setup Y axis
            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            linearScale.StripStyles.Add(stripStyle);

            NRenkoSeries renko = (NRenkoSeries)chart.Series.Add(SeriesType.Renko);

            renko.UseXValues    = true;
            renko.UpFillStyle   = new NColorFillStyle(WebExamplesUtilities.ColorFromDropDownList(UpColorDropDownList));
            renko.DownFillStyle = new NColorFillStyle(WebExamplesUtilities.ColorFromDropDownList(DownColorDropDownList));

            switch (BoxSizeDropDownList.SelectedIndex)
            {
            case 0:
                renko.BoxSize           = 0.5;
                renko.BoxSizeInPercents = false;
                break;

            case 1:
                renko.BoxSize           = 1;
                renko.BoxSizeInPercents = false;
                break;

            case 2:
                renko.BoxSize           = 2;
                renko.BoxSizeInPercents = false;
                break;

            case 3:
                renko.BoxSize           = 2;
                renko.BoxSizeInPercents = true;
                break;

            case 4:
                renko.BoxSize           = 5;
                renko.BoxSizeInPercents = true;
                break;

            case 5:
                renko.BoxSize           = 10;
                renko.BoxSizeInPercents = true;
                break;
            }

            switch (BoxWidthDropDownList.SelectedIndex)
            {
            case 0:
                renko.BoxWidthPercent = 50;
                break;

            case 1:
                renko.BoxWidthPercent = 75;
                break;

            case 2:
                renko.BoxWidthPercent = 100;
                break;
            }

            GenerateData(renko);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, null);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                WebExamplesUtilities.FillComboWithColorNames(UpColorDropDownList, KnownColor.White);
                WebExamplesUtilities.FillComboWithColorNames(DownColorDropDownList, KnownColor.Black);
                BoxWidthDropDownList.Items.AddRange(new ListItem[]
                {
                    new ListItem("50%"),
                    new ListItem("75%"),
                    new ListItem("100%")
                });
                BoxWidthDropDownList.SelectedIndex = 2;
                WebExamplesUtilities.FillComboWithValues(NumberOfLinesDropDownList, 1, 4, 1);
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Three Line Break");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            chart.BoundsMode = BoundsMode.Stretch;

            // add interlaced stripe
            NLinearScaleConfigurator linearScaleConfigurator = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            NScaleStripStyle         stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScaleConfigurator.StripStyles.Add(stripStyle);

            // setup X axis
            NPriceScaleConfigurator priceConfigurator = new NPriceScaleConfigurator();

            priceConfigurator.InnerMajorTickStyle.LineStyle.Width = new NLength(0);
            priceConfigurator.MajorGridStyle.ShowAtWalls          = new ChartWallType[] { ChartWallType.Back };
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator   = priceConfigurator;

            // setup line break series
            NThreeLineBreakSeries threeLineBreak = (NThreeLineBreakSeries)chart.Series.Add(SeriesType.ThreeLineBreak);

            threeLineBreak.UseXValues = true;

            threeLineBreak.UpFillStyle          = new NColorFillStyle(WebExamplesUtilities.ColorFromDropDownList(UpColorDropDownList));
            threeLineBreak.DownFillStyle        = new NColorFillStyle(WebExamplesUtilities.ColorFromDropDownList(DownColorDropDownList));
            threeLineBreak.NumberOfLinesToBreak = Convert.ToInt32(NumberOfLinesDropDownList.SelectedValue);

            switch (BoxWidthDropDownList.SelectedIndex)
            {
            case 0:
                threeLineBreak.BoxWidthPercent = 50;
                break;

            case 1:
                threeLineBreak.BoxWidthPercent = 75;
                break;

            case 2:
                threeLineBreak.BoxWidthPercent = 100;
                break;
            }

            GenerateData(threeLineBreak);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, null);
        }