private NNumericDisplayPanel CreateDisplayPanel() { NNumericDisplayPanel numericDisplay = new NNumericDisplayPanel(); numericDisplay.UseAutomaticSize = true; numericDisplay.DockMode = PanelDockMode.Top; numericDisplay.Value = 0; numericDisplay.CellCountMode = DisplayCellCountMode.Fixed; numericDisplay.CellCount = 8; numericDisplay.Margins = new NMarginsL(10, 5, 10, 5); numericDisplay.Padding = new NMarginsL(7, 7, 7, 7); // apply border, background and paint effect numericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.Black); NEdgeBorderStyle border = new NEdgeBorderStyle(BorderShape.RoundedRect); border.InnerBevelWidth = new NLength(1); border.OuterBevelWidth = new NLength(1); border.MiddleBevelWidth = new NLength(1); numericDisplay.BorderStyle = border; numericDisplay.PaintEffect = new NGelEffectStyle(); // adjust cell fill styles numericDisplay.LitFillStyle = new NColorFillStyle(Color.GreenYellow); numericDisplay.DimFillStyle.SetTransparencyPercent(50); numericDisplay.DecimalLitFillStyle = new NColorFillStyle(Color.Red); numericDisplay.DecimalDimFillStyle.SetTransparencyPercent(50); // adjust cell sizes numericDisplay.CellSize = new NSizeL(new NLength(15), new NLength(30)); numericDisplay.DecimalCellSize = new NSizeL(new NLength(15), new NLength(30)); numericDisplay.SegmentGap = new NLength(1, NGraphicsUnit.Point); numericDisplay.SegmentWidth = new NLength(2.4f, NGraphicsUnit.Point); return(numericDisplay); }
public override void Create() { nChartControl1.Panels.Clear(); // set a chart title NLabel header = new NLabel("Radial Gauge Indicators"); header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, System.Drawing.FontStyle.Italic); header.ContentAlignment = ContentAlignment.BottomRight; header.Location = new NPointL(new NLength(2, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); nChartControl1.Panels.Add(header); // create the radial gauge m_RadialGauge = new NRadialGaugePanel(); m_RadialGauge.PaintEffect = new NGlassEffectStyle(); m_RadialGauge.BorderStyle = new NEdgeBorderStyle(BorderShape.Auto); m_RadialGauge.ContentAlignment = ContentAlignment.MiddleCenter; m_RadialGauge.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(55, NRelativeUnit.ParentPercentage)); m_RadialGauge.Size = new NSizeL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(80, NRelativeUnit.ParentPercentage)); m_RadialGauge.BackgroundFillStyle = new NGradientFillStyle(Color.DarkGray, Color.Black); // configure scale NGaugeAxis axis = (NGaugeAxis)m_RadialGauge.Axes[0]; NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator; scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Presentation); scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 12, System.Drawing.FontStyle.Bold); scale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.White); scale.LabelStyle.Angle = new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 90); scale.MinorTickCount = 4; scale.RulerStyle.BorderStyle.Width = new NLength(0); scale.RulerStyle.FillStyle = new NColorFillStyle(Color.DarkGray); // add radial gauge indicators m_Indicator1 = new NRangeIndicator(); m_Indicator1.Value = 20; m_Indicator1.FillStyle = new NGradientFillStyle(GradientStyle.StartToEnd, GradientVariant.Variant1, Color.Yellow, Color.Red); m_Indicator1.StrokeStyle.Color = Color.DarkBlue; m_Indicator1.EndWidth = new NLength(20); m_RadialGauge.Indicators.Add(m_Indicator1); m_Indicator2 = new NNeedleValueIndicator(); m_Indicator2.Value = 79; m_Indicator2.Shape.FillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red); m_Indicator2.Shape.StrokeStyle.Color = Color.Red; m_RadialGauge.Indicators.Add(m_Indicator2); m_RadialGauge.SweepAngle = 270; // add radial gauge nChartControl1.Panels.Add(m_RadialGauge); // create and configure a numeric display attached to the radial gauge m_NumericDisplay = new NNumericDisplayPanel(); m_NumericDisplay.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(70, NRelativeUnit.ParentPercentage)); m_NumericDisplay.ContentAlignment = ContentAlignment.TopCenter; m_NumericDisplay.SegmentWidth = new NLength(2, NGraphicsUnit.Point); m_NumericDisplay.SegmentGap = new NLength(1, NGraphicsUnit.Point); m_NumericDisplay.CellSize = new NSizeL(new NLength(15, NGraphicsUnit.Point), new NLength(30, NGraphicsUnit.Point)); m_NumericDisplay.DecimalCellSize = new NSizeL(new NLength(10, NGraphicsUnit.Point), new NLength(20, NGraphicsUnit.Point)); m_NumericDisplay.ShowDecimalSeparator = false; m_NumericDisplay.CellAlignment = VertAlign.Top; m_NumericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.DimGray); m_NumericDisplay.LitFillStyle = new NGradientFillStyle(Color.Lime, Color.Green); m_NumericDisplay.CellCountMode = DisplayCellCountMode.Fixed; m_NumericDisplay.CellCount = 6; m_NumericDisplay.Padding = new NMarginsL(6, 3, 6, 3); m_RadialGauge.ChildPanels.Add(m_NumericDisplay); // create a sunken border around the display NEdgeBorderStyle borderStyle = new NEdgeBorderStyle(BorderShape.RoundedRect); borderStyle.OuterBevelWidth = new NLength(0); borderStyle.MiddleBevelWidth = new NLength(0); m_NumericDisplay.BorderStyle = borderStyle; // init form controls NExampleHelpers.BindComboToItemSource(SweepAngleComboBox, -360, 360, 10); SweepAngleComboBox.SelectedItem = (int)m_RadialGauge.SweepAngle; NExampleHelpers.BindComboToItemSource(BeginAngleComboBox, -360, 360, 10); BeginAngleComboBox.SelectedItem = (int)m_RadialGauge.BeginAngle; NExampleHelpers.FillComboWithEnumValues(ValueIndicatorShapeComboBox, typeof(SmartShape1D)); ValueIndicatorShapeComboBox.SelectedIndex = (int)SmartShape1D.Arrow2; NExampleHelpers.BindComboToItemSource(ValueIndicatorComboBox, 0, 100, 1); ValueIndicatorComboBox.SelectedItem = (int)m_Indicator2.Value; NExampleHelpers.BindComboToItemSource(RangeIndicatorValueComboBox, 0, 100, 5); RangeIndicatorValueComboBox.SelectedItem = (int)m_Indicator1.Value; NExampleHelpers.FillComboWithEnumValues(RangeIndicatorOriginModeComboBox, typeof(OriginMode)); RangeIndicatorOriginModeComboBox.SelectedIndex = 0; NExampleHelpers.BindComboToItemSource(NeedleWidthComboBox, -20, 60, 5); NeedleWidthComboBox.SelectedItem = (int)m_Indicator2.Width.Value; NExampleHelpers.BindComboToItemSource(RangeIndicatorOriginComboBox, 0, 100, 5); RangeIndicatorOriginComboBox.SelectedItem = (int)m_Indicator1.Origin; }
public override void Initialize() { nChartControl1.Panels.Clear(); // set a chart title NLabel header = new NLabel("Gauge Indicator Value Dampening"); header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); header.ContentAlignment = ContentAlignment.BottomRight; header.Location = new NPointL(new NLength(2, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); nChartControl1.Panels.Add(header); // create the radial gauge m_RadialGauge = new NRadialGaugePanel(); m_RadialGauge.PaintEffect = new NGlassEffectStyle(); m_RadialGauge.BorderStyle = new NEdgeBorderStyle(BorderShape.Auto); m_RadialGauge.ContentAlignment = ContentAlignment.MiddleCenter; m_RadialGauge.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(55, NRelativeUnit.ParentPercentage)); m_RadialGauge.Size = new NSizeL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(80, NRelativeUnit.ParentPercentage)); m_RadialGauge.BackgroundFillStyle = new NGradientFillStyle(Color.DarkGray, Color.Black); // configure scale NGaugeAxis axis = (NGaugeAxis)m_RadialGauge.Axes[0]; NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator; scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Presentation); scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 12, FontStyle.Bold); scale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.White); scale.LabelStyle.Angle = new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 0); scale.MinorTickCount = 4; scale.RulerStyle.BorderStyle.Width = new NLength(0); scale.RulerStyle.FillStyle = new NColorFillStyle(Color.DarkGray); // add radial gauge indicators m_Indicator1 = new NRangeIndicator(); m_Indicator1.Value = 20; m_Indicator1.FillStyle = new NGradientFillStyle(Color.Yellow, Color.Red); m_Indicator1.StrokeStyle.Color = Color.DarkBlue; m_Indicator1.EndWidth = new NLength(20); m_RadialGauge.Indicators.Add(m_Indicator1); m_Indicator2 = new NNeedleValueIndicator(); m_Indicator2.Value = 79; m_Indicator2.Shape.FillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red); m_Indicator2.Shape.StrokeStyle.Color = Color.Red; m_RadialGauge.Indicators.Add(m_Indicator2); m_RadialGauge.SweepAngle = 270; // add radial gauge nChartControl1.Panels.Add(m_RadialGauge); // create and configure a numeric display attached to the radial gauge m_NumericDisplay = new NNumericDisplayPanel(); m_NumericDisplay.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(70, NRelativeUnit.ParentPercentage)); m_NumericDisplay.ContentAlignment = ContentAlignment.TopCenter; m_NumericDisplay.SegmentWidth = new NLength(2, NGraphicsUnit.Point); m_NumericDisplay.SegmentGap = new NLength(1, NGraphicsUnit.Point); m_NumericDisplay.CellSize = new NSizeL(new NLength(15, NGraphicsUnit.Point), new NLength(30, NGraphicsUnit.Point)); m_NumericDisplay.DecimalCellSize = new NSizeL(new NLength(10, NGraphicsUnit.Point), new NLength(20, NGraphicsUnit.Point)); m_NumericDisplay.ShowDecimalSeparator = false; m_NumericDisplay.CellAlignment = VertAlign.Top; m_NumericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.DimGray); m_NumericDisplay.LitFillStyle = new NGradientFillStyle(Color.Lime, Color.Green); m_NumericDisplay.CellCountMode = DisplayCellCountMode.Fixed; m_NumericDisplay.CellCount = 6; m_NumericDisplay.Padding = new NMarginsL(6, 3, 6, 3); m_RadialGauge.ChildPanels.Add(m_NumericDisplay); // create a sunken border around the display NEdgeBorderStyle borderStyle = new NEdgeBorderStyle(BorderShape.RoundedRect); borderStyle.OuterBevelWidth = new NLength(0); borderStyle.MiddleBevelWidth = new NLength(0); m_NumericDisplay.BorderStyle = borderStyle; // init form controls EnableValueDampeningCheckBox.Checked = true; DampeningIntervalUpDown.Value = 50; DampeningStepsUpDown.Value = 10; m_Timer.Interval = 200; m_Timer.Start(); }
public override void Initialize(NThinChartControl control) { control.BackgroundStyle.FrameStyle.Visible = false; control.Panels.Clear(); // set a chart title NLabel header = new NLabel("Indicator Drag Tool"); header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; header.ContentAlignment = ContentAlignment.BottomRight; header.Location = new NPointL(new NLength(3, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); control.Panels.Add(header); // create the radial gauge NRadialGaugePanel m_RadialGauge = new NRadialGaugePanel(); m_RadialGauge.BorderStyle = new NEdgeBorderStyle(BorderShape.Auto); m_RadialGauge.PaintEffect = new NGlassEffectStyle(); m_RadialGauge.ContentAlignment = ContentAlignment.MiddleCenter; m_RadialGauge.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(52, NRelativeUnit.ParentPercentage)); m_RadialGauge.Size = new NSizeL(new NLength(90, NRelativeUnit.ParentPercentage), new NLength(85, NRelativeUnit.ParentPercentage)); m_RadialGauge.BackgroundFillStyle = new NGradientFillStyle(Color.DarkGray, Color.Black); // configure scale NGaugeAxis axis = (NGaugeAxis)m_RadialGauge.Axes[0]; NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator; scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Presentation); scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 10, FontStyle.Bold); scale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.White); scale.LabelStyle.Angle = new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 0); scale.MinorTickCount = 4; scale.RulerStyle.BorderStyle.Width = new NLength(0); scale.RulerStyle.FillStyle = new NColorFillStyle(Color.DarkGray); // add radial gauge indicators NRangeIndicator rangeIndicator = new NRangeIndicator(); rangeIndicator.Value = 20; rangeIndicator.FillStyle = new NGradientFillStyle(Color.Yellow, Color.Red); rangeIndicator.StrokeStyle.Color = Color.DarkBlue; rangeIndicator.EndWidth = new NLength(20); NInteractivityStyle interactivityStyle1 = new NInteractivityStyle(); interactivityStyle1.Tooltip.Text = "Drag Me"; // interactivityStyle1.ClientMouseEventAttribute.Tag = "Indicator[" + m_Indicator1.UniqueId.ToString() + "]"; rangeIndicator.InteractivityStyle = interactivityStyle1; m_RadialGauge.Indicators.Add(rangeIndicator); NNeedleValueIndicator needleIndicator = new NNeedleValueIndicator(); needleIndicator.Shape.FillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red); needleIndicator.Shape.StrokeStyle.Color = Color.Red; m_RadialGauge.Indicators.Add(needleIndicator); m_RadialGauge.SweepAngle = 270; // add radial gauge control.Panels.Add(m_RadialGauge); // create and config ure a numeric display attached to the radial gauge NNumericDisplayPanel numericDisplay = new NNumericDisplayPanel(); numericDisplay.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(70, NRelativeUnit.ParentPercentage)); numericDisplay.ContentAlignment = ContentAlignment.TopCenter; numericDisplay.DisplayStyle = DisplayStyle.SevenSegmentRounded; numericDisplay.SegmentWidth = new NLength(2, NGraphicsUnit.Point); numericDisplay.SegmentGap = new NLength(1, NGraphicsUnit.Point); numericDisplay.CellSize = new NSizeL(new NLength(9, NGraphicsUnit.Point), new NLength(19, NGraphicsUnit.Point)); numericDisplay.ShowDecimalSeparator = true; numericDisplay.ShowLeadingZeros = true; numericDisplay.EnableDecimalFormatting = false; numericDisplay.CellCountMode = DisplayCellCountMode.Auto; numericDisplay.CellCount = 6; numericDisplay.ValueFormatter = new NNumericValueFormatter("00.00"); numericDisplay.CellAlignment = VertAlign.Top; numericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.DimGray); numericDisplay.LitFillStyle = new NGradientFillStyle(Color.Lime, Color.Green); numericDisplay.CellCountMode = DisplayCellCountMode.Fixed; numericDisplay.CellCount = 6; numericDisplay.Padding = new NMarginsL(3, 2, 3, 2); m_RadialGauge.ChildPanels.Add(numericDisplay); // create a sunken border around the display NEdgeBorderStyle borderStyle = new NEdgeBorderStyle(BorderShape.RoundedRect); borderStyle.OuterBevelWidth = new NLength(0); borderStyle.MiddleBevelWidth = new NLength(0); numericDisplay.BorderStyle = borderStyle; NIndicatorDragTool indicatorDragTool = new NIndicatorDragTool(); indicatorDragTool.IndicatorDragCallback = new IndicatorDragCallback(); control.Controller.Tools.Add(indicatorDragTool); control.Controller.Tools.Add(new NTooltipTool()); NRangeIndicator range = (NRangeIndicator)control.Gauges[0].Indicators[0]; range.AllowDragging = true; if (range.AllowDragging) { range.InteractivityStyle.Tooltip.Text = "Drag Me"; } else { range.InteractivityStyle.Tooltip.Text = range.Range.End.ToString(); } NNeedleValueIndicator needle = (NNeedleValueIndicator)control.Gauges[0].Indicators[1]; needle.AllowDragging = true; if (needle.AllowDragging) { needle.InteractivityStyle.Tooltip.Text = "Drag Me"; } else { needle.InteractivityStyle.Tooltip.Text = needle.Value.ToString(); } }
protected void Page_Load(object sender, System.EventArgs e) { nChartControl1.BackgroundStyle.FrameStyle.Visible = false; nChartControl1.Panels.Clear(); // set a chart title NLabel header = new NLabel("Radial Gauge Indicators"); header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic); header.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur; header.ContentAlignment = ContentAlignment.BottomRight; header.Location = new NPointL(new NLength(3, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); nChartControl1.Panels.Add(header); // create the radial gauge m_RadialGauge = new NRadialGaugePanel(); m_RadialGauge.BorderStyle = new NEdgeBorderStyle(BorderShape.Auto); m_RadialGauge.PaintEffect = new NGlassEffectStyle(); m_RadialGauge.ContentAlignment = ContentAlignment.MiddleCenter; m_RadialGauge.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(52, NRelativeUnit.ParentPercentage)); m_RadialGauge.Size = new NSizeL(new NLength(90, NRelativeUnit.ParentPercentage), new NLength(85, NRelativeUnit.ParentPercentage)); m_RadialGauge.BackgroundFillStyle = new NGradientFillStyle(Color.DarkGray, Color.Black); // configure scale NGaugeAxis axis = (NGaugeAxis)m_RadialGauge.Axes[0]; NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator; scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Presentation); scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 10, FontStyle.Bold); scale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.White); scale.LabelStyle.Angle = new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 0); scale.MinorTickCount = 4; scale.RulerStyle.BorderStyle.Width = new NLength(0); scale.RulerStyle.FillStyle = new NColorFillStyle(Color.DarkGray); // add radial gauge indicators m_Indicator1 = new NRangeIndicator(); m_Indicator1.Value = 20; m_Indicator1.FillStyle = new NGradientFillStyle(Color.Yellow, Color.Red); m_Indicator1.StrokeStyle.Color = Color.DarkBlue; m_Indicator1.EndWidth = new NLength(20); m_RadialGauge.Indicators.Add(m_Indicator1); m_Indicator2 = new NNeedleValueIndicator(); m_Indicator2.Shape.FillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red); m_Indicator2.Shape.StrokeStyle.Color = Color.Red; m_RadialGauge.Indicators.Add(m_Indicator2); m_RadialGauge.SweepAngle = 270; // add radial gauge nChartControl1.Panels.Add(m_RadialGauge); // create and configure a numeric display attached to the radial gauge m_NumericDisplay = new NNumericDisplayPanel(); m_NumericDisplay.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(70, NRelativeUnit.ParentPercentage)); m_NumericDisplay.ContentAlignment = ContentAlignment.TopCenter; m_NumericDisplay.DisplayStyle = DisplayStyle.SevenSegmentRounded; m_NumericDisplay.SegmentWidth = new NLength(2, NGraphicsUnit.Point); m_NumericDisplay.SegmentGap = new NLength(1, NGraphicsUnit.Point); m_NumericDisplay.CellSize = new NSizeL(new NLength(10, NGraphicsUnit.Point), new NLength(20, NGraphicsUnit.Point)); m_NumericDisplay.DecimalCellSize = new NSizeL(new NLength(7, NGraphicsUnit.Point), new NLength(15, NGraphicsUnit.Point)); m_NumericDisplay.ShowDecimalSeparator = false; m_NumericDisplay.CellAlignment = VertAlign.Top; m_NumericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.DimGray); m_NumericDisplay.LitFillStyle = new NGradientFillStyle(Color.Lime, Color.Green); m_NumericDisplay.CellCountMode = DisplayCellCountMode.Fixed; m_NumericDisplay.CellCount = 6; m_NumericDisplay.Padding = new NMarginsL(3, 2, 3, 2); m_RadialGauge.ChildPanels.Add(m_NumericDisplay); // create a sunken border around the display NEdgeBorderStyle borderStyle = new NEdgeBorderStyle(BorderShape.RoundedRect); borderStyle.OuterBevelWidth = new NLength(0); borderStyle.MiddleBevelWidth = new NLength(0); m_NumericDisplay.BorderStyle = borderStyle; // init form controls if (!Page.IsPostBack) { WebExamplesUtilities.FillComboWithValues(ValueIndicatorDropDownList, 0, 100, 10); WebExamplesUtilities.FillComboWithValues(RangeIndicatorValueDropDownList, 0, 100, 10); WebExamplesUtilities.FillComboWithValues(RangeIndicatorOriginDropDownList, 0, 100, 10); WebExamplesUtilities.FillComboWithValues(SweepAngleDropDownList, -360, 360, 45); WebExamplesUtilities.FillComboWithValues(BeginAngleDropDownList, -360, 360, 45); SweepAngleDropDownList.SelectedValue = m_RadialGauge.SweepAngle.ToString(); BeginAngleDropDownList.SelectedValue = m_RadialGauge.BeginAngle.ToString(); WebExamplesUtilities.FillComboWithEnumValues(ValueIndicatorShapeDropDownList, typeof(SmartShape1D)); ValueIndicatorShapeDropDownList.SelectedIndex = (int)SmartShape1D.Triangle; ValueIndicatorDropDownList.SelectedValue = "20"; RangeIndicatorValueDropDownList.SelectedValue = m_Indicator1.Value.ToString(); WebExamplesUtilities.FillComboWithEnumValues(RangeIndicatorOriginModeDropDownList, typeof(OriginMode)); RangeIndicatorOriginModeDropDownList.SelectedIndex = 0; RangeIndicatorOriginDropDownList.SelectedIndex = 0; } m_Indicator1.Value = Convert.ToDouble(RangeIndicatorValueDropDownList.SelectedValue); m_Indicator1.Origin = Convert.ToDouble(RangeIndicatorOriginDropDownList.SelectedValue); m_Indicator1.OriginMode = (OriginMode)RangeIndicatorOriginModeDropDownList.SelectedIndex; m_RadialGauge.BeginAngle = (float)Convert.ToDecimal(BeginAngleDropDownList.SelectedValue); m_RadialGauge.SweepAngle = (float)Convert.ToDecimal(SweepAngleDropDownList.SelectedValue); N1DSmartShapeFactory factory = new N1DSmartShapeFactory(m_Indicator2.Shape.FillStyle, m_Indicator2.Shape.StrokeStyle, m_Indicator2.Shape.ShadowStyle); m_Indicator2.Shape = factory.CreateShape((SmartShape1D)ValueIndicatorShapeDropDownList.SelectedIndex); m_Indicator2.Value = Convert.ToDouble(ValueIndicatorDropDownList.SelectedValue); m_NumericDisplay.Value = m_Indicator2.Value; if (m_Indicator1.OriginMode != OriginMode.Custom) { RangeIndicatorOriginDropDownList.Enabled = false; } else { RangeIndicatorOriginDropDownList.Enabled = true; } }
public override void Initialize() { base.Initialize(); nChartControl1.Controller.Tools.Add(new NTrackballTool()); nChartControl1.Panels.Clear(); m_ContainerPanel = new NDockPanel(); m_ContainerPanel.Location = new NPointL(new NLength(10, NRelativeUnit.ParentPercentage), new NLength(10, NRelativeUnit.ParentPercentage)); m_ContainerPanel.Size = new NSizeL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(80, NRelativeUnit.ParentPercentage)); NLabel label = new NLabel("The control supports labels that can automatically scale, wrap or clip when the available space is not sufficient to accommodate them."); label.DockMode = PanelDockMode.Top; label.ContentAlignment = ContentAlignment.MiddleCenter; label.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); label.TextStyle.FillStyle = new NGradientFillStyle(Color.LightBlue, Color.DarkBlue); label.Padding = new NMarginsL(10, 10, 10, 10); label.Margins = new NMarginsL(0, 0, 0, 10); // apply border to the label NEdgeBorderStyle labelBorder = new NEdgeBorderStyle(); labelBorder.OuterBevelWidth = new NLength(0); labelBorder.InnerBevelWidth = new NLength(0); labelBorder.MiddleBevelFillStyle = new NColorFillStyle(Color.Black); label.BorderStyle = labelBorder; m_ContainerPanel.ChildPanels.Add(label); NCartesianChart chart = new NCartesianChart(); m_ContainerPanel.ChildPanels.Add(chart); chart.Axis(StandardAxis.Depth).Visible = false; chart.BoundsMode = BoundsMode.Stretch; chart.Padding = new NMarginsL(10, 10, 10, 10); chart.DockMode = PanelDockMode.Fill; // apply border to the chart NEdgeBorderStyle chartBorder = new NEdgeBorderStyle(); chartBorder.OuterBevelWidth = new NLength(0); chartBorder.InnerBevelWidth = new NLength(0); chartBorder.MiddleBevelFillStyle = new NColorFillStyle(Color.Black); chart.BorderStyle = chartBorder; NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar); bar.FillStyle = new NGradientFillStyle(GradientStyle.Vertical, GradientVariant.Variant2, Color.DarkRed, Color.Red); bar.BorderStyle.Width = new NLength(0, NGraphicsUnit.Pixel); bar.DataLabelStyle.Visible = false; bar.ShadowStyle.Type = ShadowType.GaussianBlur; bar.ShadowStyle.Offset = new NPointL(3, 3); bar.ShadowStyle.Color = Color.FromArgb(80, 0, 0, 0); bar.ShadowStyle.FadeLength = new NLength(5); bar.Values.AddRange(monthValues); nChartControl1.Panels.Add(m_ContainerPanel); LabelFitModeComboBox.FillFromEnum(typeof(TitleFitMode)); LabelFitModeComboBox.SelectedIndex = (int)TitleFitMode.Wrap; PanelWidthNumericUpDown.Value = 80; nChartControl1.Refresh(); }