/// <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; }
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; }
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(); }