/// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Scale Breaks Appearance";

            // configure chart
            m_Chart         = (NCartesianChart)chartView.Surface.Charts[0];
            m_Chart.Padding = new NMargins(20);

            // configure axes
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            m_Chart.PlotFill = new NStockGradientFill(NColor.White, NColor.DarkGray);

            // configure scale
            NLinearScale yScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            yScale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.MajorTick;

            m_ScaleBreak = new NAutoScaleBreak(0.4f);
            m_ScaleBreak.PositionMode = ENScaleBreakPositionMode.Percent;
            yScale.ScaleBreaks.Add(m_ScaleBreak);

            // add an interlaced strip to the Y axis
            NScaleStrip interlacedStrip = new NScaleStrip();

            interlacedStrip.Interlaced = true;
            interlacedStrip.Fill       = new NColorFill(NColor.Beige);
            yScale.Strips.Add(interlacedStrip);

            // Create some data with a peak in it
            NBarSeries bar = new NBarSeries();

            m_Chart.Series.Add(bar);
            bar.DataLabelStyle = new NDataLabelStyle(false);

            // fill in some data so that it contains several peaks of data
            Random random = new Random();

            for (int i = 0; i < 8; i++)
            {
                bar.DataPoints.Add(new NBarDataPoint(random.Next(30)));
            }

            for (int i = 0; i < 5; i++)
            {
                bar.DataPoints.Add(new NBarDataPoint(300 + random.Next(50)));
            }

            for (int i = 0; i < 8; i++)
            {
                bar.DataPoints.Add(new NBarDataPoint(random.Next(30)));
            }

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Axis Model Crossing";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            NCartesianAxis primaryX = m_Chart.Axes[ENCartesianAxis.PrimaryX];
            NCartesianAxis primaryY = m_Chart.Axes[ENCartesianAxis.PrimaryY];

            // configure axes
            NLinearScale yScale = (NLinearScale)primaryY.Scale;

            yScale.MajorGridLines = CreateDottedGrid();

            NScaleStrip yStrip = new NScaleStrip(new NColorFill(new NColor(NColor.LightGray, 40)), null, true, 0, 0, 1, 1);

            yStrip.Interlaced = true;
            yScale.Strips.Add(yStrip);

            NLinearScale xScale = (NLinearScale)primaryX.Scale;

            xScale.MajorGridLines = CreateDottedGrid();

            NScaleStrip xStrip = new NScaleStrip(new NColorFill(new NColor(NColor.LightGray, 40)), null, true, 0, 0, 1, 1);

            xStrip.Interlaced = true;
            xScale.Strips.Add(xStrip);

            // cross X and Y axes
            primaryX.Anchor = new NModelCrossCartesianAxisAnchor(0, ENAxisCrossAlignment.Center, primaryY, ENCartesianAxisOrientation.Horizontal, ENScaleOrientation.Right, 0.0f, 100.0f);

            primaryY.Anchor = new NModelCrossCartesianAxisAnchor(0, ENAxisCrossAlignment.Center, primaryX, ENCartesianAxisOrientation.Vertical, ENScaleOrientation.Left, 0.0f, 100.0f);

            // setup bubble series
            NBubbleSeries bubble = new NBubbleSeries();

            bubble.Name           = "Bubble Series";
            bubble.InflateMargins = true;
            bubble.DataLabelStyle = new NDataLabelStyle(false);
            bubble.UseXValues     = true;

            // fill with random data
            Random random = new Random();

            for (int i = 0; i < 10; i++)
            {
                bubble.DataPoints.Add(new NBubbleDataPoint(random.Next(-20, 20), random.Next(-20, 20), random.Next(1, 6)));
            }

            m_Chart.Series.Add(bubble);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Box and Whiskers";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            NLinearScale linearScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;
            // add interlace stripe
            NScaleStrip strip = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            m_BoxAndWhiskerSeries           = new NBoxAndWhiskerSeries();
            m_BoxAndWhiskerSeries.WidthMode = ENBarWidthMode.FixedWidth;
            m_Chart.Series.Add(m_BoxAndWhiskerSeries);

            m_BoxAndWhiskerSeries.Fill           = new NStockGradientFill(ENGradientStyle.Vertical, ENGradientVariant.Variant4, NColor.LightYellow, NColor.DarkOrange);
            m_BoxAndWhiskerSeries.DataLabelStyle = new NDataLabelStyle(false);
            m_BoxAndWhiskerSeries.MedianStroke   = new NStroke(NColor.Indigo);
            m_BoxAndWhiskerSeries.AverageStroke  = new NStroke(1, NColor.DarkRed, ENDashStyle.Dot);
            m_BoxAndWhiskerSeries.OutlierStroke  = new NStroke(NColor.DarkCyan);
            m_BoxAndWhiskerSeries.OutlierFill    = new NColorFill(NColor.Red);

            GenerateData(m_BoxAndWhiskerSeries, 7);

            return(chartView);
        }
Example #4
0
        private void AddAxis(string title)
        {
            NRadarAxis axis = new NRadarAxis();

            // set title
            axis.Title      = title;
            axis.TitleAngle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0);
//			axis.TitleTextStyle.TextFormat = TextFormat.XML;

            // setup scale
            NLinearScale linearScale = (NLinearScale)axis.Scale;

            if (m_Chart.Axes.Count == 0)
            {
                // if the first axis then configure grid style and stripes
                linearScale.MajorGridLines.Stroke = new NStroke(1, NColor.Gainsboro, ENDashStyle.Dot);

                // add interlaced stripe
                NScaleStrip strip = new NScaleStrip();
                strip.Fill       = new NColorFill(NColor.FromRGBA(200, 200, 200, 64));
                strip.Interlaced = true;
                linearScale.Strips.Add(strip);
            }
            else
            {
                // hide labels
                linearScale.Labels.Visible = false;
            }

            m_Chart.Axes.Add(axis);
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Automatic Scale Breaks";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            // configure axes
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // configure scale
            NLinearScale yScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            yScale.ViewRangeInflateMode = ENScaleViewRangeInflateMode.MajorTick;
            yScale.MinTickDistance      = 30;

            // add an interlaced strip to the Y axis
            NScaleStrip interlacedStrip = new NScaleStrip();

            interlacedStrip.Interlaced = true;
            interlacedStrip.Fill       = new NColorFill(NColor.Beige);
            yScale.Strips.Add(interlacedStrip);

            OnChangeDataButtonClick(null);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Series Legend View";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // add a bar series
            NBarSeries bar1 = new NBarSeries();

            bar1.Name           = "Bar1";
            bar1.MultiBarMode   = ENMultiBarMode.Series;
            bar1.DataLabelStyle = new NDataLabelStyle(false);
            bar1.ValueFormatter = new NNumericValueFormatter("0.###");
            m_Chart.Series.Add(bar1);

            // add another bar series
            NBarSeries bar2 = new NBarSeries();

            bar2.Name           = "Bar2";
            bar2.MultiBarMode   = ENMultiBarMode.Clustered;
            bar2.DataLabelStyle = new NDataLabelStyle(false);
            bar2.ValueFormatter = new NNumericValueFormatter("0.###");
            m_Chart.Series.Add(bar2);

            // add another bar series
            NBarSeries bar3 = new NBarSeries();

            bar3.Name           = "Bar2";
            bar3.MultiBarMode   = ENMultiBarMode.Clustered;
            bar3.DataLabelStyle = new NDataLabelStyle(false);
            bar3.ValueFormatter = new NNumericValueFormatter("0.###");
            m_Chart.Series.Add(bar3);

            Random random = new Random();

            for (int i = 0; i < 5; i++)
            {
                bar1.DataPoints.Add(new NBarDataPoint(random.Next(10, 100)));
                bar2.DataPoints.Add(new NBarDataPoint(random.Next(10, 100)));
                bar3.DataPoints.Add(new NBarDataPoint(random.Next(10, 100)));
            }

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Example #7
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Stacked Percent Bar";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            linearScale.Labels.TextProvider = new NFormattedScaleLabelTextProvider(new NNumericValueFormatter("P"));
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            linearScale.Strips.Add(stripStyle);

            // add the first bar
            m_Bar1              = new NBarSeries();
            m_Bar1.Name         = "Bar1";
            m_Bar1.MultiBarMode = ENMultiBarMode.Series;
            chart.Series.Add(m_Bar1);

            // add the second bar
            m_Bar2              = new NBarSeries();
            m_Bar2.Name         = "Bar2";
            m_Bar2.MultiBarMode = ENMultiBarMode.StackedPercent;
            chart.Series.Add(m_Bar2);

            // add the third bar
            m_Bar3              = new NBarSeries();
            m_Bar3.Name         = "Bar3";
            m_Bar3.MultiBarMode = ENMultiBarMode.StackedPercent;
            chart.Series.Add(m_Bar3);

            // setup value formatting
            m_Bar1.ValueFormatter = new NNumericValueFormatter("0.###");
            m_Bar2.ValueFormatter = new NNumericValueFormatter("0.###");
            m_Bar3.ValueFormatter = new NNumericValueFormatter("0.###");

            // position data labels in the center of the bars
            m_Bar1.DataLabelStyle = CreateDataLabelStyle();
            m_Bar2.DataLabelStyle = CreateDataLabelStyle();
            m_Bar3.DataLabelStyle = CreateDataLabelStyle();

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            // pass some data
            OnPositiveDataButtonClick(null);

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Legend Appearance";

            m_Legend            = chartView.Surface.Legends[0];
            m_Legend.ExpandMode = ENLegendExpandMode.ColsFixed;
            m_Legend.ColCount   = 3;

            m_Legend.Border            = NBorder.CreateFilledBorder(NColor.Black);
            m_Legend.BorderThickness   = new NMargins(2);
            m_Legend.BackgroundFill    = new NStockGradientFill(NColor.White, NColor.LightGray);
            m_Legend.VerticalPlacement = Layout.ENVerticalPlacement.Top;

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            //linearScale.Strips.Add(strip);

            // setup a bar series
            NBarSeries bar = new NBarSeries();

            bar.Name            = "Bar Series";
            bar.InflateMargins  = true;
            bar.UseXValues      = false;
            bar.LegendView.Mode = ENSeriesLegendMode.DataPoints;

            // add some data to the bar series
            bar.LegendView.Mode = ENSeriesLegendMode.DataPoints;
            bar.DataPoints.Add(new NBarDataPoint(18, "C++"));
            bar.DataPoints.Add(new NBarDataPoint(15, "Ruby"));
            bar.DataPoints.Add(new NBarDataPoint(21, "Python"));
            bar.DataPoints.Add(new NBarDataPoint(23, "Java"));
            bar.DataPoints.Add(new NBarDataPoint(27, "Javascript"));
            bar.DataPoints.Add(new NBarDataPoint(29, "C#"));
            bar.DataPoints.Add(new NBarDataPoint(26, "PHP"));
            bar.DataPoints.Add(new NBarDataPoint(17, "Objective C"));
            bar.DataPoints.Add(new NBarDataPoint(24, "SQL"));
            bar.DataPoints.Add(new NBarDataPoint(13, "Object Pascal"));
            bar.DataPoints.Add(new NBarDataPoint(19, "Visual Basic"));
            bar.DataPoints.Add(new NBarDataPoint(16, "Open Edge ABL"));

            chart.Series.Add(bar);

            return(chartView);
        }
Example #9
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreatePolarChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Polar Area";

            // configure chart
            m_Chart = (NPolarChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedPolarAxes(ENPredefinedPolarAxes.AngleValue);

            // setup polar axis
            NLinearScale linearScale = (NLinearScale)m_Chart.Axes[ENPolarAxis.PrimaryValue].Scale;

            linearScale.ViewRangeInflateMode  = ENScaleViewRangeInflateMode.MajorTick;
            linearScale.InflateViewRangeBegin = true;
            linearScale.InflateViewRangeEnd   = true;
            linearScale.MajorGridLines.Stroke = new NStroke(1, NColor.Black);

            NScaleStrip strip = new NScaleStrip();

            strip.Fill       = new NColorFill(NColor.FromColor(NColor.Beige, 0.5f));
            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // setup polar angle axis
            NAngularScale angularScale = (NAngularScale)m_Chart.Axes[ENPolarAxis.PrimaryAngle].Scale;

            strip            = new NScaleStrip();
            strip.Fill       = new NColorFill(NColor.FromRGBA(192, 192, 192, 125));
            strip.Interlaced = true;
            angularScale.Strips.Add(strip);

            // polar area series 1
            NPolarAreaSeries series1 = new NPolarAreaSeries();

            m_Chart.Series.Add(series1);
            series1.Name           = "Theoretical";
            series1.DataLabelStyle = new NDataLabelStyle(false);
            GenerateData(series1, 100, 15.0);

            // polar area series 2
            NPolarAreaSeries series2 = new NPolarAreaSeries();

            m_Chart.Series.Add(series2);
            series2.Name           = "Experimental";
            series2.DataLabelStyle = new NDataLabelStyle(false);
            GenerateData(series2, 100, 10.0);

            // apply style sheet
            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Example #10
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Ordinal Scale";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            // configure axes
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlaced stripe to the Y axis
            NLinearScale linearScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;
            NScaleStrip  stripStyle  = new NScaleStrip();

            stripStyle.Fill       = new NColorFill(NColor.Beige);
            stripStyle.Interlaced = true;
            linearScale.Strips.Add(stripStyle);

            // add some series
            int        dataItemsCount = 6;
            NBarSeries bar            = new NBarSeries();

            bar.InflateMargins = true;
            bar.DataLabelStyle = new NDataLabelStyle(false);

            Random random = new Random();

            for (int i = 0; i < dataItemsCount; i++)
            {
                bar.DataPoints.Add(new NBarDataPoint(random.Next(10, 30)));
            }

            m_Chart.Series.Add(bar);

            NOrdinalScale ordinalScale = (NOrdinalScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            ordinalScale.Labels.OverlapResolveLayouts = new NDomArray <ENLevelLabelsLayout>(new ENLevelLabelsLayout[] { ENLevelLabelsLayout.AutoScale });

            NList <string> labels = new NList <string>();

            for (int j = 0; j < dataItemsCount; j++)
            {
                labels.Add("Category " + j.ToString());
            }

            ordinalScale.Labels.TextProvider = new NOrdinalScaleLabelTextProvider(labels);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Area";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // setup X axis
            NOrdinalScale scaleX = (NOrdinalScale)chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            scaleX.InflateContentRange           = false;
            scaleX.MajorTickMode                 = ENMajorTickMode.AutoMaxCount;
            scaleX.DisplayDataPointsBetweenTicks = false;
            scaleX.Labels.Visible                = false;

            for (int i = 0; i < monthLetters.Length; i++)
            {
                scaleX.CustomLabels.Add(new NCustomValueLabel(i, monthLetters[i]));
            }

            // add interlaced stripe for Y axis
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;

            NLinearScale scaleY = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            scaleY.Strips.Add(stripStyle);

            // setup area series
            m_Area      = new NAreaSeries();
            m_Area.Name = "Area Series";

            NDataLabelStyle dataLabelStyle = new NDataLabelStyle();

            dataLabelStyle.Visible = true;
            dataLabelStyle.Format  = "<value>";

            m_Area.DataLabelStyle = dataLabelStyle;

            for (int i = 0; i < monthValues.Length; i++)
            {
                m_Area.DataPoints.Add(new NAreaDataPoint(monthValues[i]));
            }

            chart.Series.Add(m_Area);

            return(chartView);
        }
Example #12
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreatePolarChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Polar Vector";

            // configure chart
            m_Chart = (NPolarChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedPolarAxes(ENPredefinedPolarAxes.AngleValue);

            // setup polar axis
            NLinearScale linearScale = (NLinearScale)m_Chart.Axes[ENPolarAxis.PrimaryValue].Scale;

            linearScale.ViewRangeInflateMode   = ENScaleViewRangeInflateMode.MajorTick;
            linearScale.InflateViewRangeBegin  = true;
            linearScale.InflateViewRangeEnd    = true;
            linearScale.MajorGridLines.Visible = true;

            NScaleStrip strip = new NScaleStrip();

            strip.Fill       = new NColorFill(new NColor(NColor.Beige, 125));
            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // setup polar angle axis
            NAngularScale angularScale = (NAngularScale)m_Chart.Axes[ENPolarAxis.PrimaryAngle].Scale;

            strip            = new NScaleStrip();
            strip.Fill       = new NColorFill(NColor.FromRGBA(192, 192, 192, 125));
            strip.Interlaced = true;
            angularScale.Strips.Add(strip);

            // create a polar line series
            NPolarVectorSeries vectorSeries = new NPolarVectorSeries();

            m_Chart.Series.Add(vectorSeries);
            vectorSeries.Name           = "Series 1";
            vectorSeries.DataLabelStyle = new NDataLabelStyle(false);

            for (int i = 0; i < 360; i += 30)
            {
                for (int j = 10; j <= 100; j += 10)
                {
                    vectorSeries.DataPoints.Add(new NPolarVectorDataPoint(i, j, i + j / 10, j, null, new NStroke(1, ColorFromValue(j))));
                }
            }

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "XY Scatter Area";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // add interlace stripe
            NLinearScale linearScale = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;
            NScaleStrip  stripStyle  = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            linearScale.Strips.Add(stripStyle);

            // show the x axis grid lines
            linearScale = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            NScaleGridLines majorGrid = new NScaleGridLines();

            majorGrid.Visible          = true;
            linearScale.MajorGridLines = majorGrid;

            // add the area series
            m_Area      = new NAreaSeries();
            m_Area.Name = "Area Series";

            NDataLabelStyle dataLabelStyle = new NDataLabelStyle();

            dataLabelStyle.Visible           = true;
            dataLabelStyle.ArrowStroke.Width = 0;
            dataLabelStyle.Format            = "<value>";
            m_Area.DataLabelStyle            = dataLabelStyle;

            m_Area.UseXValues = true;

            // add xy values
            m_Area.DataPoints.Add(new NAreaDataPoint(12, 10));
            m_Area.DataPoints.Add(new NAreaDataPoint(25, 23));
            m_Area.DataPoints.Add(new NAreaDataPoint(45, 12));
            m_Area.DataPoints.Add(new NAreaDataPoint(55, 24));
            m_Area.DataPoints.Add(new NAreaDataPoint(61, 16));
            m_Area.DataPoints.Add(new NAreaDataPoint(69, 19));
            m_Area.DataPoints.Add(new NAreaDataPoint(78, 17));

            chart.Series.Add(m_Area);

            return(chartView);
        }
Example #14
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateRadarChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Radar Axis Titles";

            // configure chart
            m_Chart = (NRadarChart)chartView.Surface.Charts[0];

            AddAxis("Vitamin A");
            AddAxis("Vitamin B1");
            AddAxis("Vitamin B2");
            AddAxis("Vitamin B6");
            AddAxis("Vitamin B12");
            AddAxis("Vitamin C");
            AddAxis("Vitamin D");
            AddAxis("Vitamin E");

            NLinearScale radarScale = (NLinearScale)m_Chart.Axes[0].Scale;

            radarScale.MajorGridLines.Visible = true;

            NScaleStrip strip = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            radarScale.Strips.Add(strip);

            // create the radar series
            m_RadarArea1 = new NRadarAreaSeries();
            m_Chart.Series.Add(m_RadarArea1);
            m_RadarArea1.Name                  = "Series 1";
            m_RadarArea1.DataLabelStyle        = new NDataLabelStyle(false);
            m_RadarArea1.DataLabelStyle.Format = "<value>";

            m_RadarArea2 = new NRadarAreaSeries();
            m_Chart.Series.Add(m_RadarArea2);
            m_RadarArea2.Name           = "Series 2";
            m_RadarArea2.DataLabelStyle = new NDataLabelStyle(false);

            // fill random data
            Random random = new Random();

            for (int i = 0; i < 8; i++)
            {
                m_RadarArea1.DataPoints.Add(new NRadarAreaDataPoint(random.Next(50, 90)));
                m_RadarArea2.DataPoints.Add(new NRadarAreaDataPoint(random.Next(0, 100)));
            }

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Example #15
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreatePolarChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Polar Point";

            // configure chart
            m_Chart = (NPolarChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedPolarAxes(ENPredefinedPolarAxes.AngleValue);

            // setup polar axis
            NLinearScale linearScale = (NLinearScale)m_Chart.Axes[ENPolarAxis.PrimaryValue].Scale;

            linearScale.ViewRangeInflateMode  = ENScaleViewRangeInflateMode.MajorTick;
            linearScale.InflateViewRangeBegin = true;
            linearScale.InflateViewRangeEnd   = true;

            linearScale.MajorGridLines.Stroke.DashStyle = ENDashStyle.Dot;

            NScaleStrip strip = new NScaleStrip();

            strip.Fill       = new NColorFill(NColor.FromColor(NColor.Cyan, 0.4f));
            strip.Interlaced = true;
            linearScale.Strips.Add(strip);
            linearScale.MajorGridLines.Visible = true;

            // setup polar angle axis
            NAngularScale angularScale = (NAngularScale)m_Chart.Axes[ENPolarAxis.PrimaryAngle].Scale;

            strip            = new NScaleStrip();
            strip.Fill       = new NColorFill(NColor.FromRGBA(192, 192, 192, 125));
            strip.Interlaced = true;

            angularScale.Strips.Add(strip);
            angularScale.MajorGridLines.Visible = true;

            // create three polar point series
            Random  random = new Random();
            NSeries s1     = CreatePolarPointSeries("Sample 1", ENPointShape.Ellipse, random);
            NSeries s2     = CreatePolarPointSeries("Sample 2", ENPointShape.Rectangle, random);
            NSeries s3     = CreatePolarPointSeries("Sample 3", ENPointShape.Triangle, random);

            // add the series to the chart
            m_Chart.Series.Add(s1);
            m_Chart.Series.Add(s2);
            m_Chart.Series.Add(s3);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Example #16
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Bubble";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // configure the chart
            NLinearScale yScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            yScale.MajorGridLines = new NScaleGridLines();
            yScale.MajorGridLines.Stroke.DashStyle = ENDashStyle.Dot;

            // add interlace stripe
            NScaleStrip strip = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            yScale.Strips.Add(strip);

            NOrdinalScale xScale = (NOrdinalScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            xScale.MajorGridLines = new NScaleGridLines();
            xScale.MajorGridLines.Stroke.DashStyle = ENDashStyle.Dot;

            // add a bubble series
            m_Bubble = new NBubbleSeries();

            m_Bubble.DataLabelStyle           = new NDataLabelStyle();
            m_Bubble.DataLabelStyle.VertAlign = ENVerticalAlignment.Center;
            m_Bubble.DataLabelStyle.Visible   = false;
            m_Bubble.LegendView.Mode          = ENSeriesLegendMode.DataPoints;
            m_Bubble.MinSize = 20;
            m_Bubble.MaxSize = 100;

            m_Bubble.DataPoints.Add(new NBubbleDataPoint(10, 10, "Company 1"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(15, 20, "Company 2"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(12, 25, "Company 3"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(8, 15, "Company 4"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(14, 17, "Company 5"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(11, 12, "Company 6"));

            m_Chart.Series.Add(m_Bubble);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "XY Scatter Bubble";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // configure the chart
            NLinearScale yScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            yScale.MajorGridLines = new NScaleGridLines();
            yScale.MajorGridLines.Stroke.DashStyle = ENDashStyle.Dot;

            // add interlace stripe
            NScaleStrip strip = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            yScale.Strips.Add(strip);

            NLinearScale xScale = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            xScale.MajorGridLines = new NScaleGridLines();
            xScale.MajorGridLines.Stroke.DashStyle = ENDashStyle.Dot;

            // add a bubble series
            m_Bubble = new NBubbleSeries();

            m_Bubble = new NBubbleSeries();
            m_Bubble.DataLabelStyle    = new NDataLabelStyle(false);
            m_Bubble.LegendView.Format = "<label>";
            m_Bubble.LegendView.Mode   = ENSeriesLegendMode.DataPoints;
            m_Bubble.UseXValues        = true;

            m_Bubble.DataPoints.Add(new NBubbleDataPoint(27, 51, 1147995904, "India"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(50, 67, 1321851888, "China"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(76, 22, 109955400, "Mexico"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(210, 9, 142008838, "Russia"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(360, 4, 305843000, "USA"));
            m_Bubble.DataPoints.Add(new NBubbleDataPoint(470, 5, 33560000, "Canada"));

            m_Chart.Series.Add(m_Bubble);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
Example #18
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            chartView.Surface.Titles[0].Text = "Axis Ticks";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            // configure axes
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);
            NLinearScale scaleY = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            scaleY.MinorTickCount          = 1;
            scaleY.InnerMinorTicks.Visible = true;
            scaleY.InnerMinorTicks.Stroke  = new NStroke(1, NColor.Black);
            scaleY.InnerMinorTicks.Length  = 5;

            scaleY.OuterMinorTicks.Visible = true;
            scaleY.OuterMinorTicks.Stroke  = new NStroke(1, NColor.Black);
            scaleY.OuterMinorTicks.Length  = 5;

            scaleY.InnerMajorTicks.Visible = true;
            scaleY.InnerMajorTicks.Stroke  = new NStroke(1, NColor.Black);

            // add interlaced stripe
            NScaleStrip strip = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            scaleY.Strips.Add(strip);

            NOrdinalScale scaleX = (NOrdinalScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            // create dummy data
            NBarSeries bar = new NBarSeries();

            bar.Name = "Bars";
            Random random = new Random();

            for (int i = 0; i < 10; i++)
            {
                bar.DataPoints.Add(new NBarDataPoint(random.Next(100)));
            }

            m_Chart.Series.Add(bar);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Example #19
0
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Area Palette";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // setup an area series
            m_Area                = new NAreaSeries();
            m_Area.Name           = "Area Series";
            m_Area.InflateMargins = true;
            m_Area.UseXValues     = false;
            m_Area.DataLabelStyle = new NDataLabelStyle(false);

            m_Area.Palette = new NColorValuePalette(new NColorValuePair[] { new NColorValuePair(0, NColor.Green), new NColorValuePair(60, NColor.Yellow), new NColorValuePair(120, NColor.Red) });

            m_AxisRange = new NRange(0, 130);

            // limit the axis range to 0, 130
            NCartesianAxis yAxis = m_Chart.Axes[ENCartesianAxis.PrimaryY];

            yAxis.ViewRangeMode     = ENAxisViewRangeMode.FixedRange;
            yAxis.MinViewRangeValue = m_AxisRange.Begin;
            yAxis.MaxViewRangeValue = m_AxisRange.End;
            m_Chart.Series.Add(m_Area);

            int indicatorCount = 10;

            m_IndicatorPhase = new double[indicatorCount];

            // add some data to the area series
            for (int i = 0; i < indicatorCount; i++)
            {
                m_IndicatorPhase[i] = i * 30;
                m_Area.DataPoints.Add(new NAreaDataPoint(0));
            }

            return(chartView);
        }
        void OnUpdateScale(NValueChangeEventArgs arg)
        {
            // add custom labels to the X axis
            NHierarchicalScale scale = new NHierarchicalScale();
            NHierarchicalScaleNodeCollection nodes = scale.ChildNodes;

            scale.FirstRowGridStyle       = (ENFirstRowGridStyle)m_FirstRowGridStyleComboBox.SelectedIndex;
            scale.GroupRowGridStyle       = (ENGroupRowGridStyle)m_GroupRowGridStyleComboBox.SelectedIndex;
            scale.InnerMajorTicks.Visible = false;
            scale.OuterMajorTicks.Visible = false;

            string[] months = new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

            for (int i = 0; i < 2; i++)
            {
                NHierarchicalScaleNode yearNode = new NHierarchicalScaleNode(0, (i + 2007).ToString());
                yearNode.LabelStyle.TickMode = (ENRangeLabelTickMode)m_GroupRowTickModeComboBox.SelectedIndex;
                nodes.AddChild(yearNode);

                for (int j = 0; j < 4; j++)
                {
                    NHierarchicalScaleNode quarterNode = new NHierarchicalScaleNode(3, "Q" + (j + 1).ToString());
                    quarterNode.LabelStyle.TickMode = (ENRangeLabelTickMode)m_GroupRowTickModeComboBox.SelectedIndex;
                    yearNode.Nodes.Add(quarterNode);

                    for (int k = 0; k < 3; k++)
                    {
                        NHierarchicalScaleNode monthNode = new NHierarchicalScaleNode(1, months[j * 3 + k]);
                        monthNode.LabelStyle.Angle    = new NScaleLabelAngle(90);
                        monthNode.LabelStyle.TickMode = (ENRangeLabelTickMode)m_FirstRowTickModeComboBox.SelectedIndex;
                        quarterNode.Nodes.Add(monthNode);
                    }
                }
            }

            // update control state
            m_FirstRowTickModeComboBox.Enabled = ((ENFirstRowGridStyle)m_FirstRowGridStyleComboBox.SelectedIndex) == ENFirstRowGridStyle.Individual;
            m_GroupRowTickModeComboBox.Enabled = ((ENGroupRowGridStyle)m_GroupRowGridStyleComboBox.SelectedIndex) == ENGroupRowGridStyle.Individual;

            NScaleStrip stripStyle = new NScaleStrip();

            stripStyle.Length   = 3;
            stripStyle.Interval = 3;
            stripStyle.Fill     = new NColorFill(NColor.FromColor(NColor.LightGray, 0.5f));
            scale.Strips.Add(stripStyle);

            scale.CreateSeparatorForEachLevel = m_CreateSeparatorForEachLevelCheckBox.Checked;

            m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale = scale;
        }
Example #21
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Value Timeline Scale";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            // configure axes
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // setup X axis
            NCartesianAxis axis = m_Chart.Axes[ENCartesianAxis.PrimaryX];

            m_TimeLineScale = new NValueTimelineScale();
            axis.Scale      = m_TimeLineScale;

            // setup primary Y axis
            axis = m_Chart.Axes[ENCartesianAxis.PrimaryY];
            NLinearScale linearScale = (NLinearScale)axis.Scale;

            // configure ticks and grid lines
            linearScale.MajorGridLines.Stroke   = new NStroke(NColor.LightGray);
            linearScale.InnerMajorTicks.Visible = false;

            // add interlaced stripe
            NScaleStrip strip = new NScaleStrip();

            strip.Fill       = new NColorFill(NColor.Beige);
            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // Setup the stock series
            m_Stock = new NStockSeries();
            m_Chart.Series.Add(m_Stock);

            m_Stock.DataLabelStyle = new NDataLabelStyle(false);
            m_Stock.CandleShape    = ENCandleShape.Stick;
            m_Stock.CandleWidth    = 4;
            m_Stock.UseXValues     = true;

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            OnWeeklyDataButtonClick(null);

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "XY Scatter Line";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // add interlaced stripe to the Y axis
            NScaleStrip stripStyle = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            chart.Axes[ENCartesianAxis.PrimaryY].Scale.Strips.Add(stripStyle);

            m_Line = new NLineSeries();
            chart.Series.Add(m_Line);

            m_Line.DataLabelStyle = new NDataLabelStyle(false);
            m_Line.InflateMargins = true;

            NMarkerStyle markerStyle = new NMarkerStyle();

            m_Line.MarkerStyle = markerStyle;

            markerStyle.Visible = true;
            markerStyle.Shape   = ENPointShape.Ellipse;
            markerStyle.Size    = new NSize(10, 10);
            markerStyle.Fill    = new NColorFill(ENNamedColor.Red);

            m_Line.Name       = "Line Series";
            m_Line.UseXValues = true;

            // add xy values
            m_Line.DataPoints.Add(new NLineDataPoint(15, 10));
            m_Line.DataPoints.Add(new NLineDataPoint(25, 23));
            m_Line.DataPoints.Add(new NLineDataPoint(45, 12));
            m_Line.DataPoints.Add(new NLineDataPoint(55, 21));
            m_Line.DataPoints.Add(new NLineDataPoint(61, 16));
            m_Line.DataPoints.Add(new NLineDataPoint(67, 19));
            m_Line.DataPoints.Add(new NLineDataPoint(72, 11));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Serialization";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;
            NScaleStrip  stripStyle  = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            linearScale.Strips.Add(stripStyle);

            // add the first bar
            m_Bar1                = new NBarSeries();
            m_Bar1.Name           = "Bar1";
            m_Bar1.MultiBarMode   = ENMultiBarMode.Series;
            m_Bar1.DataLabelStyle = new NDataLabelStyle(false);
            chart.Series.Add(m_Bar1);

            // add the second bar
            m_Bar2                = new NBarSeries();
            m_Bar2.Name           = "Bar2";
            m_Bar2.MultiBarMode   = ENMultiBarMode.Stacked;
            m_Bar2.DataLabelStyle = new NDataLabelStyle(false);
            chart.Series.Add(m_Bar2);

            // add the third bar
            m_Bar3                = new NBarSeries();
            m_Bar3.Name           = "Bar3";
            m_Bar3.MultiBarMode   = ENMultiBarMode.Stacked;
            m_Bar3.DataLabelStyle = new NDataLabelStyle(false);
            chart.Series.Add(m_Bar3);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            FillRandomData();

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Candle Stock";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // setup X axis
            NCartesianAxis axis = m_Chart.Axes[ENCartesianAxis.PrimaryX];

            axis.Scale = new NValueTimelineScale();

            // setup primary Y axis
            axis = m_Chart.Axes[ENCartesianAxis.PrimaryY];
            NLinearScale linearScale = (NLinearScale)axis.Scale;

            // configure ticks and grid lines
            linearScale.MajorGridLines.Stroke   = new NStroke(NColor.LightGray);
            linearScale.InnerMajorTicks.Visible = false;

            // add interlaced stripe
            NScaleStrip strip = new NScaleStrip();

            strip.Fill       = new NColorFill(NColor.Beige);
            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // Setup the stock series
            m_Stock = new NStockSeries();
            m_Chart.Series.Add(m_Stock);

            m_Stock.DataLabelStyle = new NDataLabelStyle(false);
            m_Stock.CandleShape    = ENCandleShape.Rectangle;
            m_Stock.CandleWidth    = 4;
            m_Stock.UseXValues     = true;

            GenerateData();

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Point";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;

            // setup point series
            m_Point = new NPointSeries();

            //m_Point.DataLabelStyle.ArrowLength = 20;

            m_Point.Name           = "Point Series";
            m_Point.InflateMargins = true;
            m_Point.DataLabelStyle = new NDataLabelStyle(false);

            m_Point.DataPoints.Add(new NPointDataPoint(23, "Item1"));
            m_Point.DataPoints.Add(new NPointDataPoint(67, "Item2"));
            m_Point.DataPoints.Add(new NPointDataPoint(78, "Item3"));
            m_Point.DataPoints.Add(new NPointDataPoint(12, "Item4"));
            m_Point.DataPoints.Add(new NPointDataPoint(56, "Item5"));
            m_Point.DataPoints.Add(new NPointDataPoint(43, "Item6"));
            m_Point.DataPoints.Add(new NPointDataPoint(37, "Item7"));
            m_Point.DataPoints.Add(new NPointDataPoint(51, "Item8"));

            m_Point.Fill = new NColorFill(NColor.Red);

            m_Chart.Series.Add(m_Point);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            return(chartView);
        }
Example #26
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            chartView.Surface.Titles[0].Text = "Axis Strips";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            // configure axes
            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);
            NLinearScale scaleY = (NLinearScale)chart.Axes[ENCartesianAxis.PrimaryY].Scale;

            // add interlaced stripe
            m_Strip            = new NScaleStrip(new NColorFill(NColor.DarkGray), null, true, 0, 0, 1, 1);
            m_Strip.Interlaced = true;
            scaleY.Strips.Add(m_Strip);

            // enable the major y grid lines
            scaleY.MajorGridLines = new NScaleGridLines();

            NOrdinalScale scaleX = (NOrdinalScale)chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            // enable the major x grid lines
            scaleX.MajorGridLines = new NScaleGridLines();

            // create dummy data
            NBarSeries bar = new NBarSeries();

            bar.Name           = "Bars";
            bar.DataLabelStyle = new NDataLabelStyle(false);
            Random random = new Random();

            for (int i = 0; i < 10; i++)
            {
                bar.DataPoints.Add(new NBarDataPoint(random.Next(100)));
            }

            chart.Series.Add(bar);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Date Time Scale";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XDateTimeYLinear);

            // add interlaced stripe to the Y axis
            NLinearScale yScale     = (NLinearScale)m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale;
            NScaleStrip  stripStyle = new NScaleStrip(new NColorFill(NColor.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            yScale.Strips.Add(stripStyle);

            // Add a line series (data will be generated with example controls)
            NLineSeries line = new NLineSeries();

            m_Chart.Series.Add(line);

            line.UseXValues = true;

            line.DataLabelStyle = new NDataLabelStyle(false);
            line.InflateMargins = true;

            NMarkerStyle markerStyle = new NMarkerStyle();

            markerStyle.Visible = true;
            line.MarkerStyle    = markerStyle;

            // create a date time scale
            m_DateTimeScale = (NDateTimeScale)m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale;

            m_DateTimeScale.Labels.Style.Angle            = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 90);
            m_DateTimeScale.Labels.Style.ContentAlignment = ENContentAlignment.TopCenter;

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Chart Orientation";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.Orientation = ENCartesianChartOrientation.LeftToRight;
            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // add a bar series
            m_Bar1 = new NBarSeries();
            m_Bar1.MultiBarMode = ENMultiBarMode.Series;
            m_Bar1.Name         = "Bar 1";

            NDataLabelStyle dataLabelStyle = new NDataLabelStyle();

            dataLabelStyle.Format  = "<value>";
            dataLabelStyle.Visible = true;

            m_Bar1.DataLabelStyle = dataLabelStyle;

            m_Bar1.LegendView.Mode = ENSeriesLegendMode.DataPoints;

            m_Chart.Series.Add(m_Bar1);

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, true));

            OnPositiveDataButtonClick(null);

            return(chartView);
        }
Example #29
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Cluster Bar Labels";

            // configure chart
            NCartesianChart chart = (NCartesianChart)chartView.Surface.Charts[0];

            chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            linearScale.Strips.Add(strip);

            // add a bar series
            m_Bar1                = new NBarSeries();
            m_Bar1.Name           = "Bar1";
            m_Bar1.MultiBarMode   = ENMultiBarMode.Series;
            m_Bar1.DataLabelStyle = CreateDataLabelStyle();
            m_Bar1.ValueFormatter = new NNumericValueFormatter("0.###");
            chart.Series.Add(m_Bar1);

            // add another bar series
            m_Bar2                = new NBarSeries();
            m_Bar2.Name           = "Bar2";
            m_Bar2.MultiBarMode   = ENMultiBarMode.Clustered;
            m_Bar2.DataLabelStyle = CreateDataLabelStyle();
            m_Bar2.ValueFormatter = new NNumericValueFormatter("0.###");
            chart.Series.Add(m_Bar2);

            FillRandomData();

            chartView.Document.StyleSheets.ApplyTheme(new NChartTheme(ENChartPalette.Bright, false));

            return(chartView);
        }
Example #30
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Axis Labels Formatting";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // add interlace stripe
            NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale;
            NScaleStrip  strip       = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1);

            strip.Interlaced = true;
            //linearScale.Strips.Add(strip);

            // setup a bar series
            NBarSeries bar = new NBarSeries();

            bar.Name           = "Bar Series";
            bar.InflateMargins = true;
            bar.UseXValues     = false;
            bar.DataLabelStyle = new NDataLabelStyle(false);

            // add some data to the bar series
            bar.LegendView.Mode = ENSeriesLegendMode.DataPoints;
            bar.DataPoints.Add(new NBarDataPoint(18, "C++"));
            bar.DataPoints.Add(new NBarDataPoint(15, "Ruby"));
            bar.DataPoints.Add(new NBarDataPoint(21, "Python"));
            bar.DataPoints.Add(new NBarDataPoint(23, "Java"));
            bar.DataPoints.Add(new NBarDataPoint(27, "Javascript"));
            bar.DataPoints.Add(new NBarDataPoint(29, "C#"));
            bar.DataPoints.Add(new NBarDataPoint(26, "PHP"));

            m_Chart.Series.Add(bar);

            return(chartView);
        }