Skip to content

Proto

Compare
Choose a tag to compare
@gionkunz gionkunz released this 18 Oct 13:08
· 616 commits to main since this release

This release only includes changes relevant for developers. Chartist.js does now include a prototype helper module and all the charts are refactored to inherit from a base chart. This makes maintainability easier in the future and will also help with problems that have a polymorph nature (like multiple charts combined / combo chart).

In the prototype helper module (chartist.class.js) there is a fallback mechanism for the constructor functions so you can still call chart constructors as functions without the new keyword. The fallback mechanism will create a new object with the chart as prototype and delegate the constructor call. This way you can write var chart = new Chartist.Line(); but also var chart = Chartist.Line(); without any drawbacks. This provides the necessary backwards compatibility.