Replies: 7 comments
-
@leovalencia10 is this chart live anywhere? Or could you make something like a jsfiddle or plunkr to reproduce? It would really help me to see it in action |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into this issue Ben, let me quickly put together a live demo for the issue. |
Beta Was this translation helpful? Give feedback.
-
I have two live examples here. This one shows the issue on the variance chart: https://gandalf.gammawizard.com/variance2/ And this one uses an old version and the ticks are nicely spaced: https://gandalf.gammawizard.com/variance/ The charts update realtime so it would be better to see them after 4:30 PM EST (UTC-5) |
Beta Was this translation helpful? Give feedback.
-
A few suggestions to give you more control over how things appear:
See this example that shows many of those tips that you might find useful: Let me know if setting those options will give you something more like you're looking for |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestions, I can't really set the units manually as the number of data points varies during the day. Of course, I can play with all the options until I get something that resembles the old versions, but realistically it is just easier to use an old version of ChartJS instead (I have literally dozens of charts scattered over many different apps). It would seem that 2.9.0 is sticking to the "minute" units no matter the number of data points available. This seems like a code regression as old versions were able to adjust units based on the number of data points available, perhaps the new code is not taking into account that the X-axis is "time" based? |
Beta Was this translation helpful? Give feedback.
-
I believe the unit is supposed to represent how far apart each data point is. In your case it looks like you have data for each minute, so the unit probably should be always unit. It seems to me like there was a bug in 2.8 that just so happened to give a behavior that was better for your use case, but I don't think we'd be likely to revert it. I don't think you actually have to set |
Beta Was this translation helpful? Give feedback.
-
Thanks for the assistance Ben, just for reference the nice auto tick behavior was present since a long time ago (probably earlier than 2.7.0), in fact, the example with the nice ticks is using the 2.7.3 version. I got confused with the units as I thought they were used to determine where to place ticks. I'll play with the options to see if I can get the display to provide visually pleasing ticks and tick labels. |
Beta Was this translation helpful? Give feedback.
-
Report from @leovalencia10. (@leovalencia10 I'm migrating your comment to a new issue because I think it's slightly different than the issue you commented on and I want to keep them separate)
I updated from 2.8.0 to 2.9.3 and without touching the code, my time charts added lots of extra ticks. It seems the heuristic to auto space them is not working correctly. In 2.8.0 I would get ticks at different interval units depending on the amount of data (I have data that accumulates realtime during the day. So if I only had data for the first 20 minutes of a session, then I would get ticks nicely spaced at 1-minute intervals. Then as more data kept coming in the interval grew (5 minutes, 10 minutes, 30 minutes ) and finally, it settled around 1 hour wide ticks (very nice and clean). With 2.9.3 I seem to get 5-minute interval spacing as soon as the number of data points grows, which produces lots of gridlines that don't convey extra information, plus the labels for those unnecessary ticks start to eat vertical space reducing the visual area for useful information.
Beta Was this translation helpful? Give feedback.
All reactions