Shimming plugins from v0.x to work with v1, for ES6 sites #1387
timstallmann
started this conversation in
Show and tell
Replies: 1 comment
-
Thanks so much for posting this, @timstallmann! I am sure it's going to be a big help for anyone trying to use plugins with Chartist versions 1.0 and above. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all!
I needed to get plugins working on a vue site that is being upgrade to chartist v1, and it turned out to be pretty easy to do, so thought I would leave notes here in case others are in the same situation.
Unfortunately I didn't have time on this project to create a PR for the plugin itself updated to work with v1.
The general approach:
Chartist.whatever
and replace them with imports from theChartist
module. E.g.import {Svg, normalizePadding} from 'chartist';
var
=>const
). The plugin itself should become a function taking options, which returns a function which acts on the chart, e.g.:Here's a gist of the reformatted axis title plugin: https://gist.github.com/timstallmann/53d70a1a57c51c35d370cf53397e6a5f
Beta Was this translation helpful? Give feedback.
All reactions