- Home
- Forum
- ASP.NET MVC - EJ 2
- Allow range navigator to snap to specific data points?
Allow range navigator to snap to specific data points?
Hi,
I was wondering if it is possible to have the Range Navigator control snap to specific values?
For example, I have many times on the X axis which have a minute interval, but they start 5 seconds passed the minute like "12:45:05".
Currently I can set the Range Navigator to have an Interval Type of Minutes, and set the Interval to 1, however this only allows me to snap to times which are exactly on the minute.
Craig,
Greetings from Syncfusion.
You can customize the Range Navigator to display the axis labels in the desired format. Here’s how to achieve that:
• Setting labelFormat: By setting labelFormat to "hh:mm:ss" in the primaryXAxis, you can format the axis labels to show the time as "12:45:05".
• Interval Configuration: If you set the intervalType to 'Minutes', the data will be rendered based on minute intervals, which means it will snap to the start of each minute (e.g., "12:45:00"). If you set intervalType to 'Seconds' and interval to 60, it will effectively render labels every minute but in a way that accounts for seconds. This means you could get values that represent the seconds past the minute mark, like 12:45:05.
Code-snippet:
|
<div id='container'> @(Html.EJS().RangeNavigator("container") .ValueType(Syncfusion.EJ2.Charts.RangeValueType.DateTime) .LabelFormat("hh:mm:ss") </div> |
Documentation: For detailed information, you can refer to the documentation: https://ej2.syncfusion.com/aspnetmvc/documentation/range-navigator/labels#labels-customization
If this setup does not meet your requirements, please share dataSource and screenshot which illustrates your requirement which will be helpful for further analysis and provide you the solution sooner.
Regards,
Nishanthi
Unfortunately this solution does not meet my requirements.
However, I don't think what I am looking for is possible with the Range Navigator control. This is due to my dataset having inconsistent intervals, so setting to control to snap at consistent intervals (e.g. every 60 seconds) does not fulfil my needs.
Thank you for you help,
Craig
Criag,
We are analyzing your reported scenario. We will update the status within one business day. We appreciate your patience until then.
Nishanthi
Hi Craig,
In the current Range Navigator, if the intervalType is set to 'Minutes' and the first data point includes seconds (e.g., "12:45:05"), the labels will snap to the start of each minute (e.g., "12:45:00"). In this the only way is, setting the intervalType to 'Seconds' with an interval of 60 will ensure that labels are rendered every minute while displaying the exact seconds.
Kindly revert us if you have any concerns.
Regards,
Nishanthi
Hi Nishanthi,
The problem I have is that I have days of data with mostly minute intervals between them. Therefore having all the seconds render on the range navigator causes too many grid lines, covering the visible data.
I have already got another solution working for me, but thank you for your help,
Kind regards,
Craig
Hi Craig,
Most Welcome! Please get back to us if you need further assistance.
Regards,
Nishanthi
- 6 Replies
- 2 Participants
-
CB Craig B
- Oct 25, 2024 02:28 PM UTC
- Nov 21, 2024 03:51 AM UTC