엉터리 개발 이야기
chartjs new charts
억삼이
2019. 3. 15. 17:25
반응형
Chart.defaults.bignumberbar = Chart.defaults.bar;
var custom = Chart.controllers.bar.extend({
draw: function(ease) {
Chart.controllers.bar.prototype.draw.call(this, ease);
var ctx = this.chart.chart.ctx;
var canvas = this.chart.chart.canvas;
ctx.save();
this.chart.chart.titleBlock.top = -10;
ctx.font = '30px Arial';
ctx.fillText('Test1234', (this.chart.width / 2) * 0.65, this.chart.height / 2);
ctx.restore();
}
});
Chart.controllers.bignumberbar = custom;
반응형