New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add initial support for ChartJs plugins #14433
base: master
Are you sure you want to change the base?
feat: Add initial support for ChartJs plugins #14433
Conversation
Jenkins BuildsClick to see older builds (18)
|
1e4e09a
to
02b00fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff! 🚀
Just some minor comments/suggestions inline
ui/StatusQ/src/StatusQ/Components/private/chart/Library/Library.js
Outdated
Show resolved
Hide resolved
ui/StatusQ/src/StatusQ/Components/private/chart/ChartCanvas.qml
Outdated
Show resolved
Hide resolved
ui/StatusQ/src/StatusQ/Components/private/chart/Library/Library.js
Outdated
Show resolved
Hide resolved
ui/StatusQ/src/StatusQ/Components/private/chart/Library/Library.js
Outdated
Show resolved
Hide resolved
02b00fa
to
f0fe650
Compare
ui/StatusQ/src/StatusQ/Components/private/chart/Library/Library.js
Outdated
Show resolved
Hide resolved
The |
ui/StatusQ/src/StatusQ/Components/private/chart/Library/Library.js
Outdated
Show resolved
Hide resolved
ui/StatusQ/src/StatusQ/Components/private/chart/Library/Library.js
Outdated
Show resolved
Hide resolved
f0fe650
to
ca7243d
Compare
+ adding plugin for crosshair and zoom + adding plugin for data labels
ca7243d
to
45d9af1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔝
What does the PR do
Closes #13936
Load the original Chart.JS 2.9.4 library as an IIFE module
Loading the original CharJS library will enable us to load chart plugins since most of them expect this format.
Loading the original library requires a few adaptations:
Polyfill.js
- This module is responsible to provide the functionality expected by ChartJs or plugins that is traditionally provided by the web browser. Basically anything related towindow
ordocument
Library.js
- This module loads the ChartJS module, plugins and Polyfills. It will provide the necessary glue code to adapt the ChartJs and plugins to the QML environment. E.g. generate mouse events, resize eventsLoad crosshair and data labels plugins
https://github.com/AbelHeinsbroek/chartjs-plugin-crosshair/tree/v1.1.3?tab=readme-ov-file
https://github.com/chartjs/chartjs-plugin-datalabels/tree/v1.0.0
Add demo charts in storybook
Screen.Recording.2024-04-16.at1.09.59.36.mov
Affected areas
Charts