コード例 #1
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Radar Line");

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

            // configure the chart
            m_Chart = new NRadarChart();
            nChartControl1.Charts.Clear();
            nChartControl1.Charts.Add(m_Chart);
            m_Chart.Wall(ChartWallType.Radar).BorderStyle.Color = Color.White;
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            m_Chart.DisplayOnLegend = nChartControl1.Legends[0];

            // set some axis labels
            AddAxis("Vitamin A");
            AddAxis("Vitamin B1");
            AddAxis("Vitamin B2");
            AddAxis("Vitamin B6");
            AddAxis("Vitamin B12");
            AddAxis("Vitamin C");
            AddAxis("Vitamin D");
            AddAxis("Vitamin E");

            m_Radar1 = new NRadarLineSeries();
            m_Chart.Series.Add(m_Radar1);
            m_Radar1.Name = "Series 1";
            m_Radar1.Values.FillRandomRange(Random, 8, 50, 90);
            m_Radar1.DataLabelStyle.Visible = false;
            m_Radar1.DataLabelStyle.Format  = "<value>";
            m_Radar1.MarkerStyle.Visible    = true;
            m_Radar1.MarkerStyle.PointShape = PointShape.Cylinder;
            m_Radar1.MarkerStyle.Width      = new NLength(1.6f, NRelativeUnit.ParentPercentage);
            m_Radar1.MarkerStyle.Height     = new NLength(1.6f, NRelativeUnit.ParentPercentage);

            m_Radar2 = new NRadarLineSeries();
            m_Chart.Series.Add(m_Radar2);
            m_Radar2.Name = "Series 2";
            m_Radar2.Values.FillRandomRange(Random, 8, 0, 100);
            m_Radar2.DataLabelStyle.Visible = false;
            m_Radar2.DataLabelStyle.Format  = "<value>";
            m_Radar2.MarkerStyle.Visible    = true;
            m_Radar2.MarkerStyle.PointShape = PointShape.Cylinder;
            m_Radar2.MarkerStyle.Width      = new NLength(1.6f, NRelativeUnit.ParentPercentage);
            m_Radar2.MarkerStyle.Height     = new NLength(1.6f, NRelativeUnit.ParentPercentage);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Bright);

            styleSheet.Apply(nChartControl1.Charts[0].Series);

            // apply layout
            ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]);

            // init form controls
            BeginAngleScrollBar.Value = 90 / 360.0;
            NExampleHelpers.FillComboWithEnumValues(TitleAngleModeComboBox, typeof(ScaleLabelAngleMode));
            TitleAngleModeComboBox.SelectedIndex = (int)ScaleLabelAngleMode.Scale;
        }
コード例 #2
0
        private void AddAxis(NRadarChart radarChart, string title)
        {
            NRadarAxis axis = new NRadarAxis();

            // set title
            axis.Title      = title;
            axis.TitleAngle = new NScaleLabelAngle(ScaleLabelAngleMode.View, 0);

            // setup scale
            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)axis.ScaleConfigurator;

            linearScale.RulerStyle.BorderStyle.Color        = Color.Silver;
            linearScale.InnerMajorTickStyle.LineStyle.Color = Color.Silver;
            linearScale.OuterMajorTickStyle.LineStyle.Color = Color.Silver;
            linearScale.InnerMajorTickStyle.Length          = new NLength(2, NGraphicsUnit.Point);
            linearScale.OuterMajorTickStyle.Length          = new NLength(2, NGraphicsUnit.Point);

            if (radarChart.Axes.Count == 0)
            {
                // if the first axis then configure grid style and stripes
                linearScale.MajorGridStyle.LineStyle.Color   = Color.Gainsboro;
                linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
                linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Radar, true);
            }
            else
            {
                // hide labels
                linearScale.AutoLabels = false;
            }

            radarChart.Axes.Add(axis);
        }
コード例 #3
0
        private void AddAxis(NRadarChart radar, string title, bool applyKFormatting)
        {
            NRadarAxis axis = new NRadarAxis();

            // set title
            axis.Title = title;
            radar.Axes.Add(axis);

            if (applyKFormatting)
            {
                NLinearScaleConfigurator linearScale = axis.ScaleConfigurator as NLinearScaleConfigurator;
                linearScale.LabelValueFormatter = new NNumericValueFormatter("0,K");
            }
        }
コード例 #4
0
        private void AddAxis(NRadarChart radar, string title, bool applyKFormatting)
        {
            NRadarAxis axis = new NRadarAxis();

            // set title
            axis.Title = title;
            radar.Axes.Add(axis);

            NLinearScale linearScale = axis.Scale as NLinearScale;

            linearScale.MajorGridLines.Visible = false;

            if (applyKFormatting)
            {
                linearScale.Labels.TextProvider = new NFormattedScaleLabelTextProvider(new NNumericValueFormatter("0,K"));
            }
        }
コード例 #5
0
        private void AddRadarAxis(NRadarChart chart, string title)
        {
            NRadarAxis axis = new NRadarAxis();

            // set title
            axis.Title = title;

            // the axis scale should start from 0
            axis.View = new NRangeAxisView(new NRange1DD(0, 0), true, false);

            // setup scale
            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)axis.ScaleConfigurator;

            linearScale.RulerStyle.BorderStyle.Color        = Color.Silver;
            linearScale.InnerMajorTickStyle.LineStyle.Color = Color.Silver;
            linearScale.OuterMajorTickStyle.LineStyle.Color = Color.Silver;
            linearScale.InnerMajorTickStyle.Length          = new NLength(2, NGraphicsUnit.Point);
            linearScale.OuterMajorTickStyle.Length          = new NLength(2, NGraphicsUnit.Point);

            if (chart.Axes.Count == 0)
            {
                // if the first axis then configure grid style and stripes
                linearScale.MajorGridStyle.LineStyle.Color   = Color.Gainsboro;
                linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
                linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Radar, true);

                // add interlaced stripe
                NScaleStripStyle strip = new NScaleStripStyle();
                strip.FillStyle  = new NColorFillStyle(Color.FromArgb(64, 200, 200, 200));
                strip.Interlaced = true;
                strip.SetShowAtWall(ChartWallType.Radar, true);
                linearScale.StripStyles.Add(strip);
            }
            else
            {
                // hide labels
                linearScale.AutoLabels = false;
            }

            chart.Axes.Add(axis);
        }
コード例 #6
0
        private void StackModeComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            NRadarChart                chart   = (NRadarChart)nChartControl1.Charts[0];
            NRadarAreaSeries           series1 = (NRadarAreaSeries)chart.Series[1];
            NRadarAreaSeries           series2 = (NRadarAreaSeries)chart.Series[2];
            NStandardScaleConfigurator scale   = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.Radar).ScaleConfigurator;

            switch (StackModeComboBox.SelectedIndex)
            {
            case 0:
                series1.MultiAreaMode     = MultiAreaMode.Stacked;
                series2.MultiAreaMode     = MultiAreaMode.Stacked;
                scale.LabelValueFormatter = new NNumericValueFormatter(NumericValueFormat.General);
                break;

            case 1:
                series1.MultiAreaMode     = MultiAreaMode.StackedPercent;
                series2.MultiAreaMode     = MultiAreaMode.StackedPercent;
                scale.LabelValueFormatter = new NNumericValueFormatter(NumericValueFormat.Percentage);
                break;
            }

            nChartControl1.Refresh();
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                StackModeDropDownList.Items.Clear();
                StackModeDropDownList.Items.Add("Stacked");
                StackModeDropDownList.Items.Add("Stacked %");
                StackModeDropDownList.SelectedIndex = 0;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Stacked Radar Area");

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

            // configure the chart
            NRadarChart radarChart = new NRadarChart();

            nChartControl1.Charts.Clear();
            nChartControl1.Charts.Add(radarChart);
            radarChart.Wall(ChartWallType.Radar).BorderStyle.Color = Color.White;
            radarChart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            radarChart.DisplayOnLegend = nChartControl1.Legends[0];

            AddAxis(radarChart, "Category A");
            AddAxis(radarChart, "Category B");
            AddAxis(radarChart, "Category C");
            AddAxis(radarChart, "Category D");
            AddAxis(radarChart, "Category E");

            // create the radar series
            NRadarAreaSeries radarArea0 = new NRadarAreaSeries();

            radarChart.Series.Add(radarArea0);
            radarArea0.Name = "Series 1";
            radarArea0.Values.FillRandomRange(Random, 5, 50, 90);
            radarArea0.DataLabelStyle.Visible = false;
            radarArea0.DataLabelStyle.Format  = "<value>";
            radarArea0.MarkerStyle.AutoDepth  = true;
            radarArea0.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea0.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            NRadarAreaSeries radarArea1 = new NRadarAreaSeries();

            radarChart.Series.Add(radarArea1);
            radarArea1.Name = "Series 2";
            radarArea1.Values.FillRandomRange(Random, 5, 0, 100);
            radarArea1.DataLabelStyle.Visible = false;
            radarArea1.DataLabelStyle.Format  = "<value>";
            radarArea1.MarkerStyle.AutoDepth  = true;
            radarArea1.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea1.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            NRadarAreaSeries radarArea2 = new NRadarAreaSeries();

            radarChart.Series.Add(radarArea2);
            radarArea2.Name = "Series 3";
            radarArea2.Values.FillRandomRange(Random, 5, 0, 100);
            radarArea2.DataLabelStyle.Visible = false;
            radarArea2.DataLabelStyle.Format  = "<value>";
            radarArea2.MarkerStyle.AutoDepth  = true;
            radarArea2.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea2.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            // set the stack mode
            if (StackModeDropDownList.SelectedIndex == 0)
            {
                radarArea1.MultiAreaMode = MultiAreaMode.Stacked;
                radarArea2.MultiAreaMode = MultiAreaMode.Stacked;
            }
            else
            {
                radarArea1.MultiAreaMode = MultiAreaMode.StackedPercent;
                radarArea2.MultiAreaMode = MultiAreaMode.StackedPercent;
            }

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Bright);

            styleSheet.Apply(nChartControl1.Charts[0].Series);

            radarArea0.FillStyle.SetTransparencyPercent(20);
            radarArea1.FillStyle.SetTransparencyPercent(20);
            radarArea2.FillStyle.SetTransparencyPercent(20);

            // apply layout template
            ApplyLayoutTemplate(0, nChartControl1, radarChart, title, nChartControl1.Legends[0]);
        }
コード例 #8
0
        public override void Initialize()
        {
            base.Initialize();

            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel title = new NLabel("Montana County Comparison<br/><font size = '9pt'>Demonstrates how to create a multi measure radar chart</font>");

            title.TextStyle.FontStyle  = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.TextFormat = TextFormat.XML;
            title.ContentAlignment     = ContentAlignment.BottomRight;
            title.Location             = new NPointL(new NLength(2, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));
            title.DockMode             = PanelDockMode.Top;
            title.Margins = new NMarginsL(0, 5, 0, 5);
            nChartControl1.Panels.Add(title);

            NLegend legend = new NLegend();

            legend.DockMode = PanelDockMode.Right;
            legend.Margins  = new NMarginsL(5, 0, 5, 0);
            nChartControl1.Panels.Add(legend);

            // setup chart
            NRadarChart radarChart = new NRadarChart();

            radarChart.Margins = new NMarginsL(5, 0, 0, 5);
            nChartControl1.Panels.Add(radarChart);
            radarChart.DisplayOnLegend = legend;
            radarChart.DockMode        = PanelDockMode.Fill;
            radarChart.RadarMode       = RadarMode.MultiMeasure;
            radarChart.InnerRadius     = new NLength(10, NRelativeUnit.ParentPercentage);

            // set some axis labels
            AddAxis(radarChart, "Population", true);
            AddAxis(radarChart, "Housing Units", true);
            AddAxis(radarChart, "Water", false);
            AddAxis(radarChart, "Land", true);
            AddAxis(radarChart, "Population\r\nDensity", false);
            AddAxis(radarChart, "Housing\r\nDensity", false);

            float angleStep = 180.0f / (radarChart.Axes.Count - 1);

            for (int i = 0; i < radarChart.Axes.Count; i++)
            {
                NRadarAxis radarAxis = (NRadarAxis)radarChart.Axes[i];

                ((NRadarAxisAnchor)radarAxis.Anchor).UseCustomAngle = true;
                ((NRadarAxisAnchor)radarAxis.Anchor).CustomAngle    = i * angleStep;
            }

            // sample data
            object[] data = new object[] {
                "Cascade County", 80357, 35225, 13.75, 2697.90, 29.8, 13.1,
                "Custer County", 11696, 5360, 10.09, 3783.13, 3.1, 1.4,
                "Dawson County", 9059, 4168, 9.99, 2373.14, 3.8, 1.8,
                "Jefferson County", 10049, 4199, 2.19, 1656.64, 6.1, 2.5,
                "Missoula County", 95802, 41319, 20.37, 2597.97, 36.9, 15.9,
                "Powell County", 7180, 2930, 6.74, 2325.94, 3.1, 1.3
            };

            for (int i = 0; i < 6; i++)
            {
                NRadarLineSeries radarLine = new NRadarLineSeries();
                radarChart.Series.Add(radarLine);

                int baseIndex = i * 7;
                radarLine.Name = data[baseIndex].ToString();
                baseIndex      = baseIndex + 1;

                for (int j = 0; j < 6; j++)
                {
                    radarLine.Values.Add(System.Convert.ToDouble(data[baseIndex]));
                    baseIndex = baseIndex + 1;
                }

                radarLine.DataLabelStyle.Visible = false;
                radarLine.MarkerStyle.Width      = new NLength(4);
                radarLine.MarkerStyle.Height     = new NLength(4);
                radarLine.MarkerStyle.Visible    = true;
                radarLine.BorderStyle.Width      = new NLength(2);
                //radarLine.CloseContour = false;
            }

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);
        }
コード例 #9
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Stacked Radar Area");

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

            // configure the chart
            m_Chart = new NRadarChart();
            nChartControl1.Charts.Clear();
            nChartControl1.Charts.Add(m_Chart);
            m_Chart.Wall(ChartWallType.Radar).BorderStyle.Color = Color.White;
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            m_Chart.DisplayOnLegend = nChartControl1.Legends[0];

            AddAxis("Category A");
            AddAxis("Category B");
            AddAxis("Category C");
            AddAxis("Category D");
            AddAxis("Category E");

            // create the radar series
            NRadarAreaSeries radarArea0 = new NRadarAreaSeries();

            m_Chart.Series.Add(radarArea0);
            radarArea0.Name = "Series 1";
            radarArea0.Values.FillRandomRange(Random, 5, 50, 90);
            radarArea0.DataLabelStyle.Visible = false;
            radarArea0.DataLabelStyle.Format  = "<value>";
            radarArea0.MarkerStyle.AutoDepth  = true;
            radarArea0.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea0.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            NRadarAreaSeries radarArea1 = new NRadarAreaSeries();

            m_Chart.Series.Add(radarArea1);
            radarArea1.Name = "Series 2";
            radarArea1.Values.FillRandomRange(Random, 5, 0, 100);
            radarArea1.DataLabelStyle.Visible = false;
            radarArea1.DataLabelStyle.Format  = "<value>";
            radarArea1.MarkerStyle.AutoDepth  = true;
            radarArea1.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea1.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            // stack the second radar area series
            radarArea1.MultiAreaMode = MultiAreaMode.Stacked;

            NRadarAreaSeries radarArea2 = new NRadarAreaSeries();

            m_Chart.Series.Add(radarArea2);
            radarArea2.Name = "Series 3";
            radarArea2.Values.FillRandomRange(Random, 5, 0, 100);
            radarArea2.DataLabelStyle.Visible = false;
            radarArea2.DataLabelStyle.Format  = "<value>";
            radarArea2.MarkerStyle.AutoDepth  = true;
            radarArea2.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea2.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            // stack the third radar area series
            radarArea2.MultiAreaMode = MultiAreaMode.Stacked;

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Bright);

            styleSheet.Apply(nChartControl1.Charts[0].Series);

            radarArea0.FillStyle.SetTransparencyPercent(20);
            radarArea1.FillStyle.SetTransparencyPercent(20);
            radarArea2.FillStyle.SetTransparencyPercent(20);

            // apply layout
            ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]);

            // init form controls
            BeginAngleScrollBar.Value = 90 / 360.0;
            NExampleHelpers.FillComboWithEnumValues(TitleAngleModeComboBox, typeof(ScaleLabelAngleMode));
            TitleAngleModeComboBox.SelectedIndex = (int)ScaleLabelAngleMode.Scale;

            StackModeComboBox.Items.Add("Stacked");
            StackModeComboBox.Items.Add("Stacked %");
            StackModeComboBox.SelectedIndex = 0;
        }
コード例 #10
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Radar Area");

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

            // configure the chart
            m_Chart = new NRadarChart();
            nChartControl1.Charts.Clear();
            nChartControl1.Charts.Add(m_Chart);
            m_Chart.Wall(ChartWallType.Radar).BorderStyle.Color = Color.White;
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            m_Chart.DisplayOnLegend = nChartControl1.Legends[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");

            // create the radar series
            m_RadarArea1 = new NRadarAreaSeries();
            m_Chart.Series.Add(m_RadarArea1);
            m_RadarArea1.Name = "Series 1";
            m_RadarArea1.Values.FillRandomRange(Random, 8, 50, 90);
            m_RadarArea1.DataLabelStyle.Visible = false;
            m_RadarArea1.DataLabelStyle.Format  = "<value>";
            m_RadarArea1.MarkerStyle.AutoDepth  = true;
            m_RadarArea1.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            m_RadarArea1.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            m_RadarArea2 = new NRadarAreaSeries();
            m_Chart.Series.Add(m_RadarArea2);
            m_RadarArea2.Name = "Series 2";
            m_RadarArea2.Values.FillRandomRange(Random, 8, 0, 100);
            m_RadarArea2.DataLabelStyle.Visible = false;
            m_RadarArea2.DataLabelStyle.Format  = "<value>";
            m_RadarArea2.MarkerStyle.AutoDepth  = true;
            m_RadarArea2.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            m_RadarArea2.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Charts[0].Series);

            m_RadarArea1.FillStyle.SetTransparencyPercent(50);
            m_RadarArea2.FillStyle.SetTransparencyPercent(60);

            // apply layout
            ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]);

            // init form controls
            BeginAngleUpDown.Value = 90;

            TitleAngleModeComboBox.FillFromEnum(typeof(ScaleLabelAngleMode));
            TitleAngleModeComboBox.SelectedIndex = (int)ScaleLabelAngleMode.Scale;
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                WebExamplesUtilities.FillComboWithEnumValues(MarkerShapeDropDownList, typeof(PointShape));
                MarkerShapeDropDownList.SelectedIndex = 1;

                WebExamplesUtilities.FillComboWithColorNames(RadarColor1DropDownList, KnownColor.SlateBlue);
                WebExamplesUtilities.FillComboWithColorNames(RadarColor2DropDownList, KnownColor.Crimson);

                ShowMarkersCheckBox.Checked = true;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Radar Area");

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

            // create and configure a radar chart
            NRadarChart radarChart = new NRadarChart();

            nChartControl1.Charts.Clear();
            nChartControl1.Charts.Add(radarChart);
            radarChart.BoundsMode = BoundsMode.Fit;
            radarChart.Location   = new NPointL(new NLength(0, NRelativeUnit.ParentPercentage), new NLength(0, NRelativeUnit.ParentPercentage));
            radarChart.Size       = new NSizeL(new NLength(100, NRelativeUnit.ParentPercentage), new NLength(100, NRelativeUnit.ParentPercentage));
            radarChart.Padding    = new NMarginsL(7, 7, 7, 7);

            // set some axis labels
            AddAxis(radarChart, "Vitamin A");
            AddAxis(radarChart, "Vitamin B1");
            AddAxis(radarChart, "Vitamin B2");
            AddAxis(radarChart, "Vitamin B6");
            AddAxis(radarChart, "Vitamin B12");
            AddAxis(radarChart, "Vitamin C");
            AddAxis(radarChart, "Vitamin D");
            AddAxis(radarChart, "Vitamin E");

            Color color1 = WebExamplesUtilities.ColorFromDropDownList(RadarColor1DropDownList);
            Color color2 = WebExamplesUtilities.ColorFromDropDownList(RadarColor2DropDownList);

            // setup radar series 1
            NRadarAreaSeries radarArea1 = (NRadarAreaSeries)radarChart.Series.Add(SeriesType.RadarArea);

            radarArea1.Name = "Series 1";
            radarArea1.DataLabelStyle.Visible = ShowDataLabelsCheckBox.Checked;
            radarArea1.DataLabelStyle.Format  = "<value>";
            radarArea1.BorderStyle.Color      = color1;
            radarArea1.FillStyle                     = new NColorFillStyle(Color.FromArgb(125, color1));
            radarArea1.MarkerStyle.Visible           = ShowMarkersCheckBox.Checked;
            radarArea1.MarkerStyle.PointShape        = (PointShape)MarkerShapeDropDownList.SelectedIndex;
            radarArea1.MarkerStyle.Height            = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea1.MarkerStyle.Width             = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea1.MarkerStyle.FillStyle         = new NColorFillStyle(color1);
            radarArea1.MarkerStyle.BorderStyle.Color = color1;
            radarArea1.Values.FillRandomRange(Random, 8, 0, 100);

            // setup radar series 2
            NRadarAreaSeries radarArea2 = (NRadarAreaSeries)radarChart.Series.Add(SeriesType.RadarArea);

            radarArea2.Name = "Series 2";
            radarArea2.DataLabelStyle.Visible = ShowDataLabelsCheckBox.Checked;
            radarArea2.DataLabelStyle.Format  = "<value>";
            radarArea2.BorderStyle.Color      = color2;
            radarArea2.FillStyle                     = new NColorFillStyle(Color.FromArgb(125, color2));
            radarArea2.MarkerStyle.Visible           = ShowMarkersCheckBox.Checked;
            radarArea2.MarkerStyle.PointShape        = (PointShape)MarkerShapeDropDownList.SelectedIndex;
            radarArea2.MarkerStyle.Height            = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea2.MarkerStyle.Width             = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            radarArea2.MarkerStyle.FillStyle         = new NColorFillStyle(color2);
            radarArea2.MarkerStyle.BorderStyle.Color = color2;
            radarArea2.Values.FillRandomRange(Random, 8, 0, 100);
        }
コード例 #12
0
        public override void Initialize()
        {
            base.Initialize();

            nChartControl1.Panels.Clear();

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

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

            // configure the chart
            NRadarChart chart = new NRadarChart();

            nChartControl1.Charts.Add(chart);

            AddRadarAxis(chart, "Category A");
            AddRadarAxis(chart, "Category B");
            AddRadarAxis(chart, "Category C");
            AddRadarAxis(chart, "Category D");
            AddRadarAxis(chart, "Category E");
            AddRadarAxis(chart, "Category F");
            AddRadarAxis(chart, "Category G");

            // radar area series 1
            NRadarAreaSeries series1 = (NRadarAreaSeries)chart.Series.Add(SeriesType.RadarArea);

            series1.FillStyle                = new NColorFillStyle(DarkOrange);
            series1.BorderStyle.Color        = DarkOrange;
            series1.DataLabelStyle.Visible   = true;
            series1.DataLabelStyle.VertAlign = VertAlign.Top;
            series1.DataLabelStyle.ArrowStrokeStyle.Color = DarkOrange;
            series1.DataLabelStyle.TextStyle.BackplaneStyle.StandardFrameStyle.InnerBorderColor = DarkOrange;

            // radar area series 2
            NRadarAreaSeries series2 = (NRadarAreaSeries)chart.Series.Add(SeriesType.RadarArea);

            series2.FillStyle                = new NColorFillStyle(LightOrange);
            series2.BorderStyle.Color        = LightOrange;
            series2.DataLabelStyle.Visible   = true;
            series2.DataLabelStyle.VertAlign = VertAlign.Top;
            series2.DataLabelStyle.ArrowStrokeStyle.Color = LightOrange;
            series2.DataLabelStyle.TextStyle.BackplaneStyle.StandardFrameStyle.InnerBorderColor = LightOrange;

            // label layout settings
            chart.LabelLayout.EnableInitialPositioning = true;
            chart.LabelLayout.EnableLabelAdjustment    = true;

            NSizeL safeguardSize = new NSizeL(
                new NLength(1.3f, NRelativeUnit.ParentPercentage),
                new NLength(1.3f, NRelativeUnit.ParentPercentage));

            series1.LabelLayout.EnableDataPointSafeguard = true;
            series1.LabelLayout.UseLabelLocations        = true;
            series1.LabelLayout.OutOfBoundsLocationMode  = OutOfBoundsLocationMode.PushWithinBounds;
            series1.LabelLayout.InvertLocationsIfIgnored = false;
            series1.LabelLayout.DataPointSafeguardSize   = safeguardSize;

            series2.LabelLayout.EnableDataPointSafeguard = true;
            series2.LabelLayout.UseLabelLocations        = true;
            series2.LabelLayout.OutOfBoundsLocationMode  = OutOfBoundsLocationMode.PushWithinBounds;
            series2.LabelLayout.InvertLocationsIfIgnored = false;
            series2.LabelLayout.DataPointSafeguardSize   = safeguardSize;

            // fill with random data
            GenerateData(series1, series2);

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

            // init form controls
            EnableInitialPositioningCheck.Checked = true;
            EnableLabelAdjustmentCheck.Checked    = true;
            StackRadarAreasCheck.Checked          = false;
        }
コード例 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                EnableInitialPositioningCheckBox.Checked = true;
                EnableLabelAdjustmentCheckBox.Checked    = true;
                StackRadarAreasCheckBox.Checked          = false;

                HiddenField1.Value = Random.Next().ToString();
            }

            nChartControl1.Settings.JitterMode = JitterMode.Enabled;
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            nChartControl1.Panels.Clear();

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

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

            // configure the chart
            NRadarChart chart = new NRadarChart();

            chart.Location = new NPointL(new NLength(5, NRelativeUnit.ParentPercentage), new NLength(5, NRelativeUnit.ParentPercentage));
            chart.Size     = new NSizeL(new NLength(90, NRelativeUnit.ParentPercentage), new NLength(90, NRelativeUnit.ParentPercentage));
            nChartControl1.Charts.Add(chart);

            AddRadarAxis(chart, "Category A");
            AddRadarAxis(chart, "Category B");
            AddRadarAxis(chart, "Category C");
            AddRadarAxis(chart, "Category D");
            AddRadarAxis(chart, "Category E");
            AddRadarAxis(chart, "Category F");
            AddRadarAxis(chart, "Category G");

            // radar area series 1
            NRadarAreaSeries series1 = (NRadarAreaSeries)chart.Series.Add(SeriesType.RadarArea);

            series1.FillStyle                = new NColorFillStyle(DarkOrange);
            series1.BorderStyle.Color        = DarkOrange;
            series1.DataLabelStyle.Visible   = true;
            series1.DataLabelStyle.VertAlign = VertAlign.Top;
            series1.DataLabelStyle.ArrowStrokeStyle.Color = DarkOrange;
            series1.DataLabelStyle.TextStyle.BackplaneStyle.StandardFrameStyle.InnerBorderColor = DarkOrange;
            series1.DataLabelStyle.TextStyle.FontStyle.EmSize = new NLength(8);

            // radar area series 2
            NRadarAreaSeries series2 = (NRadarAreaSeries)chart.Series.Add(SeriesType.RadarArea);

            series2.FillStyle                = new NColorFillStyle(Red);
            series2.BorderStyle.Color        = Red;
            series2.BorderStyle.Width        = new NLength(0);
            series2.DataLabelStyle.Visible   = true;
            series2.DataLabelStyle.VertAlign = VertAlign.Top;
            series2.DataLabelStyle.ArrowStrokeStyle.Color = Red;
            series2.DataLabelStyle.TextStyle.BackplaneStyle.StandardFrameStyle.InnerBorderColor = Red;
            series2.DataLabelStyle.TextStyle.FontStyle.EmSize = new NLength(8);

            // stack / unstack the second radar area series
            if (StackRadarAreasCheckBox.Checked)
            {
                series2.MultiAreaMode = MultiAreaMode.Stacked;
            }
            else
            {
                series2.MultiAreaMode = MultiAreaMode.Series;
            }

            // label layout settings
            chart.LabelLayout.EnableInitialPositioning = EnableInitialPositioningCheckBox.Checked;
            chart.LabelLayout.EnableLabelAdjustment    = EnableLabelAdjustmentCheckBox.Checked;

            NSizeL safeguardSize = new NSizeL(
                new NLength(1.3f, NRelativeUnit.ParentPercentage),
                new NLength(1.3f, NRelativeUnit.ParentPercentage));

            series1.LabelLayout.EnableDataPointSafeguard = true;
            series1.LabelLayout.UseLabelLocations        = true;
            series1.LabelLayout.OutOfBoundsLocationMode  = OutOfBoundsLocationMode.PushWithinBounds;
            series1.LabelLayout.InvertLocationsIfIgnored = false;
            series1.LabelLayout.DataPointSafeguardSize   = safeguardSize;

            series2.LabelLayout.EnableDataPointSafeguard = true;
            series2.LabelLayout.UseLabelLocations        = true;
            series2.LabelLayout.OutOfBoundsLocationMode  = OutOfBoundsLocationMode.PushWithinBounds;
            series2.LabelLayout.InvertLocationsIfIgnored = false;
            series2.LabelLayout.DataPointSafeguardSize   = safeguardSize;

            // fill with random data
            GenerateData(series1, series2);
        }
コード例 #14
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Radar Axis Titles<br/><font size = '12pt'>Demonstrates various radar axis title properties</font>");

            title.TextStyle.FontStyle  = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.TextFormat = TextFormat.XML;

            // configure the chart
            m_Chart = new NRadarChart();
            nChartControl1.Charts.Clear();
            nChartControl1.Charts.Add(m_Chart);
            m_Chart.Wall(ChartWallType.Radar).BorderStyle.Color = Color.White;
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            m_Chart.DisplayOnLegend = nChartControl1.Legends[0];

            AddAxis("<b>Vitamin A</b><br/><font size='8pt'>(etinol, retinal and four carotenoids including beta carotene</font>");
            AddAxis("<b>Vitamin B1</b><br/><font size='8pt'>thiamin or vitamin B1</font>");
            AddAxis("<b>Vitamin B2</b><br/><font size='8pt'>easily absorbed micronutrient</font>");
            AddAxis("<b>Vitamin B6</b><br/><font size='8pt'>water-soluble vitamin part of the vitamin B complex group</font>");
            AddAxis("<b>Vitamin B12</b><br/><font size='8pt'>also called cobalamin, is a water-soluble vitamin</font>");
            AddAxis("<b>Vitamin C</b><br/><font size='8pt'>or L-ascorbic acid or L-ascorbate is an essential nutrient for humans</font>");
            AddAxis("<b>Vitamin D</b><br/><font size='8pt'>a group of fat-soluble secosteroids</font>");
            AddAxis("<b>Vitamin E</b><br/><font size='8pt'>refers to a group of eight fat-soluble compounds</font>");

            // create the radar series
            m_RadarArea1 = new NRadarAreaSeries();
            m_Chart.Series.Add(m_RadarArea1);
            m_RadarArea1.Name = "Series 1";
            m_RadarArea1.Values.FillRandomRange(Random, 8, 50, 90);
            m_RadarArea1.DataLabelStyle.Visible = false;
            m_RadarArea1.DataLabelStyle.Format  = "<value>";
            m_RadarArea1.MarkerStyle.AutoDepth  = true;
            m_RadarArea1.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            m_RadarArea1.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            m_RadarArea2 = new NRadarAreaSeries();
            m_Chart.Series.Add(m_RadarArea2);
            m_RadarArea2.Name = "Series 2";
            m_RadarArea2.Values.FillRandomRange(Random, 8, 0, 100);
            m_RadarArea2.DataLabelStyle.Visible = false;
            m_RadarArea2.DataLabelStyle.Format  = "<value>";
            m_RadarArea2.MarkerStyle.AutoDepth  = true;
            m_RadarArea2.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            m_RadarArea2.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Charts[0].Series);

            m_RadarArea1.FillStyle.SetTransparencyPercent(50);
            m_RadarArea2.FillStyle.SetTransparencyPercent(60);

            // apply layout
            ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]);

            // init form controls
            BeginAngleUpDown.Value = 90;

            m_Updating = true;

            TitleAngleModeComboBox.FillFromEnum(typeof(ScaleLabelAngleMode));
            TitleAngleModeComboBox.SelectedIndex = (int)ScaleLabelAngleMode.View;

            TitlePositionModeComboBox.FillFromEnum(typeof(RadarTitlePositionMode));
            TitlePositionModeComboBox.SelectedIndex = (int)RadarTitlePositionMode.Center;

            TitleFitModeComboBox.FillFromEnum(typeof(RadarTitleFitMode));
            TitleFitModeComboBox.SelectedIndex = (int)RadarTitleFitMode.Wrap;

            TitleOffsetNumericUpDown.Value   = 5;
            TitleMaxWidthNumericUpDown.Value = 100;


            m_Updating = false;

            UpdateTitleLabels();
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // init example controls
                WebExamplesUtilities.FillComboWithValues(TitleOffsetDropDownList, 0, 50, 5);
                TitleOffsetDropDownList.SelectedIndex = 1;

                WebExamplesUtilities.FillComboWithEnumValues(TitleAngleModeDropDownList, typeof(ScaleLabelAngleMode));
                TitleAngleModeDropDownList.SelectedIndex = (int)ScaleLabelAngleMode.View;

                WebExamplesUtilities.FillComboWithValues(TitleAngleDropDownList, 0, 360, 10);
                TitleAngleDropDownList.SelectedIndex = 0;

                WebExamplesUtilities.FillComboWithEnumValues(TitlePositionModeDropDownList, typeof(RadarTitlePositionMode));
                TitlePositionModeDropDownList.SelectedIndex = (int)RadarTitlePositionMode.Center;

                WebExamplesUtilities.FillComboWithEnumValues(TitleFitModeDropDownList, typeof(RadarTitleFitMode));
                TitleFitModeDropDownList.SelectedIndex = (int)RadarTitleFitMode.Wrap;

                WebExamplesUtilities.FillComboWithValues(TitleMaxWidthDropDownList, 30, 200, 10);
                TitleMaxWidthDropDownList.SelectedIndex = 2;
            }

            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

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

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
            title.DockMode = PanelDockMode.Top;
            title.Margins  = new NMarginsL(10, 10, 10, 10);

            // hide the legend
            nChartControl1.Legends[0].Visible = false;

            // configure the chart
            NRadarChart chart = new NRadarChart();

            nChartControl1.Charts.Clear();
            nChartControl1.Charts.Add(chart);
            chart.DockMode = PanelDockMode.Fill;
            chart.Margins  = new NMarginsL(10, 0, 10, 10);
            chart.Wall(ChartWallType.Radar).BorderStyle.Color = Color.White;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            chart.DisplayOnLegend = nChartControl1.Legends[0];

            AddAxis(chart, "<b>Vitamin A</b><br/><font size='7pt'>etinol or retinal</font>");
            AddAxis(chart, "<b>Vitamin B1</b><br/><font size='7pt'>thiamin or vitamin B1</font>");
            AddAxis(chart, "<b>Vitamin B12</b><br/><font size='7pt'>also called cobalamin</font>");
            AddAxis(chart, "<b>Vitamin C</b><br/><font size='7pt'>L-ascorbic acid or L-ascorbate</font>");
            AddAxis(chart, "<b>Vitamin D</b><br/><font size='7pt'>group of fat-soluble secosteroids</font>");
            AddAxis(chart, "<b>Vitamin E</b><br/><font size='7pt'>group of eight fat-soluble compounds</font>");

            // create the radar series
            NRadarAreaSeries m_RadarArea1 = new NRadarAreaSeries();

            chart.Series.Add(m_RadarArea1);
            m_RadarArea1.Name = "Series 1";
            m_RadarArea1.Values.FillRandomRange(Random, 8, 50, 90);
            m_RadarArea1.DataLabelStyle.Visible = false;
            m_RadarArea1.DataLabelStyle.Format  = "<value>";
            m_RadarArea1.MarkerStyle.AutoDepth  = true;
            m_RadarArea1.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            m_RadarArea1.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            NRadarAreaSeries m_RadarArea2 = new NRadarAreaSeries();

            chart.Series.Add(m_RadarArea2);
            m_RadarArea2.Name = "Series 2";
            m_RadarArea2.Values.FillRandomRange(Random, 8, 0, 100);
            m_RadarArea2.DataLabelStyle.Visible = false;
            m_RadarArea2.DataLabelStyle.Format  = "<value>";
            m_RadarArea2.MarkerStyle.AutoDepth  = true;
            m_RadarArea2.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            m_RadarArea2.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Bright);

            styleSheet.Apply(nChartControl1.Charts[0].Series);

            m_RadarArea1.FillStyle.SetTransparencyPercent(50);
            m_RadarArea2.FillStyle.SetTransparencyPercent(60);

            // update title labels
            ScaleLabelAngleMode mode = (ScaleLabelAngleMode)TitleAngleModeDropDownList.SelectedIndex;
            float angle = (float)TitleAngleDropDownList.SelectedIndex * 10;

            for (int i = 0; i < chart.Axes.Count; i++)
            {
                NRadarAxis axis = (NRadarAxis)chart.Axes[i];

                axis.TitleAngle              = new NScaleLabelAngle(mode, angle);
                axis.TitleOffset             = new NLength((float)TitleOffsetDropDownList.SelectedIndex * 5);
                axis.TitlePositionMode       = (RadarTitlePositionMode)TitlePositionModeDropDownList.SelectedIndex;
                axis.TitleFitMode            = (RadarTitleFitMode)TitleFitModeDropDownList.SelectedIndex;
                axis.TitleMaxWidth           = new NLength((float)TitleMaxWidthDropDownList.SelectedIndex * 10 + 30);
                axis.TitleAutomaticAlignment = TitleAutomaticAlignmentCheck.Checked;
            }

            TitleMaxWidthDropDownList.Enabled = TitleFitModeDropDownList.SelectedIndex == (int)RadarTitleFitMode.Wrap;
        }