Closed arnard76 closed 3 months ago
The feature seems quite smooth but can be possibly missed, would some text noting or some indication (like a small icon) of this feature be helpful for ux?
The feature seems quite smooth but can be possibly missed, would some text noting or some indication (like a small icon) of this feature be helpful for ux?
I don't mind if they miss the feature too much. More important the the feature is there if they try to interact with the graph.
But I could add a 'reset zoom' button, similar to this example: https://www.chartjs.org/chartjs-plugin-zoom/latest/guide/usage.html
Then user might realize zoom is available.
Ill merge this with no indicator that there is zoom/pan feature on the chart.
Happy to revisit if there is any issues.
Task
261
Solution
https://github.com/uoa-compsci399-s1-2024/capstone-project-2024-s1-team-15/assets/78939786/75679ad0-5715-4f88-8218-302fea23baa8
can zoom (the x-axis) with mouse wheel or trackpad pinch
can pan (the x-axis) with drag (click & drag)
only zooms within the date filter range. NOTE: date filter doesn't update when zooming in and out hopefully, that isn't an issue?
Code changes
chartjs-plugin-zoom
import zoomPlugin from "chartjs-plugin-zoom"
has to be on client soMultiChart
component is imported using next'sdynamic
i am not entirely sure how this function (next/dynamic()) works .... yet 😁MultiChart
component