protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); stack.HorizontalPlacement = Layout.ENHorizontalPlacement.Left; NStackPanel controlStack = new NStackPanel(); stack.Add(controlStack); // create the radial gauge m_RadialGauge = new NRadialGauge(); m_RadialGauge.SweepAngle = new NAngle(270, NUnit.Degree); m_RadialGauge.BeginAngle = new NAngle(-225, NUnit.Degree); m_RadialGauge.PreferredSize = defaultRadialGaugeSize; m_RadialGauge.CapEffect = new NGlassCapEffect(); m_RadialGauge.Dial = new NDial(ENDialShape.CutCircle, new NEdgeDialRim()); m_RadialGauge.Dial.BackgroundFill = new NStockGradientFill(NColor.DarkGray, NColor.Black); // configure scale NGaugeAxis axis = new NGaugeAxis(); m_RadialGauge.Axes.Add(axis); NLinearScale scale = (NLinearScale)axis.Scale; scale.SetPredefinedScale(ENPredefinedScaleStyle.Presentation); scale.Labels.Style.TextStyle.Font = new NFont("Arimo", 10, ENFontStyle.Bold); scale.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White); scale.Labels.Style.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 90.0); scale.MinorTickCount = 4; scale.Ruler.Stroke.Width = 0; scale.Ruler.Fill = new NColorFill(NColor.DarkGray); // add radial gauge indicators m_ValueIndicator = new NNeedleValueIndicator(); m_ValueIndicator.Fill = new NStockGradientFill(ENGradientStyle.Horizontal, ENGradientVariant.Variant1, NColor.White, NColor.Red); m_ValueIndicator.Stroke.Color = NColor.Red; m_ValueIndicator.Width = 15; m_ValueIndicator.OffsetFromScale = -10; m_RadialGauge.Indicators.Add(m_ValueIndicator); NStackPanel verticalStack = new NStackPanel(); verticalStack.Direction = Layout.ENHVDirection.TopToBottom; verticalStack.Padding = new NMargins(80, 200, 80, 0); m_NumericLedDisplay = new NNumericLedDisplay(); m_NumericLedDisplay.Value = 0.0; m_NumericLedDisplay.CellCountMode = ENDisplayCellCountMode.Fixed; m_NumericLedDisplay.CellCount = 7; m_NumericLedDisplay.BackgroundFill = new NColorFill(NColor.Black); m_NumericLedDisplay.Border = NBorder.CreateSunken3DBorder(new NUIThemeColorMap(ENUIThemeScheme.WindowsClassic)); m_NumericLedDisplay.BorderThickness = new NMargins(6); m_NumericLedDisplay.Margins = new NMargins(5); m_NumericLedDisplay.Padding = new NMargins(5); NGelCapEffect gelCap = new NGelCapEffect(); gelCap.Shape = ENCapEffectShape.RoundedRect; m_NumericLedDisplay.CapEffect = gelCap; m_NumericLedDisplay.PreferredHeight = 60; verticalStack.Add(m_NumericLedDisplay); m_RadialGauge.Content = verticalStack; // add radial gauge controlStack.Add(m_RadialGauge); m_DataFeedTimer = new NTimer(); m_DataFeedTimer.Tick += new Function(OnDataFeedTimerTick); m_DataFeedTimer.Start(); return(stack); }
/// <summary> /// /// </summary> /// <returns></returns> protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); NStackPanel controlStack = new NStackPanel(); stack.Add(controlStack); // create the radial gauge m_RadialGauge = new NRadialGauge(); m_RadialGauge.PreferredSize = defaultRadialGaugeSize; controlStack.Add(m_RadialGauge); m_RadialGauge.Dial = new NDial(ENDialShape.CutCircle, new NEdgeDialRim()); m_RadialGauge.Dial.BackgroundFill = new NStockGradientFill(NColor.DarkGray, NColor.Black); NGelCapEffect gelEffect = new NGelCapEffect(ENCapEffectShape.Ellipse); gelEffect.Margins = new NMargins(0, 0, 0, 0.5); m_RadialGauge.Axes.Clear(); // create the first axis NGaugeAxis axis1 = new NGaugeAxis(); axis1.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, 0, 70); NStandardScale scale1 = (NStandardScale)axis1.Scale; scale1.SetPredefinedScale(ENPredefinedScaleStyle.PresentationNoStroke); scale1.MinorTickCount = 3; scale1.Ruler.Fill = new NColorFill(NColor.FromColor(NColor.White, 0.4f)); scale1.OuterMajorTicks.Fill = new NColorFill(NColor.Orange); scale1.Labels.Style.TextStyle.Font = new NFont("Arimo", 12, ENFontStyle.Bold); scale1.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White); scale1.Labels.Style.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0); m_RadialGauge.Axes.Add(axis1); // create the second axis NGaugeAxis axis2 = new NGaugeAxis(); axis2.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, false, 75, 95); NStandardScale scale2 = (NStandardScale)axis2.Scale; scale2.SetPredefinedScale(ENPredefinedScaleStyle.PresentationNoStroke); scale2.MinorTickCount = 3; scale2.Ruler.Fill = new NColorFill(NColor.FromColor(NColor.White, 0.4f)); scale2.OuterMajorTicks.Fill = new NColorFill(NColor.Blue); scale2.Labels.Style.TextStyle.Font = new NFont("Arimo", 12, ENFontStyle.Bold); scale2.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White); scale2.Labels.Style.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0); m_RadialGauge.Axes.Add(axis2); // add indicators NRangeIndicator rangeIndicator = new NRangeIndicator(); rangeIndicator.Value = 50; rangeIndicator.Fill = new NStockGradientFill(NColor.Orange, NColor.Red); rangeIndicator.Stroke.Width = 0; rangeIndicator.OffsetFromScale = 3; rangeIndicator.BeginWidth = 6; rangeIndicator.EndWidth = 12; m_RadialGauge.Indicators.Add(rangeIndicator); NNeedleValueIndicator needleValueIndicator1 = new NNeedleValueIndicator(); needleValueIndicator1.Value = 79; // needleValueIndicator1.Shape.FillStyle = new NGradientFillStyle(GradientStyle.Vertical, GradientVariant.Variant2, Color.White, Color.Red); // needleValueIndicator1.Shape.StrokeStyle.Color = Color.Red; needleValueIndicator1.ScaleAxis = axis1; needleValueIndicator1.OffsetFromScale = 2; m_RadialGauge.Indicators.Add(needleValueIndicator1); m_RadialGauge.SweepAngle = new NAngle(360, NUnit.Degree); NNeedleValueIndicator needleValueIndicator2 = new NNeedleValueIndicator(); needleValueIndicator2.Value = 79; // needleValueIndicator2.Shape.FillStyle = new NGradientFillStyle(GradientStyle.Vertical, GradientVariant.Variant2, Color.White, Color.Blue); // needleValueIndicator2.Shape.StrokeStyle.Color = Color.Blue; needleValueIndicator2.ScaleAxis = axis2; needleValueIndicator2.OffsetFromScale = 2; m_RadialGauge.Indicators.Add(needleValueIndicator2); return(stack); }