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

Forcing Radial Slider Values --> stems from tick frequency issues

Hi, 

I am trying to use the SfRadialSlider for device control. I would like the slider to display values between 0-250 (simple enough). I currently have it so that the radial pointer label is hidden and the value is instead displayed in an editable textbox at the center of the control. There is a two way binding between the textbox value and the slider value. 

HOWEVER, though I would like to display all values between 0-250, I want all values (NOTE: values can be selected on the slider or entered in the textbox) below 0.5 to coerce to 0.5 since the device can only handle values between 0.5-250. I would just set the MinValue property of the control to 0.5, but that makes the tick numbering very ugly. Is this possible to do?

Thanks!

3 Replies

DR Durga Rajan Syncfusion Team January 18, 2017 12:08 PM UTC

Hi Eric Baumann,

Thank you for contacting Syncfusion support.

We have checked your query and prepared a sample that tries to meet your requirement. In this sample, we have increased the height and width of the control to display the values between 0.5 to 250 properly. Label values will get overlap, if we tries to display all the values between 0.5 to 250. So we can display the labels with some interval as per our requirement to avoid overlapping of value by changing the TickFrequency property. Please download the sample for the same from the following location.

Sample: RadialSlider_Sample

Regards,
Durga S.


EB Eric Baumann January 18, 2017 05:40 PM UTC

Hi Durga,

Thanks for the response, I think I need to clarify my request though. The slider value can be set 3 different ways by the user: they can click on the slider itself, they can enter a value in the slider's text box, or they can load a pre-made module that sets a value from a database. 

The slider will have properties as follows: MinValue="0" MaxValue="250" TickFrequency="25" (so 10 total ticks) SmallChange="2" (which means that by clicking on the slider, the user should only be able to change in increments of 2, right? They should still be able to enter decimal values in the textbox I believe).

The device this slider is controlling cannot tolerate a value below 0.5, so I would like to coerce all values below 0.5 to 0.5 so as to not break the device. The database doesn't contain any values below 0.5, so the only things I would need to defend against would be the user setting a value in the textbox and the slider itself. For example, if the user turns the slider to 0, the slider should instead alter its value to 0.5. 

Am I correct in that the slider can take decimal values too? I obviously couldn't accomplish decimals via the slider (unless I edit the SmallChange value or previously enter a decimal value to the slider), but via the textbox or database.

Thanks
-Eric



DR Durga Rajan Syncfusion Team January 19, 2017 07:06 AM UTC

Hi Eric Baumann,

Thanks for your update.

Query 1: For example, if the user turns the slider to 0, the slider should instead alter its value to 0.5.

We can change the Slider value as 0.5 when the value of slider is less than 0.5 in ValueChanged event of SfRadialSlider. We have modified the sample and you can download the sample from the below location.

Sample: RadialSlider_Modified_Sample

Query 2: I obviously couldn't accomplish decimals via the slider (unless I edit the SmallChange value or previously enter a decimal value to the slider), but via the textbox or database.

We can select the decimal values from the slider only if the SmallChange value is decimal. So we cannot select decimal values from the slider when the Small change is 2 (Two).

Regards,
Durga S.

Loader.
Live Chat Icon For mobile
Up arrow icon