Hello,
I am trying to convert the time entered in the xamtimeeditors to the range values and noticing an offset in the maximum value till 12:06 but seems good after 12:45. Can you please let me know the problem. I have also attached the project along with the screenshot.
Attached the screenshot as well
Hi Gopi,
Since the chart inside the zoombar is not positioned perfectly at the outer edges of the zoombar thumb, the range value that you are calculating using the time in the chart is not going to map 1 to 1 with the zoombar range. There needs to be an offset of some kind to the calculated value I think. I'm currently trying to work out how to calculate that offset and apply it correctly to the zoombar. I will get back to you shortly.
It is tricky to try and map the zoombar min and max to the min and max in the data chart. I had to do a little trial and error in order to find suitable values for the calculation but I think I settled on a good set of numbers. I updated your sample with the calculation.
Let me know if you have any questions.
This is good enough only when we map the time input to zoombar min and max values but the vice versa is failing i.e from the zoom bar to date time. i.e by changing the zoom bar the values in date time input looks incorrect.
The time 10:09 to 1048
So trying to calculate the correct min and max with an offset is probably not the best way to do this. Instead I tried adjusting the margin of the chart and the preview element that the zoombar uses because right now it defaults to a pretty large margin which is throwing off your original calculations. If we can line up the chart with the zoombar thumb properly then you can use your original calculations unaltered.
Take a look at the attached sample where I adjust the margins. It seems to work very well with your original code and it works both ways. I can type in a time or I can move the thumb and the time will update correctly.
Looks good , Thanks