Skip to content

Commit

Permalink
update Chartist library to v1.3 and patch tooltip plugin
Browse files Browse the repository at this point in the history
Chartist library has been target of major refactoring. Update old v0.11
to latest v1.3 and use the patched tooltip plugin v1.0.

(cherry picked from commit 0b3d055)
  • Loading branch information
stklcode committed Nov 11, 2024
1 parent 38bee36 commit 94832a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
],
"require": {
"php": "^5.2|^7|^8",
"npm-asset/chartist": "0.11.4",
"npm-asset/chartist-plugin-tooltips-updated": "0.1.4"
"npm-asset/chartist": "^1.3.0",
"npm-asset/chartist-plugin-tooltips-updated": "^1.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
Expand Down Expand Up @@ -82,11 +82,9 @@
},
"extra": {
"copy-file": {
"vendor/npm-asset/chartist/dist/chartist.min.css": "css/",
"vendor/npm-asset/chartist/dist/chartist.min.js": "js/",
"vendor/npm-asset/chartist/dist/chartist.min.js.map": "js/",
"vendor/npm-asset/chartist-plugin-tooltips-updated/dist/chartist-plugin-tooltip.min.js": "js/",
"vendor/npm-asset/chartist-plugin-tooltips-updated/dist/chartist-plugin-tooltip.min.js.map": "js/"
"vendor/npm-asset/chartist/dist/index.css": "css/chartist.min.css",
"vendor/npm-asset/chartist/dist/index.umd.js": "js/chartist.min.js",
"vendor/npm-asset/chartist-plugin-tooltips-updated/dist/chartist-plugin-tooltip.min.js": "js/"
}
},
"config": {
Expand Down
4 changes: 2 additions & 2 deletions js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}

// Draw chart.
chart = new Chartist.Line( '#statify_chart', {
chart = new Chartist.LineChart( '#statify_chart', {
labels: labels,
series: [
data,
Expand All @@ -47,7 +47,7 @@
low: 0,
showArea: true,
fullWidth: fullWidth,
width: ( fullWidth ? null : 5 * data.length ),
width: ( fullWidth ? undefined : 5 * data.length ),
axisX: {
showGrid: false,
showLabel: false,
Expand Down

0 comments on commit 94832a4

Please sign in to comment.