angularjs - Extending Existing Chart Types angular chart js using chart js 2.0 -
i'm using great chart.js (version: 2.0.2) , angular-chart.js (version: 1.0.0-beta1) compatibility purposes. there lot of functionalities add project (like adding horizontal line chart or having rounded corners bar chart). theses solutions use
chart.types.[typeofthecharttoextend].extend({..}).
i'm stuck using chart.js v2.0, doc isn't clear. how can extend existing chart using chart.js v2.0 ?
any advice or example appreciated. thanks!
try line chart:
var originallinecontroller = chart.controllers.line; chart.controllers.line = chart.controllers.line.extend({ draw: function() { originallinecontroller.prototype.draw.apply(this, arguments); /* own drawing code here */ } }
you can context with:
var ctx = this.chart.chart.ctx;
Comments
Post a Comment