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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -