Is it possible to limit the drag behaviour / data editing in charts to change by Integers only?

Hi,


As the title suggests, is it possible to limit the change to the Y value in a chart with dragSettings enabled to only increase/decrease in whole numbers (integers)?


I can only find a way to have it increase in in decimal places and that doesn't work for my use case.


You can use the demo documentation as an example:


https://ej2.syncfusion.com/javascript/documentation/chart/data-editing/


Your assistance is much appreciated.


Cheers!


EDIT:  I guess it doesn't matter if the raw data is decimals, but I only want the tool tip to display integers.  I'll see if the tool tip module can be formatted accordingly.





3 Replies

SB Swetha Babu Syncfusion Team April 7, 2022 02:30 PM UTC

Hi Philip,


Greetings from Syncfusion.


We can set the minimum and maximum value for the drag using the minY and maxY property in dragSettings in series. Please find the below documentation link and stackblitz link for your sample reference.


Sample link: https://stackblitz.com/edit/texu9l-1kpnw4?file=index.js


Documentation link: https://ej2.syncfusion.com/javascript/documentation/chart/data-editing/


Kindly, revert us if you have any concerns.


Regards,

Swetha



PH Philip replied to Swetha Babu April 8, 2022 12:01 AM UTC

Hi Sweetha,


Thanks for your reply, but those properties only seem to effects the min and max values that a user can drag the chart to.


The increment it drags by still appears to be a number with 2 decimal places.


I guess i'm referring to something similar to the STEP value used in common HTML number inputs.


In many cases a user might be using charts that have y values in the 000's, and dragging that number from 9000 to 9010.26 isn't very practical.


In the example you linked, and all other documentation, the drag seems to always increase by decimals.  Is there a way to limit this STEP or INCREMENT value to whole numbers/integers?


Regards,

Phil





SB Swetha Babu Syncfusion Team April 8, 2022 11:33 AM UTC

Hi Philip,


Thank you for your update.


We don't have support to acheive your requirement. Please let us know if you have any other concerns.


Thanks,

Swetha


Loader.
Up arrow icon