From 86b9139617767404f33236158f5ab2f3631d6310 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mathias=20K=C3=BCsel?= Date: Sun, 7 Feb 2016 04:55:42 +0100 Subject: [PATCH] Adds the ability to draw custom point styles --- src/elements/element.point.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/elements/element.point.js b/src/elements/element.point.js index b73e2bea8..12d09f557 100644 --- a/src/elements/element.point.js +++ b/src/elements/element.point.js @@ -55,6 +55,11 @@ module.exports = function(Chart) { return; } + if (typeof vm.pointStyle === 'object' && ((vm.pointStyle.toString() === '[object HTMLImageElement]') || (vm.pointStyle.toString() === '[object HTMLCanvasElement]'))) { + ctx.drawImage(vm.pointStyle, vm.x - vm.pointStyle.width / 2, vm.y - vm.pointStyle.height / 2); + return; + } + if (vm.radius > 0 || vm.borderWidth > 0) { ctx.strokeStyle = vm.borderColor || Chart.defaults.global.defaultColor; -- 2.47.2