Ejemplo n.º 1
0
        /// <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);
        }