Chartjs-What is the benefit of front-end framework wrappers for charting libraries (i.e. vue-chartjs, react-chartjs-2…etc.)?

1👍

Typically these will bind the data used to create the chart with your front-end framework. If your framework is made of Components, it is “simple” to create a new chart with data already in your component’s scope. Especially if you have charts all over your app, putting them into a component will save a lot of cut-n-paste code.

Or if your chart changes data, most frameworks will “watch” for when a data value/property has been updated and have a hook to re-create the chart. The data binding is part of the framework and utilized by the wrapper so you do not have to.

If you’re using a framework, the wrapper will make using the chart seem more “natural” to the other parts on the page. Plus, if the wrapper project is actually maintained/updated, you can get some new features and bug fixes without much trouble.

Overall it’s likely just a time-saving thing. One can always write their own code, and maintain their own code. I’m sure there are cases where manually updating the chart is useful, but for simple implementations the wrapper is often faster.

Leave a comment