Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
Changing Linera Gauge range?
posted

I have a dashboard i am working on and want to show a linear gauge on the screen.  The data is set as Goal and Actual.  I want to show the actual as a filled in area on the gauge, the Goal as an "arrow" with the max range on the gauge of the goal + 30.  I've added the code below.  The problem is, nothing is showing.  The gauge shows 0-100 and no values on the image.  What did i do wrong?

 

            LinearGauge gauge = this.ugPace.Gauges[0] as LinearGauge;

            LinearGaugeRange range = gauge.Scales[0].Ranges[0];

            LinearGaugeMarker current = gauge.Scales[1].Markers[0];

            LinearGaugeMarker goal = gauge.Scales[2].Markers[0];

            DataTable paceData = PaceData.GetPace();

            double goalnum = Convert.ToDouble(paceData.Rows[0][0].ToString());

            double currentval = Convert.ToDouble(paceData.Rows[0][1].ToString());

            range.EndValue = goalnum + 30;

            current.Value = currentval;

            goal.Value = goalnum;

 

The HTML code (LONG) is here as well...

            <iggauge:UltraGauge ID="ugPace" runat="server" BackColor="Transparent"
                Height="125px" Width="450px" onasyncrefresh="ugPace_AsyncRefresh">
                <Gauges>
                    <iggauge:LinearGauge CornerExtent="10" MarginString="2, 10, 2, 10, Pixels">
                        <Scales>
                            <iggauge:LinearGaugeScale EndExtent="98" InnerExtent="50" OuterExtent="95"
                                StartExtent="2">
                                <Ranges>
                                    <iggauge:LinearGaugeRange EndValueString="100" OuterExtent="80"
                                        StartValueString="0">
                                        <BrushElements>
                                            <iggauge:SolidFillBrushElement Color="White" />
                                        </BrushElements>
                                    </iggauge:LinearGaugeRange>
                                </Ranges>
                                <BrushElements>
                                    <iggauge:SimpleGradientBrushElement EndColor="10, 255, 255, 255"
                                        StartColor="80, 255, 255, 255" />
                                </BrushElements>
                            </iggauge:LinearGaugeScale>
                            <iggauge:LinearGaugeScale EndExtent="90" StartExtent="10">
                                <MajorTickmarks EndExtent="35" StartExtent="22">
                                    <StrokeElement Color="135, 135, 135">
                                    </StrokeElement>
                                </MajorTickmarks>
                                <Markers>
                                    <iggauge:LinearGaugeBarMarker InnerExtent="25" OuterExtent="35"
                                        SegmentSpan="99" ValueString="60">
                                        <BrushElements>
                                            <iggauge:SolidFillBrushElement Color="232, 0, 0" />
                                        </BrushElements>
                                    </iggauge:LinearGaugeBarMarker>
                                </Markers>
                                <Ranges>
                                    <iggauge:LinearGaugeRange EndValueString="100" InnerExtent="25"
                                        OuterExtent="35" StartValueString="0">
                                        <BrushElements>
                                            <iggauge:SolidFillBrushElement Color="DimGray" />
                                        </BrushElements>
                                    </iggauge:LinearGaugeRange>
                                </Ranges>
                                <StrokeElement Color="Transparent">
                                </StrokeElement>
                                <Axes>
                                    <iggauge:NumericAxis EndValue="100" TickmarkInterval="10" />
                                </Axes>
                            </iggauge:LinearGaugeScale>
                            <iggauge:LinearGaugeScale EndExtent="90" StartExtent="10">
                                <MajorTickmarks EndExtent="40" EndWidth="2" StartExtent="20" StartWidth="2">
                                    <StrokeElement Color="DimGray">
                                    </StrokeElement>
                                    <BrushElements>
                                        <iggauge:SolidFillBrushElement Color="White" />
                                    </BrushElements>
                                </MajorTickmarks>
                                <MinorTickmarks EndExtent="75" Frequency="0.2" StartExtent="65">
                                    <StrokeElement Color="Transparent">
                                    </StrokeElement>
                                </MinorTickmarks>
                                <Labels Extent="70" Font="Trebuchet MS, 10pt, style=Bold"
                                    ZPosition="AboveMarkers">
                                    <Shadow Depth="2">
                                        <BrushElements>
                                            <iggauge:SolidFillBrushElement />
                                        </BrushElements>
                                    </Shadow>
                                    <BrushElements>
                                        <iggauge:SolidFillBrushElement Color="White" RelativeBounds="0, 0, 80, 0"
                                            RelativeBoundsMeasure="Percent" />
                                    </BrushElements>
                                </Labels>
                                <Markers>
                                    <iggauge:LinearGaugeNeedle EndExtent="57" EndWidth="10" MidExtent="57"
                                        MidWidth="20" StartExtent="40" StartWidth="0" ValueString="75">
                                        <StrokeElement Color="186, 0, 0" Thickness="2">
                                        </StrokeElement>
                                        <BrushElements>
                                            <iggauge:SolidFillBrushElement Color="255, 22, 22" />
                                        </BrushElements>
                                    </iggauge:LinearGaugeNeedle>
                                </Markers>
                                <Axes>
                                    <iggauge:NumericAxis EndValue="100" TickmarkInterval="20" />
                                </Axes>
                            </iggauge:LinearGaugeScale>
                        </Scales>
                        <BrushElements>
                            <iggauge:SimpleGradientBrushElement EndColor="150, 150, 150"
                                GradientStyle="BackwardDiagonal" StartColor="Black" />
                        </BrushElements>
                    </iggauge:LinearGauge>
                </Gauges>
            </iggauge:UltraGauge>