Page 1 of 1

Linear Gauge with Zero in center

Posted: Wed Nov 09, 2011 7:00 am
by 13048887
Hi,

I have a series of linear gauges displaying OK and I can set the range to -50 to +50. However, is it possible when I set the Gauge.value to say -25 that the horizontal bar starts at the zero point and extends left or right to negative or positive values respectively rather than from the far left?

If so then can the colours also be set for certain range i.e. green if between -10 and +10, yellow and then say red if less than -30 and more than +30

Any assistance greatly appreciated.

Cheers
Rob

Re: Linear Gauge with Zero in center

Posted: Wed Nov 09, 2011 1:17 pm
by 10050769
Hello Innervations,

I have think you can do something as next code, where I change minimum and maximum values of Series because LinerSeries set negative values:

Code: Select all

        private void InitializeChart()
        {
            Steema.TeeChart.Styles.LinearGauge linerGauge = new LinearGauge(tChart1.Chart);
            linerGauge.Add(-50);
            linerGauge.Add(-25);
            linerGauge.Add(0);
            linerGauge.Add(25);
            linerGauge.Add(50);

            linerGauge.Value = 20;
            linerGauge.Maximum = 50;
            linerGauge.Minimum = -50;
            linerGauge.UseValueColorPalette = true;

  
            linerGauge.GreenLineStartValue = -50;
            linerGauge.GreenLineEndValue = 0;
            linerGauge.RedLineStartValue = 0;
            linerGauge.RedLineStartValue = 25;
}
Can you please, tell us if previous code works as you expected? On the other hand, I recommend take a look in Demo Project examples, concretely All Features\Welcome !\Chart styles\Gauges where you can more information how you treat Gauges series.

I hope will helps.

Thanks,