private void AddDataPoints(NBubbleSeries bubble) { NChartPalette palette = new NChartPalette(); palette.SetPredefinedPalette(ChartPredefinedPalette.Dark); NColorFillStyle fs0 = new NColorFillStyle(palette.SeriesColors[0]); NColorFillStyle fs1 = new NColorFillStyle(palette.SeriesColors[1]); NColorFillStyle fs2 = new NColorFillStyle(palette.SeriesColors[2]); NColorFillStyle fs3 = new NColorFillStyle(palette.SeriesColors[3]); NColorFillStyle fs4 = new NColorFillStyle(palette.SeriesColors[4]); NColorFillStyle fs5 = new NColorFillStyle(palette.SeriesColors[5]); if (LightingFilterCheckBox.Checked) { fs0.ImageFiltersStyle.Filters.Add(CreateLightingImageFilter()); fs1.ImageFiltersStyle.Filters.Add(CreateLightingImageFilter()); fs2.ImageFiltersStyle.Filters.Add(CreateLightingImageFilter()); fs3.ImageFiltersStyle.Filters.Add(CreateLightingImageFilter()); fs4.ImageFiltersStyle.Filters.Add(CreateLightingImageFilter()); fs5.ImageFiltersStyle.Filters.Add(CreateLightingImageFilter()); } bubble.AddDataPoint(new NBubbleDataPoint(27, 51, 1147995904, "India", fs0)); bubble.AddDataPoint(new NBubbleDataPoint(50, 67, 1321851888, "China", fs1)); bubble.AddDataPoint(new NBubbleDataPoint(76, 22, 109955400, "Mexico", fs2)); bubble.AddDataPoint(new NBubbleDataPoint(210, 9, 142008838, "Russia", fs3)); bubble.AddDataPoint(new NBubbleDataPoint(360, 4, 305843000, "USA", fs4)); bubble.AddDataPoint(new NBubbleDataPoint(470, 5, 33560000, "Canada", fs5)); }
public override void Initialize() { base.Initialize(); nChartControl1.Controller.Tools.Add(new NPanelSelectorTool()); nChartControl1.Controller.Tools.Add(new NTrackballTool()); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("Jittering / Blur Effect"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); m_Chart = nChartControl1.Charts[0]; m_Chart.Enable3D = true; m_Chart.Axis(StandardAxis.Depth).Visible = false; m_Chart.Depth = 34; m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.NorthernLights); m_Chart.Projection.Type = ProjectionType.Perspective; m_Chart.Projection.Elevation = 17; m_Chart.Projection.Rotation = -10; Color c = Color.FromArgb(128, 128, 192); m_Chart.Wall(ChartWallType.Left).FillStyle = new NGradientFillStyle(GradientStyle.DiagonalDown, GradientVariant.Variant3, c, Color.White); m_Chart.Wall(ChartWallType.Floor).FillStyle = new NGradientFillStyle(GradientStyle.DiagonalUp, GradientVariant.Variant3, c, Color.White); m_Chart.Wall(ChartWallType.Back).FillStyle = new NGradientFillStyle(GradientStyle.DiagonalDown, GradientVariant.Variant3, c, Color.White); NBubbleSeries bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble); bubble.InflateMargins = false; bubble.DataLabelStyle.Visible = false; bubble.Legend.Mode = SeriesLegendMode.DataPoints; bubble.BubbleShape = PointShape.Sphere; bubble.AddDataPoint(new NBubbleDataPoint(10, 10, "B1", new NColorFillStyle(Color.DarkGoldenrod))); bubble.AddDataPoint(new NBubbleDataPoint(15, 20, "B2", new NColorFillStyle(Color.IndianRed))); bubble.AddDataPoint(new NBubbleDataPoint(12, 25, "B3", new NColorFillStyle(Color.DarkMagenta))); bubble.AddDataPoint(new NBubbleDataPoint(8, 15, "B4", new NColorFillStyle(Color.DarkOrchid))); NBarSeries bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar); bar.Name = "Stack 1"; bar.DataLabelStyle.Visible = false; bar.BarShape = BarShape.Cylinder; bar.WidthPercent = 60; bar.DepthPercent = 60; bar.BorderStyle.Width = new NLength(0, NGraphicsUnit.Pixel); bar.FillStyle = new NColorFillStyle(Color.CornflowerBlue); bar.Values.FillRandomRange(Random, 4, 5, 15); bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar); bar.MultiBarMode = MultiBarMode.Stacked; bar.Name = "Stack 2"; bar.DataLabelStyle.Visible = false; bar.BarShape = BarShape.Cylinder; bar.WidthPercent = 60; bar.DepthPercent = 60; bar.BorderStyle.Width = new NLength(0, NGraphicsUnit.Pixel); bar.FillStyle = new NColorFillStyle(Color.Yellow); bar.Values.FillRandomRange(Random, 4, 5, 15); bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar); bar.MultiBarMode = MultiBarMode.Stacked; bar.Name = "Stack 3"; bar.DataLabelStyle.Visible = false; bar.BarShape = BarShape.Cylinder; bar.WidthPercent = 60; bar.DepthPercent = 60; bar.BorderStyle.Width = new NLength(0, NGraphicsUnit.Pixel); bar.FillStyle = new NColorFillStyle(Color.MediumSeaGreen); bar.Values.FillRandomRange(Random, 4, 5, 15); // init form controls for (int i = 2; i < 17; i++) { JitteringStepsComboBox.Items.Add(i.ToString()); } JitteringStepsComboBox.SelectedIndex = nChartControl1.Settings.JitteringSteps - 2; JitteringDeviationUpDown.Value = (decimal)nChartControl1.Settings.JitteringDeviation; JitteringStepsComboBox.Enabled = false; JitteringDeviationUpDown.Enabled = false; EnableJitteringCheckBox.Checked = false; }
public override void Initialize() { base.Initialize(); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("Lighting Filter"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // setup chart m_Chart = nChartControl1.Charts[0]; m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal); m_Chart.Axis(StandardAxis.Depth).Visible = false; NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); m_Bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble); m_Bubble.DataLabelStyle.Visible = false; m_Bubble.Legend.Format = "<label> X:<xvalue> Y:<value> Size:<size>"; m_Bubble.Legend.Mode = SeriesLegendMode.DataPoints; m_Bubble.MinSize = new NLength(10.0f, NRelativeUnit.ParentPercentage); m_Bubble.MaxSize = new NLength(20.0f, NRelativeUnit.ParentPercentage); m_Bubble.UseXValues = true; m_Bubble.ShadowStyle.Type = ShadowType.Solid; m_Bubble.ShadowStyle.Offset = new NPointL(3, 3); m_Bubble.ShadowStyle.Color = Color.FromArgb(60, 0, 0, 0); m_Bubble.BorderStyle.Width = new NLength(0, NGraphicsUnit.Pixel); m_Bubble.InflateMargins = true; m_LightingFilter = new NLightingImageFilter(); NFillStyle fillStyle = new NColorFillStyle(Color.Gold); fillStyle.ImageFiltersStyle.Filters.Add(m_LightingFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(10, 34, 10, "Company1", fillStyle)); fillStyle = new NColorFillStyle(Color.DarkOrange); fillStyle.ImageFiltersStyle.Filters.Add(m_LightingFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(15, 12, 20, "Company2", fillStyle)); fillStyle = new NColorFillStyle(Color.Crimson); fillStyle.ImageFiltersStyle.Filters.Add(m_LightingFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(12, 24, 25, "Company3", fillStyle)); fillStyle = new NColorFillStyle(Color.DarkOrchid); fillStyle.ImageFiltersStyle.Filters.Add(m_LightingFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(8, 56, 15, "Company4", fillStyle)); BubbleShapeCombo.FillFromEnum(typeof(PointShape)); BubbleShapeCombo.SelectedIndex = 7; InflateMargins.Checked = true; LightSourceTypeComboBox.FillFromEnum(typeof(LightSourceType)); BlurTypeComboBox.FillFromEnum(typeof(BlurType)); BevelDepthNumericUpDown.Value = (decimal)m_LightingFilter.BevelDepth.Value; BlurTypeComboBox.SelectedIndex = (int)m_LightingFilter.BlurType; SurfaceScaleNumericUpDown.Value = (decimal)m_LightingFilter.SurfaceScale; ShininessNumericUpDown.Value = (decimal)m_LightingFilter.Shininess; LightSourceTypeComboBox.SelectedIndex = (int)m_LightingFilter.LightSourceType; NVector3DF vector = m_LightingFilter.Position; PositionXnumericUpDown.Value = (decimal)vector.X; PositionYnumericUpDown.Value = (decimal)vector.Y; PositionZnumericUpDown.Value = (decimal)vector.Z; m_Updating = false; }
public override void Initialize() { base.Initialize(); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("2D Bubble Chart"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); // configure the chart m_Chart = nChartControl1.Charts[0]; m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal); m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft); m_Chart.Axis(StandardAxis.Depth).Visible = false; NLinearScaleConfigurator linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; // add interlace stripe NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1); stripStyle.Interlaced = true; stripStyle.SetShowAtWall(ChartWallType.Back, true); stripStyle.SetShowAtWall(ChartWallType.Left, true); linearScale.StripStyles.Add(stripStyle); NOrdinalScaleConfigurator ordinalScale = m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator; ordinalScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; ordinalScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); // add a bubble series m_Bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble); m_Bubble.DataLabelStyle.VertAlign = VertAlign.Center; m_Bubble.DataLabelStyle.Visible = false; m_Bubble.Legend.Mode = SeriesLegendMode.DataPoints; m_Bubble.MinSize = new NLength(7.0f, NRelativeUnit.ParentPercentage); m_Bubble.MaxSize = new NLength(16.0f, NRelativeUnit.ParentPercentage); m_Bubble.AddDataPoint(new NBubbleDataPoint(10, 10, "Company 1")); m_Bubble.AddDataPoint(new NBubbleDataPoint(15, 20, "Company 2")); m_Bubble.AddDataPoint(new NBubbleDataPoint(12, 25, "Company 3")); m_Bubble.AddDataPoint(new NBubbleDataPoint(8, 15, "Company 4")); m_Bubble.AddDataPoint(new NBubbleDataPoint(14, 17, "Company 5")); m_Bubble.AddDataPoint(new NBubbleDataPoint(11, 12, "Company 6")); // apply layout ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]); // init form controls BubbleShapeCombo.FillFromEnum(typeof(PointShape)); BubbleShapeCombo.SelectedIndex = 6; LegendFormatCombo.Items.Add("Value and Label"); LegendFormatCombo.Items.Add("Value"); LegendFormatCombo.Items.Add("Label"); LegendFormatCombo.Items.Add("Size"); LegendFormatCombo.SelectedIndex = 2; InflateMargins.Checked = true; DifferentColors.Checked = true; }
public override void Initialize() { base.Initialize(); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("XY Bubble Chart"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); // setup chart m_Chart = nChartControl1.Charts[0]; NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; // add interlace style NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(new NArgbColor(Color.Beige)), null, true, 0, 0, 1, 1); stripStyle.SetShowAtWall(ChartWallType.Back, true); stripStyle.SetShowAtWall(ChartWallType.Left, true); stripStyle.Interlaced = true; linearScale.StripStyles.Add(stripStyle); linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); m_Bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble); m_Bubble.DataLabelStyle.Visible = false; m_Bubble.Legend.Format = "<label>"; m_Bubble.Legend.Mode = SeriesLegendMode.DataPoints; m_Bubble.ShadowStyle.Type = ShadowType.Solid; m_Bubble.ShadowStyle.Offset = new NPointL(1.2f, 1.2f); m_Bubble.ShadowStyle.Color = Color.FromArgb(60, 0, 0, 0); m_Bubble.UseXValues = true; m_Bubble.AddDataPoint(new NBubbleDataPoint(27, 51, 1147995904, "India")); m_Bubble.AddDataPoint(new NBubbleDataPoint(50, 67, 1321851888, "China")); m_Bubble.AddDataPoint(new NBubbleDataPoint(76, 22, 109955400, "Mexico")); m_Bubble.AddDataPoint(new NBubbleDataPoint(210, 9, 142008838, "Russia")); m_Bubble.AddDataPoint(new NBubbleDataPoint(360, 4, 305843000, "USA")); m_Bubble.AddDataPoint(new NBubbleDataPoint(470, 5, 33560000, "Canada")); // apply layout ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]); // apply style sheet NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor); styleSheet.Apply(nChartControl1.Document); // init form controls BubbleShapeCombo.FillFromEnum(typeof(PointShape)); BubbleShapeCombo.SelectedIndex = 7; AxesRoundToTick.Checked = true; InflateMargins.Checked = true; MinBubbleSizeScroll.Value = 4; MaxBubbleSizeScroll.Value = 20; }
/// <summary> /// Called to initialize the example /// </summary> /// <param name="chartControl"></param> public override void Create() { // set a chart title NLabel title = nChartControl1.Labels.AddHeader("XY Bubble Chart"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, System.Drawing.FontStyle.Italic); // setup chart m_Chart = nChartControl1.Charts[0]; NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; // add interlace style NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(new NArgbColor(Color.Beige)), null, true, 0, 0, 1, 1); stripStyle.SetShowAtWall(ChartWallType.Back, true); stripStyle.SetShowAtWall(ChartWallType.Left, true); stripStyle.Interlaced = true; linearScale.StripStyles.Add(stripStyle); linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); m_Bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble); m_Bubble.DataLabelStyle.Visible = false; m_Bubble.Legend.Format = "<label>"; m_Bubble.Legend.Mode = SeriesLegendMode.DataPoints; m_Bubble.ShadowStyle.Type = ShadowType.Solid; m_Bubble.ShadowStyle.Offset = new NPointL(1.2f, 1.2f); m_Bubble.ShadowStyle.Color = Color.FromArgb(60, 0, 0, 0); m_Bubble.UseXValues = true; m_Bubble.AddDataPoint(new NBubbleDataPoint(27, 51, 1147995904, "India")); m_Bubble.AddDataPoint(new NBubbleDataPoint(50, 67, 1321851888, "China")); m_Bubble.AddDataPoint(new NBubbleDataPoint(76, 22, 109955400, "Mexico")); m_Bubble.AddDataPoint(new NBubbleDataPoint(210, 9, 142008838, "Russia")); m_Bubble.AddDataPoint(new NBubbleDataPoint(360, 4, 305843000, "USA")); m_Bubble.AddDataPoint(new NBubbleDataPoint(470, 5, 33560000, "Canada")); // apply layout ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]); // apply style sheet NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor); styleSheet.Apply(nChartControl1.Document); nChartControl1.Controller.Tools.Add(new NPanelSelectorTool()); nChartControl1.Controller.Tools.Add(new NTrackballTool()); // init form controls NExampleHelpers.FillComboWithEnumValues(BubbleShapeComboBox, typeof(PointShape)); BubbleShapeComboBox.SelectedIndex = 6; LegendFormatComboBox.Items.Add("Value and Label"); LegendFormatComboBox.Items.Add("Value"); LegendFormatComboBox.Items.Add("Label"); LegendFormatComboBox.Items.Add("Size"); LegendFormatComboBox.SelectedIndex = 2; InflateMarginsCheckBox.IsChecked = true; DifferentColorsCheckBox.IsChecked = true; MaxBubbleSizeScrollBar.Value = m_Bubble.MaxSize.Value / 100.0f; MinBubbleSizeScrollBar.Value = m_Bubble.MinSize.Value / 100.0f; InflateMarginsCheckBox_Checked(null, null); DifferentColorsCheckBox_Checked(null, null); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WebExamplesUtilities.FillComboWithEnumValues(BubbleShapeDropDownList, typeof(PointShape)); BubbleShapeDropDownList.SelectedIndex = 6; WebExamplesUtilities.FillComboWithValues(MinBubbleSizeDropDownList, 0, 30, 5); WebExamplesUtilities.FillComboWithValues(MaxBubbleSizeDropDownList, 0, 30, 5); MinBubbleSizeDropDownList.SelectedIndex = 2; MaxBubbleSizeDropDownList.SelectedIndex = 4; DifferentColorsCheckBox.Checked = true; } nChartControl1.BackgroundStyle.FrameStyle.Visible = false; // set a chart title NLabel title = nChartControl1.Labels.AddHeader("Bubble Chart"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; // setup chart NChart chart = nChartControl1.Charts[0]; chart.Enable3D = false; // setup X axis NOrdinalScaleConfigurator scaleX = (NOrdinalScaleConfigurator)chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator; scaleX.AutoLabels = false; scaleX.DisplayDataPointsBetweenTicks = false; scaleX.MajorTickMode = MajorTickMode.CustomTicks; scaleX.CustomMajorTicks.AddRange(new long[] { 0, 1, 2, 3, 4, 5 }); scaleX.CustomLabels.Add(new NCustomValueLabel(0, "A")); scaleX.CustomLabels.Add(new NCustomValueLabel(1, "B")); scaleX.CustomLabels.Add(new NCustomValueLabel(2, "C")); scaleX.CustomLabels.Add(new NCustomValueLabel(3, "D")); scaleX.CustomLabels.Add(new NCustomValueLabel(4, "E")); scaleX.CustomLabels.Add(new NCustomValueLabel(5, "F")); // add interlace stripe NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator; NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1); stripStyle.Interlaced = true; stripStyle.SetShowAtWall(ChartWallType.Back, true); stripStyle.SetShowAtWall(ChartWallType.Left, true); scaleY.StripStyles.Add(stripStyle); NBubbleSeries bubble = (NBubbleSeries)chart.Series.Add(SeriesType.Bubble); bubble.InflateMargins = true; bubble.DataLabelStyle.Visible = false; bubble.Legend.Mode = SeriesLegendMode.DataPoints; bubble.Legend.Format = "<size> <label>"; bubble.AddDataPoint(new NBubbleDataPoint(10, 10, "A")); bubble.AddDataPoint(new NBubbleDataPoint(15, 20, "B")); bubble.AddDataPoint(new NBubbleDataPoint(12, 25, "C")); bubble.AddDataPoint(new NBubbleDataPoint(8, 15, "D")); bubble.AddDataPoint(new NBubbleDataPoint(14, 17, "E")); bubble.AddDataPoint(new NBubbleDataPoint(11, 12, "F")); bubble.BubbleShape = (PointShape)BubbleShapeDropDownList.SelectedIndex; bubble.MinSize = new NLength(MinBubbleSizeDropDownList.SelectedIndex * 5, NRelativeUnit.ParentPercentage); bubble.MaxSize = new NLength(MaxBubbleSizeDropDownList.SelectedIndex * 5, NRelativeUnit.ParentPercentage); if (DifferentColorsCheckBox.Checked) { // apply style sheet NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor); styleSheet.Apply(nChartControl1.Document); } else { // apply style sheet NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh); styleSheet.Apply(nChartControl1.Document); } // apply layout ApplyLayoutTemplate(0, nChartControl1, chart, title, nChartControl1.Legends[0]); }
public override void Initialize() { base.Initialize(); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("Glow filter - Inner and Outer glow"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // setup chart m_Chart = nChartControl1.Charts[0]; m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal); m_Chart.Axis(StandardAxis.Depth).Visible = false; NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); m_Bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble); m_Bubble.DataLabelStyle.Visible = false; m_Bubble.Legend.Format = "<label> X:<xvalue> Y:<value> Size:<size>"; m_Bubble.Legend.Mode = SeriesLegendMode.DataPoints; m_Bubble.MinSize = new NLength(10.0f, NRelativeUnit.ParentPercentage); m_Bubble.MaxSize = new NLength(20.0f, NRelativeUnit.ParentPercentage); m_Bubble.UseXValues = true; m_Bubble.BorderStyle.Width = new NLength(0, NGraphicsUnit.Pixel); m_GlowFilter = new NGlowImageFilter(); NFillStyle fillStyle = new NColorFillStyle(Color.Gold); fillStyle.ImageFiltersStyle.Filters.Add(m_GlowFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(10, 34, 10, "Company1", fillStyle)); fillStyle = new NColorFillStyle(Color.DarkOrange); fillStyle.ImageFiltersStyle.Filters.Add(m_GlowFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(15, 12, 20, "Company2", fillStyle)); fillStyle = new NColorFillStyle(Color.Crimson); fillStyle.ImageFiltersStyle.Filters.Add(m_GlowFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(12, 24, 25, "Company3", fillStyle)); fillStyle = new NColorFillStyle(Color.DarkOrchid); fillStyle.ImageFiltersStyle.Filters.Add(m_GlowFilter); m_Bubble.AddDataPoint(new NBubbleDataPoint(8, 56, 15, "Company4", fillStyle)); BubbleShapeCombo.SelectedIndex = 7; InflateMargins.Checked = true; m_bUpdate = true; GlowTypeComboBox.SelectedIndex = (int)m_GlowFilter.GlowType; DepthNumericUpDown.Value = (decimal)m_GlowFilter.Depth.Value; BlurTypeComboBox.SelectedIndex = (int)m_GlowFilter.BlurType; OriginalOpacityNumericUpDown.Value = (decimal)m_GlowFilter.OriginalOpacity; m_bUpdate = false; }