0๐
โ
I think you could try to use the method extend
of the the RectangleElement, and also the BarController, adding the property dataElementType
, like this:
const rectangleElement = Chart.elements.Rectangle;
const otherRectangleElement = rectangleElement.extend({
draw() {
const ctx = this._chart.ctx;
// ...
}
}
Chart.defaults.CustomerRetention = Chart.defaults.bar;
Chart.controllers.CustomerRetention = Chart.controllers.bar.extend({
dataElementType: otherRectangleElement,
draw(ease) {
Chart.controllers.bar.prototype.draw.call(this, ease);
// ...
}
}
Source:stackexchange.com