We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Negative Numbers in Range

Is there any way to use negative numbers in a LinearGauge? I'm wanting to use a scale which stretches between negative and positive numbers, but when using this pointers and ranges seem to get messed up and not show in the correct positions. 

The code below shows an example where the symbol pointer is not shown (also the chart doesn't seem to start at -15 either) :

SfLinearGauge linearGauge;
            linearGauge = new SfLinearGauge ();
            linearGauge.BackgroundColor = Color.White;
            linearGauge.Orientation = Orientation.OrientationVertical;
            //Scale
            ObservableCollection<LinearScale> scales = new ObservableCollection<LinearScale> ();
            LinearScale scale = new LinearScale ();
            scale.MinimumValue = -15;
            scale.MaximumValue = 15;
            scale.Interval = 5;
            scale.ScaleBarLength = 100;
            scale.ScaleBarColor = Color.FromRgb (250, 236, 236);
            scale.LabelColor = Color.FromRgb (84, 84, 84); 
            scale.MinorTicksPerInterval = 1;
            scale.ScaleBarSize = 13;
            scale.ScalePosition = ScalePosition.BackWard;

            List<LinearPointer> pointers = new List<LinearPointer> ();
            //SymbolPointer
            SymbolPointer symbolPointer = new SymbolPointer ();
            symbolPointer.Value = -10.0;
            symbolPointer.Offset = -0.17;
            symbolPointer.Thickness = 3;
            symbolPointer.Color = Color.FromRgb (65, 77, 79);
            pointers.Add (symbolPointer);

            //Minor Ticks setting
            LinearTickSettings minor = new LinearTickSettings ();
            minor.Length = 10;
            minor.Color = Color.FromRgb (175, 175, 175);
            minor.Thickness = 1;
            scale.MinorTickSettings = minor;

            //Major Ticks setting
            LinearTickSettings major = new LinearTickSettings ();
            major.Length = 10;
            major.Color = Color.FromRgb (175, 175, 175);
            major.Thickness = 1;
            scale.MajorTickSettings = major;

            scale.Pointers = pointers;
            scales.Add (scale);
            linearGauge.Scales = scales;
  

1 Reply

PA Paul Anderson S Syncfusion Team May 16, 2016 05:20 AM UTC

Hi James,

Thank you for contacting Syncfusion Support.

We have created a new incident under your account for achieving Negative numbers in LinearGauge. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/

Regards,
Paul Anderson

Loader.
Live Chat Icon For mobile
Up arrow icon