diff --git a/src/controllers/controller.styleBar.js b/src/controllers/controller.styleBar.js index ae9e345..10ef2f7 100644 --- a/src/controllers/controller.styleBar.js +++ b/src/controllers/controller.styleBar.js @@ -39,7 +39,11 @@ export default function(Chart) { shadowColor: custom.shadowColor ? custom.shadowColor : helpers.valueAtIndexOrDefault(dataset.shadowColor, index, rectangleOptions.shadowColor), bevelWidth: custom.bevelWidth ? custom.bevelWidth : helpers.valueAtIndexOrDefault(dataset.bevelWidth, index, rectangleOptions.bevelWidth), bevelHighlightColor: custom.bevelHighlightColor ? custom.bevelHighlightColor : helpers.valueAtIndexOrDefault(dataset.bevelHighlightColor, index, rectangleOptions.bevelHighlightColor), - bevelShadowColor: custom.bevelShadowColor ? custom.bevelShadowColor : helpers.valueAtIndexOrDefault(dataset.bevelShadowColor, index, rectangleOptions.bevelShadowColor) + bevelShadowColor: custom.bevelShadowColor ? custom.bevelShadowColor : helpers.valueAtIndexOrDefault(dataset.bevelShadowColor, index, rectangleOptions.bevelShadowColor), + innerGlowWidth: custom.innerGlowWidth ? custom.innerGlowWidth : helpers.valueAtIndexOrDefault(dataset.innerGlowWidth, index, rectangleOptions.innerGlowWidth), + innerGlowColor: custom.innerGlowColor ? custom.innerGlowColor : helpers.valueAtIndexOrDefault(dataset.innerGlowColor, index, rectangleOptions.innerGlowColor), + outerGlowWidth: custom.outerGlowWidth ? custom.outerGlowWidth : helpers.valueAtIndexOrDefault(dataset.outerGlowWidth, index, rectangleOptions.outerGlowWidth), + outerGlowColor: custom.outerGlowColor ? custom.outerGlowColor : helpers.valueAtIndexOrDefault(dataset.outerGlowColor, index, rectangleOptions.outerGlowColor) }; me.updateElementGeometry(rectangle, index, reset); @@ -64,6 +68,10 @@ export default function(Chart) { element.$previousStyle.bevelWidth = model.bevelWidth; element.$previousStyle.bevelHighlightColor = model.bevelHighlightColor; element.$previousStyle.bevelShadowColor = model.bevelShadowColor; + element.$previousStyle.innerGlowWidth = model.innerGlowWidth; + element.$previousStyle.innerGlowColor = model.innerGlowColor; + element.$previousStyle.outerGlowWidth = model.outerGlowWidth; + element.$previousStyle.outerGlowColor = model.outerGlowColor; } model.shadowOffsetX = custom.hoverShadowOffsetX ? custom.hoverShadowOffsetX : valueOrDefault(dataset.hoverShadowOffsetX, index, model.shadowOffsetX); @@ -73,6 +81,10 @@ export default function(Chart) { model.bevelWidth = custom.hoverBevelWidth ? custom.hoverBevelWidth : valueOrDefault(dataset.hoverBevelWidth, index, model.bevelWidth); model.bevelHighlightColor = custom.hoverBevelHighlightColor ? custom.hoverBevelHighlightColor : valueOrDefault(dataset.hoverBevelHighlightColor, index, helpers.getHoverColor(model.bevelHighlightColor)); model.bevelShadowColor = custom.hoverBevelShadowColor ? custom.hoverBevelShadowColor : valueOrDefault(dataset.hoverBevelShadowColor, index, helpers.getHoverColor(model.bevelShadowColor)); + model.innerGlowWidth = custom.hoverInnerGlowWidth ? custom.hoverInnerGlowWidth : valueOrDefault(dataset.hoverInnerGlowWidth, index, model.innerGlowWidth); + model.innerGlowColor = custom.hoverInnerGlowColor ? custom.hoverInnerGlowColor : valueOrDefault(dataset.hoverInnerGlowColor, index, helpers.getHoverColor(model.innerGlowColor)); + model.outerGlowWidth = custom.hoverOuterGlowWidth ? custom.hoverOuterGlowWidth : valueOrDefault(dataset.hoverOuterGlowWidth, index, model.outerGlowWidth); + model.outerGlowColor = custom.hoverOuterGlowColor ? custom.hoverOuterGlowColor : valueOrDefault(dataset.hoverOuterGlowColor, index, helpers.getHoverColor(model.outerGlowColor)); }, removeHoverStyle: function(element) { @@ -92,6 +104,10 @@ export default function(Chart) { model.bevelWidth = custom.bevelWidth ? custom.bevelWidth : valueOrDefault(dataset.bevelWidth, index, elementOpts.bevelWidth); model.bevelHighlightColor = custom.bevelHighlightColor ? custom.bevelHighlightColor : valueOrDefault(dataset.bevelHighlightColor, index, elementOpts.bevelHighlightColor); model.bevelShadowColor = custom.bevelShadowColor ? custom.bevelShadowColor : valueOrDefault(dataset.bevelShadowColor, index, elementOpts.bevelShadowColor); + model.innerGlowWidth = custom.innerGlowWidth ? custom.innerGlowWidth : valueOrDefault(dataset.innerGlowWidth, index, elementOpts.innerGlowWidth); + model.innerGlowColor = custom.innerGlowColor ? custom.innerGlowColor : valueOrDefault(dataset.innerGlowColor, index, elementOpts.innerGlowColor); + model.outerGlowWidth = custom.outerGlowWidth ? custom.outerGlowWidth : valueOrDefault(dataset.outerGlowWidth, index, elementOpts.outerGlowWidth); + model.outerGlowColor = custom.outerGlowColor ? custom.outerGlowColor : valueOrDefault(dataset.outerGlowColor, index, elementOpts.outerGlowColor); } BarController.prototype.removeHoverStyle.apply(this, arguments); diff --git a/src/controllers/controller.styleBubble.js b/src/controllers/controller.styleBubble.js index 9dfc625..46a8618 100644 --- a/src/controllers/controller.styleBubble.js +++ b/src/controllers/controller.styleBubble.js @@ -50,7 +50,11 @@ export default function(Chart) { shadowColor: options.shadowColor, bevelWidth: options.bevelWidth, bevelHighlightColor: options.bevelHighlightColor, - bevelShadowColor: options.bevelShadowColor + bevelShadowColor: options.bevelShadowColor, + innerGlowWidth: options.innerGlowWidth, + innerGlowColor: options.innerGlowColor, + outerGlowWidth: options.outerGlowWidth, + outerGlowColor: options.outerGlowColor }; point.pivot(); @@ -71,6 +75,13 @@ export default function(Chart) { element.$previousStyle.shadowOffsetY = model.shadowOffsetY; element.$previousStyle.shadowBlur = model.shadowBlur; element.$previousStyle.shadowColor = model.shadowColor; + element.$previousStyle.bevelWidth = model.bevelWidth; + element.$previousStyle.bevelHighlightColor = model.bevelHighlightColor; + element.$previousStyle.bevelShadowColor = model.bevelShadowColor; + element.$previousStyle.innerGlowWidth = model.innerGlowWidth; + element.$previousStyle.innerGlowColor = model.innerGlowColor; + element.$previousStyle.outerGlowWidth = model.outerGlowWidth; + element.$previousStyle.outerGlowColor = model.outerGlowColor; } model.shadowOffsetX = valueOrDefault(options.hoverShadowOffsetX, options.shadowOffsetX); @@ -80,6 +91,10 @@ export default function(Chart) { model.bevelWidth = valueOrDefault(options.hoverBevelWidth, options.bevelWidth); model.bevelHighlightColor = valueOrDefault(options.hoverBevelHighlightColor, helpers.getHoverColor(options.bevelHighlightColor)); model.bevelShadowColor = valueOrDefault(options.hoverBevelShadowColor, helpers.getHoverColor(options.bevelShadowColor)); + model.innerGlowWidth = valueOrDefault(options.hoverInnerGlowWidth, options.innerGlowWidth); + model.innerGlowColor = valueOrDefault(options.hoverInnerGlowColor, helpers.getHoverColor(options.innerGlowColor)); + model.outerGlowWidth = valueOrDefault(options.hoverOuterGlowWidth, options.outerGlowWidth); + model.outerGlowColor = valueOrDefault(options.hoverOuterGlowColor, helpers.getHoverColor(options.outerGlowColor)); }, /** @@ -98,6 +113,10 @@ export default function(Chart) { model.bevelWidth = options.bevelWidth; model.bevelHighlightColor = options.bevelHighlightColor; model.bevelShadowColor = options.bevelShadowColor; + model.innerGlowWidth = options.innerGlowWidth; + model.innerGlowColor = options.innerGlowColor; + model.outerGlowWidth = options.outerGlowWidth; + model.outerGlowColor = options.outerGlowColor; } BubbleController.prototype.removeHoverStyle.apply(this, arguments); @@ -147,7 +166,18 @@ export default function(Chart) { 'hoverShadowColor', 'bevelWidth', 'bevelHighlightColor', - 'bevelShadowColor' + 'bevelShadowColor', + 'hoverBevelWidth', + 'hoverBevelHighlightColor', + 'hoverBevelShadowColor', + 'innerGlowWidth', + 'innerGlowColor', + 'outerGlowWidth', + 'outerGlowColor', + 'hoverInnerGlowWidth', + 'hoverInnerGlowColor', + 'hoverOuterGlowWidth', + 'hoverOuterGlowColor' ]; for (i = 0, ilen = keys.length; i < ilen; ++i) { diff --git a/src/controllers/controller.styleDoughnut.js b/src/controllers/controller.styleDoughnut.js index 1e6f980..7303c83 100644 --- a/src/controllers/controller.styleDoughnut.js +++ b/src/controllers/controller.styleDoughnut.js @@ -34,6 +34,10 @@ export default function(Chart) { bevelWidth: custom.bevelWidth ? custom.bevelWidth : valueAtIndexOrDefault(ds.bevelWidth, i, arcOpts.bevelWidth), bevelHighlightColor: custom.bevelHighlightColor ? custom.bevelHighlightColor : valueAtIndexOrDefault(ds.bevelHighlightColor, i, arcOpts.bevelHighlightColor), bevelShadowColor: custom.bevelShadowColor ? custom.bevelShadowColor : valueAtIndexOrDefault(ds.bevelShadowColor, i, arcOpts.bevelShadowColor), + innerGlowWidth: custom.innerGlowWidth ? custom.innerGlowWidth : valueAtIndexOrDefault(ds.innerGlowWidth, i, arcOpts.innerGlowWidth), + innerGlowColor: custom.innerGlowColor ? custom.innerGlowColor : valueAtIndexOrDefault(ds.innerGlowColor, i, arcOpts.innerGlowColor), + outerGlowWidth: custom.outerGlowWidth ? custom.outerGlowWidth : valueAtIndexOrDefault(ds.outerGlowWidth, i, arcOpts.outerGlowWidth), + outerGlowColor: custom.outerGlowColor ? custom.outerGlowColor : valueAtIndexOrDefault(ds.outerGlowColor, i, arcOpts.outerGlowColor), // Extra data used for toggling the correct item index: i @@ -101,6 +105,10 @@ export default function(Chart) { model.bevelWidth = custom.bevelWidth ? custom.bevelWidth : valueOrDefault(dataset.bevelWidth, index, elementOpts.bevelWidth); model.bevelHighlightColor = custom.bevelHighlightColor ? custom.bevelHighlightColor : valueOrDefault(dataset.bevelHighlightColor, index, elementOpts.bevelHighlightColor); model.bevelShadowColor = custom.bevelShadowColor ? custom.bevelShadowColor : valueOrDefault(dataset.bevelShadowColor, index, elementOpts.bevelShadowColor); + model.innerGlowWidth = custom.innerGlowWidth ? custom.innerGlowWidth : valueOrDefault(dataset.innerGlowWidth, index, elementOpts.innerGlowWidth); + model.innerGlowColor = custom.innerGlowColor ? custom.innerGlowColor : valueOrDefault(dataset.innerGlowColor, index, elementOpts.innerGlowColor); + model.outerGlowWidth = custom.outerGlowWidth ? custom.outerGlowWidth : valueOrDefault(dataset.outerGlowWidth, index, elementOpts.outerGlowWidth); + model.outerGlowColor = custom.outerGlowColor ? custom.outerGlowColor : valueOrDefault(dataset.outerGlowColor, index, elementOpts.outerGlowColor); // Set correct angles if not resetting if (!reset || !animationOpts.animateRotate) { @@ -133,6 +141,10 @@ export default function(Chart) { element.$previousStyle.bevelWidth = model.bevelWidth; element.$previousStyle.bevelHighlightColor = model.bevelHighlightColor; element.$previousStyle.bevelShadowColor = model.bevelShadowColor; + element.$previousStyle.innerGlowWidth = model.innerGlowWidth; + element.$previousStyle.innerGlowColor = model.innerGlowColor; + element.$previousStyle.outerGlowWidth = model.outerGlowWidth; + element.$previousStyle.outerGlowColor = model.outerGlowColor; } model.shadowOffsetX = custom.hoverShadowOffsetX ? custom.hoverShadowOffsetX : valueOrDefault(dataset.hoverShadowOffsetX, index, model.shadowOffsetX); @@ -142,6 +154,10 @@ export default function(Chart) { model.bevelWidth = custom.hoverBevelWidth ? custom.hoverBevelWidth : valueOrDefault(dataset.hoverBevelWidth, index, model.bevelWidth); model.bevelHighlightColor = custom.hoverBevelHighlightColor ? custom.hoverBevelHighlightColor : valueOrDefault(dataset.hoverBevelHighlightColor, index, helpers.getHoverColor(model.bevelHighlightColor)); model.bevelShadowColor = custom.hoverBevelShadowColor ? custom.hoverBevelShadowColor : valueOrDefault(dataset.hoverBevelShadowColor, index, helpers.getHoverColor(model.bevelShadowColor)); + model.innerGlowWidth = custom.hoverInnerGlowWidth ? custom.hoverInnerGlowWidth : valueOrDefault(dataset.hoverInnerGlowWidth, index, model.innerGlowWidth); + model.innerGlowColor = custom.hoverInnerGlowColor ? custom.hoverInnerGlowColor : valueOrDefault(dataset.hoverInnerGlowColor, index, helpers.getHoverColor(model.innerGlowColor)); + model.outerGlowWidth = custom.hoverOuterGlowWidth ? custom.hoverOuterGlowWidth : valueOrDefault(dataset.hoverOuterGlowWidth, index, model.outerGlowWidth); + model.outerGlowColor = custom.hoverOuterGlowColor ? custom.hoverOuterGlowColor : valueOrDefault(dataset.hoverOuterGlowColor, index, helpers.getHoverColor(model.outerGlowColor)); }, removeHoverStyle: function(element) { @@ -161,6 +177,10 @@ export default function(Chart) { model.bevelWidth = custom.bevelWidth ? custom.bevelWidth : valueOrDefault(dataset.bevelWidth, index, elementOpts.bevelWidth); model.bevelHighlightColor = custom.bevelHighlightColor ? custom.bevelHighlightColor : valueOrDefault(dataset.bevelHighlightColor, index, elementOpts.bevelHighlightColor); model.bevelShadowColor = custom.bevelShadowColor ? custom.bevelShadowColor : valueOrDefault(dataset.bevelShadowColor, index, elementOpts.bevelShadowColor); + model.innerGlowWidth = custom.innerGlowWidth ? custom.innerGlowWidth : valueOrDefault(dataset.innerGlowWidth, index, elementOpts.innerGlowWidth); + model.innerGlowColor = custom.innerGlowColor ? custom.innerGlowColor : valueOrDefault(dataset.innerGlowColor, index, elementOpts.innerGlowColor); + model.outerGlowWidth = custom.outerGlowWidth ? custom.outerGlowWidth : valueOrDefault(dataset.outerGlowWidth, index, elementOpts.outerGlowWidth); + model.outerGlowColor = custom.outerGlowColor ? custom.outerGlowColor : valueOrDefault(dataset.outerGlowColor, index, elementOpts.outerGlowColor); } DoughnutController.prototype.removeHoverStyle.apply(this, arguments); diff --git a/src/controllers/controller.styleLine.js b/src/controllers/controller.styleLine.js index 4947a98..4bcd2db 100644 --- a/src/controllers/controller.styleLine.js +++ b/src/controllers/controller.styleLine.js @@ -67,7 +67,9 @@ export default function(Chart) { shadowOffsetX: custom.shadowOffsetX ? custom.shadowOffsetX : (dataset.shadowOffsetX || lineElementOptions.shadowOffsetX), shadowOffsetY: custom.shadowOffsetY ? custom.shadowOffsetY : (dataset.shadowOffsetY || lineElementOptions.shadowOffsetY), shadowBlur: custom.shadowBlur ? custom.shadowBlur : (dataset.shadowBlur || lineElementOptions.shadowBlur), - shadowColor: custom.shadowColor ? custom.shadowColor : (dataset.shadowColor || lineElementOptions.shadowColor) + shadowColor: custom.shadowColor ? custom.shadowColor : (dataset.shadowColor || lineElementOptions.shadowColor), + outerGlowWidth: custom.outerGlowWidth ? custom.outerGlowWidth : (dataset.outerGlowWidth || lineElementOptions.outerGlowWidth), + outerGlowColor: custom.outerGlowColor ? custom.outerGlowColor : (dataset.outerGlowColor || lineElementOptions.outerGlowColor) }; line.pivot(); @@ -200,6 +202,70 @@ export default function(Chart) { return bevelShadowColor; }, + getPointInnerGlowWidth: function(point, index) { + var innerGlowWidth = this.chart.options.elements.point.innerGlowWidth; + var dataset = this.getDataset(); + var custom = point.custom || {}; + + if (custom.innerGlowWidth) { + innerGlowWidth = custom.innerGlowWidth; + } else if (dataset.pointInnerGlowWidth) { + innerGlowWidth = helpers.valueAtIndexOrDefault(dataset.pointInnerGlowWidth, index, innerGlowWidth); + } else if (dataset.innerGlowWidth) { + innerGlowWidth = dataset.innerGlowWidth; + } + + return innerGlowWidth; + }, + + getPointInnerGlowColor: function(point, index) { + var innerGlowColor = this.chart.options.elements.point.innerGlowColor; + var dataset = this.getDataset(); + var custom = point.custom || {}; + + if (custom.innerGlowColor) { + innerGlowColor = custom.innerGlowColor; + } else if (dataset.pointInnerGlowColor) { + innerGlowColor = helpers.valueAtIndexOrDefault(dataset.pointInnerGlowColor, index, innerGlowColor); + } else if (dataset.innerGlowColor) { + innerGlowColor = dataset.innerGlowColor; + } + + return innerGlowColor; + }, + + getPointOuterGlowWidth: function(point, index) { + var outerGlowWidth = this.chart.options.elements.point.outerGlowWidth; + var dataset = this.getDataset(); + var custom = point.custom || {}; + + if (custom.outerGlowWidth) { + outerGlowWidth = custom.outerGlowWidth; + } else if (dataset.pointOuterGlowWidth) { + outerGlowWidth = helpers.valueAtIndexOrDefault(dataset.pointOuterGlowWidth, index, outerGlowWidth); + } else if (dataset.outerGlowWidth) { + outerGlowWidth = dataset.outerGlowWidth; + } + + return outerGlowWidth; + }, + + getPointOuterGlowColor: function(point, index) { + var outerGlowColor = this.chart.options.elements.point.outerGlowColor; + var dataset = this.getDataset(); + var custom = point.custom || {}; + + if (custom.outerGlowColor) { + outerGlowColor = custom.outerGlowColor; + } else if (dataset.pointOuterGlowColor) { + outerGlowColor = helpers.valueAtIndexOrDefault(dataset.pointOuterGlowColor, index, outerGlowColor); + } else if (dataset.outerGlowColor) { + outerGlowColor = dataset.outerGlowColor; + } + + return outerGlowColor; + }, + updateElement: function(point, index) { LineController.prototype.updateElement.apply(this, arguments); @@ -212,6 +278,10 @@ export default function(Chart) { point._model.bevelWidth = me.getPointBevelWidth(point, index); point._model.bevelHighlightColor = me.getPointBevelHighlightColor(point, index); point._model.bevelShadowColor = me.getPointBevelShadowColor(point, index); + point._model.innerGlowWidth = me.getPointInnerGlowWidth(point, index); + point._model.innerGlowColor = me.getPointInnerGlowColor(point, index); + point._model.outerGlowWidth = me.getPointOuterGlowWidth(point, index); + point._model.outerGlowColor = me.getPointOuterGlowColor(point, index); }, setHoverStyle: function(element) { @@ -232,6 +302,10 @@ export default function(Chart) { element.$previousStyle.bevelWidth = model.bevelWidth; element.$previousStyle.bevelHighlightColor = model.bevelHighlightColor; element.$previousStyle.bevelShadowColor = model.bevelShadowColor; + element.$previousStyle.innerGlowWidth = model.innerGlowWidth; + element.$previousStyle.innerGlowColor = model.innerGlowColor; + element.$previousStyle.outerGlowWidth = model.outerGlowWidth; + element.$previousStyle.outerGlowColor = model.outerGlowColor; } model.shadowOffsetX = custom.hoverShadowOffsetX || valueOrDefault(dataset.pointHoverShadowOffsetX, index, model.shadowOffsetX); @@ -241,6 +315,10 @@ export default function(Chart) { model.bevelWidth = custom.hoverBevelWidth || valueOrDefault(dataset.pointHoverBevelWidth, index, model.bevelWidth); model.bevelHighlightColor = custom.hoverBevelHighlightColor || valueOrDefault(dataset.pointHoverBevelHighlightColor, index, helpers.getHoverColor(model.bevelHighlightColor)); model.bevelShadowColor = custom.hoverBevelShadowColor || valueOrDefault(dataset.pointHoverBevelShadowColor, index, helpers.getHoverColor(model.bevelShadowColor)); + model.innerGlowWidth = custom.hoverInnerGlowWidth || valueOrDefault(dataset.pointHoverInnerGlowWidth, index, model.innerGlowWidth); + model.innerGlowColor = custom.hoverInnerGlowColor || valueOrDefault(dataset.pointHoverInnerGlowColor, index, helpers.getHoverColor(model.innerGlowColor)); + model.outerGlowWidth = custom.hoverOuterGlowWidth || valueOrDefault(dataset.pointHoverOuterGlowWidth, index, model.outerGlowWidth); + model.outerGlowColor = custom.hoverOuterGlowColor || valueOrDefault(dataset.pointHoverOuterGlowColor, index, helpers.getHoverColor(model.outerGlowColor)); }, removeHoverStyle: function(element) { @@ -257,6 +335,10 @@ export default function(Chart) { model.bevelWidth = me.getPointBevelWidth(element, index); model.bevelHighlightColor = me.getPointBevelHighlightColor(element, index); model.bevelShadowColor = me.getPointBevelShadowColor(element, index); + model.innerGlowWidth = me.getPointInnerGlowWidth(element, index); + model.innerGlowColor = me.getPointInnerGlowColor(element, index); + model.outerGlowWidth = me.getPointOuterGlowWidth(element, index); + model.outerGlowColor = me.getPointOuterGlowColor(element, index); } LineController.prototype.removeHoverStyle.apply(this, arguments); diff --git a/src/controllers/controller.stylePolarArea.js b/src/controllers/controller.stylePolarArea.js index b2ec9b9..2b3e9db 100644 --- a/src/controllers/controller.stylePolarArea.js +++ b/src/controllers/controller.stylePolarArea.js @@ -34,6 +34,10 @@ export default function(Chart) { bevelWidth: custom.bevelWidth ? custom.bevelWidth : valueAtIndexOrDefault(ds.bevelWidth, i, arcOpts.bevelWidth), bevelHighlightColor: custom.bevelHighlightColor ? custom.bevelHighlightColor : valueAtIndexOrDefault(ds.bevelHighlightColor, i, arcOpts.bevelHighlightColor), bevelShadowColor: custom.bevelShadowColor ? custom.bevelShadowColor : valueAtIndexOrDefault(ds.bevelShadowColor, i, arcOpts.bevelShadowColor), + innerGlowWidth: custom.innerGlowWidth ? custom.innerGlowWidth : valueAtIndexOrDefault(ds.innerGlowWidth, i, arcOpts.innerGlowWidth), + innerGlowColor: custom.innerGlowColor ? custom.innerGlowColor : valueAtIndexOrDefault(ds.innerGlowColor, i, arcOpts.innerGlowColor), + outerGlowWidth: custom.outerGlowWidth ? custom.outerGlowWidth : valueAtIndexOrDefault(ds.outerGlowWidth, i, arcOpts.outerGlowWidth), + outerGlowColor: custom.outerGlowColor ? custom.outerGlowColor : valueAtIndexOrDefault(ds.outerGlowColor, i, arcOpts.outerGlowColor), // Extra data used for toggling the correct item index: i @@ -121,6 +125,10 @@ export default function(Chart) { model.bevelWidth = custom.bevelWidth ? custom.bevelWidth : valueOrDefault(dataset.bevelWidth, index, elementOpts.bevelWidth); model.bevelHighlightColor = custom.bevelHighlightColor ? custom.bevelHighlightColor : valueOrDefault(dataset.bevelHighlightColor, index, elementOpts.bevelHighlightColor); model.bevelShadowColor = custom.bevelShadowColor ? custom.bevelShadowColor : valueOrDefault(dataset.bevelShadowColor, index, elementOpts.bevelShadowColor); + model.innerGlowWidth = custom.innerGlowWidth ? custom.innerGlowWidth : valueOrDefault(dataset.innerGlowWidth, index, elementOpts.innerGlowWidth); + model.innerGlowColor = custom.innerGlowColor ? custom.innerGlowColor : valueOrDefault(dataset.innerGlowColor, index, elementOpts.innerGlowColor); + model.outerGlowWidth = custom.outerGlowWidth ? custom.outerGlowWidth : valueOrDefault(dataset.outerGlowWidth, index, elementOpts.outerGlowWidth); + model.outerGlowColor = custom.outerGlowColor ? custom.outerGlowColor : valueOrDefault(dataset.outerGlowColor, index, elementOpts.outerGlowColor); arc.pivot(); }, @@ -142,6 +150,10 @@ export default function(Chart) { element.$previousStyle.bevelWidth = model.bevelWidth; element.$previousStyle.bevelHighlightColor = model.bevelHighlightColor; element.$previousStyle.bevelShadowColor = model.bevelShadowColor; + element.$previousStyle.innerGlowWidth = model.innerGlowWidth; + element.$previousStyle.innerGlowColor = model.innerGlowColor; + element.$previousStyle.outerGlowWidth = model.outerGlowWidth; + element.$previousStyle.outerGlowColor = model.outerGlowColor; } model.shadowOffsetX = custom.hoverShadowOffsetX ? custom.hoverShadowOffsetX : valueOrDefault(dataset.hoverShadowOffsetX, index, model.shadowOffsetX); @@ -151,6 +163,10 @@ export default function(Chart) { model.bevelWidth = custom.hoverBevelWidth ? custom.hoverBevelWidth : valueOrDefault(dataset.hoverBevelWidth, index, model.bevelWidth); model.bevelHighlightColor = custom.hoverBevelHighlightColor ? custom.hoverBevelHighlightColor : valueOrDefault(dataset.hoverBevelHighlightColor, index, helpers.getHoverColor(model.bevelHighlightColor)); model.bevelShadowColor = custom.hoverBevelShadowColor ? custom.hoverBevelShadowColor : valueOrDefault(dataset.hoverBevelShadowColor, index, helpers.getHoverColor(model.bevelShadowColor)); + model.innerGlowWidth = custom.hoverInnerGlowWidth ? custom.hoverInnerGlowWidth : valueOrDefault(dataset.hoverInnerGlowWidth, index, model.innerGlowWidth); + model.innerGlowColor = custom.hoverInnerGlowColor ? custom.hoverInnerGlowColor : valueOrDefault(dataset.hoverInnerGlowColor, index, helpers.getHoverColor(model.innerGlowColor)); + model.outerGlowWidth = custom.hoverOuterGlowWidth ? custom.hoverOuterGlowWidth : valueOrDefault(dataset.hoverOuterGlowWidth, index, model.outerGlowWidth); + model.outerGlowColor = custom.hoverOuterGlowColor ? custom.hoverOuterGlowColor : valueOrDefault(dataset.hoverOuterGlowColor, index, helpers.getHoverColor(model.outerGlowColor)); }, removeHoverStyle: function(element) { @@ -170,6 +186,10 @@ export default function(Chart) { model.bevelWidth = custom.bevelWidth ? custom.bevelWidth : valueOrDefault(dataset.bevelWidth, index, elementOpts.bevelWidth); model.bevelHighlightColor = custom.bevelHighlightColor ? custom.bevelHighlightColor : valueOrDefault(dataset.bevelHighlightColor, index, elementOpts.bevelHighlightColor); model.bevelShadowColor = custom.bevelShadowColor ? custom.bevelShadowColor : valueOrDefault(dataset.bevelShadowColor, index, elementOpts.bevelShadowColor); + model.innerGlowWidth = custom.innerGlowWidth ? custom.innerGlowWidth : valueOrDefault(dataset.innerGlowWidth, index, elementOpts.innerGlowWidth); + model.innerGlowColor = custom.innerGlowColor ? custom.innerGlowColor : valueOrDefault(dataset.innerGlowColor, index, elementOpts.innerGlowColor); + model.outerGlowWidth = custom.outerGlowWidth ? custom.outerGlowWidth : valueOrDefault(dataset.outerGlowWidth, index, elementOpts.outerGlowWidth); + model.outerGlowColor = custom.outerGlowColor ? custom.outerGlowColor : valueOrDefault(dataset.outerGlowColor, index, elementOpts.outerGlowColor); } PolarAreaController.prototype.removeHoverStyle.apply(this, arguments); diff --git a/src/controllers/controller.styleRadar.js b/src/controllers/controller.styleRadar.js index be52ad7..10a980f 100644 --- a/src/controllers/controller.styleRadar.js +++ b/src/controllers/controller.styleRadar.js @@ -52,7 +52,9 @@ export default function(Chart) { shadowOffsetX: custom.shadowOffsetX ? custom.shadowOffsetX : (dataset.shadowOffsetX || lineElementOptions.shadowOffsetX), shadowOffsetY: custom.shadowOffsetY ? custom.shadowOffsetY : (dataset.shadowOffsetY || lineElementOptions.shadowOffsetY), shadowBlur: custom.shadowBlur ? custom.shadowBlur : (dataset.shadowBlur || lineElementOptions.shadowBlur), - shadowColor: custom.shadowColor ? custom.shadowColor : (dataset.shadowColor || lineElementOptions.shadowColor) + shadowColor: custom.shadowColor ? custom.shadowColor : (dataset.shadowColor || lineElementOptions.shadowColor), + outerGlowWidth: custom.outerGlowWidth ? custom.outerGlowWidth : (dataset.outerGlowWidth || lineElementOptions.outerGlowWidth), + outerGlowColor: custom.outerGlowColor ? custom.outerGlowColor : (dataset.outerGlowColor || lineElementOptions.outerGlowColor) } }); @@ -82,6 +84,10 @@ export default function(Chart) { point._model.bevelWidth = !isNaN(custom.bevelWidth) ? custom.bevelWidth : helpers.valueAtIndexOrDefault(dataset.pointBevelWidth, index, !isNaN(dataset.bevelWidth) ? dataset.bevelWidth : pointElementOptions.bevelWidth); point._model.bevelHighlightColor = custom.bevelHighlightColor ? custom.bevelHighlightColor : helpers.valueAtIndexOrDefault(dataset.pointBevelHighlightColor, index, dataset.bevelHighlightColor ? dataset.bevelHighlightColor : pointElementOptions.bevelHighlightColor); point._model.bevelShadowColor = custom.bevelShadowColor ? custom.bevelShadowColor : helpers.valueAtIndexOrDefault(dataset.pointBevelShadowColor, index, dataset.bevelShadowColor ? dataset.bevelShadowColor : pointElementOptions.bevelShadowColor); + point._model.innerGlowWidth = !isNaN(custom.innerGlowWidth) ? custom.innerGlowWidth : helpers.valueAtIndexOrDefault(dataset.pointInnerGlowWidth, index, !isNaN(dataset.innerGlowWidth) ? dataset.innerGlowWidth : pointElementOptions.innerGlowWidth); + point._model.innerGlowColor = custom.innerGlowColor ? custom.innerGlowColor : helpers.valueAtIndexOrDefault(dataset.pointInnerGlowColor, index, dataset.innerGlowColor ? dataset.innerGlowColor : pointElementOptions.innerGlowColor); + point._model.outerGlowWidth = !isNaN(custom.outerGlowWidth) ? custom.outerGlowWidth : helpers.valueAtIndexOrDefault(dataset.pointOuterGlowWidth, index, !isNaN(dataset.outerGlowWidth) ? dataset.outerGlowWidth : pointElementOptions.outerGlowWidth); + point._model.outerGlowColor = custom.outerGlowColor ? custom.outerGlowColor : helpers.valueAtIndexOrDefault(dataset.pointOuterGlowColor, index, dataset.outerGlowColor ? dataset.outerGlowColor : pointElementOptions.outerGlowColor); }, setHoverStyle: function(element) { @@ -102,6 +108,10 @@ export default function(Chart) { element.$previousStyle.bevelWidth = model.bevelWidth; element.$previousStyle.bevelHighlightColor = model.bevelHighlightColor; element.$previousStyle.bevelShadowColor = model.bevelShadowColor; + element.$previousStyle.innerGlowWidth = model.innerGlowWidth; + element.$previousStyle.innerGlowColor = model.innerGlowColor; + element.$previousStyle.outerGlowWidth = model.outerGlowWidth; + element.$previousStyle.outerGlowColor = model.outerGlowColor; } model.shadowOffsetX = custom.hoverShadowOffsetX ? custom.hoverShadowOffsetX : valueOrDefault(dataset.pointHoverShadowOffsetX, index, model.shadowOffsetX); @@ -111,6 +121,10 @@ export default function(Chart) { model.bevelWidth = custom.hoverBevelWidth ? custom.hoverBevelWidth : valueOrDefault(dataset.pointHoverBevelWidth, index, model.bevelWidth); model.bevelHighlightColor = custom.hoverBevelHighlightColor ? custom.hoverBevelHighlightColor : valueOrDefault(dataset.pointHoverBevelHighlightColor, index, helpers.getHoverColor(model.bevelHighlightColor)); model.bevelShadowColor = custom.hoverBevelShadowColor ? custom.hoverBevelShadowColor : valueOrDefault(dataset.pointHoverBevelShadowColor, index, helpers.getHoverColor(model.bevelShadowColor)); + model.innerGlowWidth = custom.hoverInnerGlowWidth ? custom.hoverInnerGlowWidth : valueOrDefault(dataset.pointHoverInnerGlowWidth, index, model.innerGlowWidth); + model.innerGlowColor = custom.hoverInnerGlowColor ? custom.hoverInnerGlowColor : valueOrDefault(dataset.pointHoverInnerGlowColor, index, helpers.getHoverColor(model.innerGlowColor)); + model.outerGlowWidth = custom.hoverOuterGlowWidth ? custom.hoverOuterGlowWidth : valueOrDefault(dataset.pointHoverOuterGlowWidth, index, model.outerGlowWidth); + model.outerGlowColor = custom.hoverOuterGlowColor ? custom.hoverOuterGlowColor : valueOrDefault(dataset.pointHoverOuterGlowColor, index, helpers.getHoverColor(model.outerGlowColor)); }, removeHoverStyle: function(element) { @@ -130,6 +144,10 @@ export default function(Chart) { model.bevelWidth = !isNaN(custom.bevelWidth) ? custom.bevelWidth : valueOrDefault(dataset.pointBevelWidth, index, !isNaN(dataset.bevelWidth) ? dataset.bevelWidth : elementOpts.bevelWidth); model.bevelHighlightColor = custom.bevelHighlightColor ? custom.bevelHighlightColor : valueOrDefault(dataset.pointBevelHighlightColor, index, dataset.bevelHighlightColor ? dataset.bevelHighlightColor : elementOpts.bevelHighlightColor); model.bevelShadowColor = custom.bevelShadowColor ? custom.bevelShadowColor : valueOrDefault(dataset.pointBevelShadowColor, index, dataset.bevelShadowColor ? dataset.bevelShadowColor : elementOpts.bevelShadowColor); + model.innerGlowWidth = !isNaN(custom.innerGlowWidth) ? custom.innerGlowWidth : valueOrDefault(dataset.pointInnerGlowWidth, index, !isNaN(dataset.innerGlowWidth) ? dataset.innerGlowWidth : elementOpts.innerGlowWidth); + model.innerGlowColor = custom.innerGlowColor ? custom.innerGlowColor : valueOrDefault(dataset.pointInnerGlowColor, index, dataset.innerGlowColor ? dataset.innerGlowColor : elementOpts.innerGlowColor); + model.outerGlowWidth = !isNaN(custom.outerGlowWidth) ? custom.outerGlowWidth : valueOrDefault(dataset.pointOuterGlowWidth, index, !isNaN(dataset.outerGlowWidth) ? dataset.outerGlowWidth : elementOpts.outerGlowWidth); + model.outerGlowColor = custom.outerGlowColor ? custom.outerGlowColor : valueOrDefault(dataset.pointOuterGlowColor, index, dataset.outerGlowColor ? dataset.outerGlowColor : elementOpts.outerGlowColor); } RadarController.prototype.removeHoverStyle.apply(this, arguments); diff --git a/src/core/core.styleTooltip.js b/src/core/core.styleTooltip.js index ff27660..224bd19 100644 --- a/src/core/core.styleTooltip.js +++ b/src/core/core.styleTooltip.js @@ -32,6 +32,10 @@ export default function(Chart) { model.bevelWidth = tooltipOpts.bevelWidth; model.bevelHighlightColor = tooltipOpts.bevelHighlightColor; model.bevelShadowColor = tooltipOpts.bevelShadowColor; + model.innerGlowWidth = tooltipOpts.innerGlowWidth; + model.innerGlowColor = tooltipOpts.innerGlowColor; + model.outerGlowWidth = tooltipOpts.outerGlowWidth; + model.outerGlowColor = tooltipOpts.outerGlowColor; }, update: function() { @@ -48,6 +52,10 @@ export default function(Chart) { model.bevelWidth = opts.bevelWidth; model.bevelHighlightColor = opts.bevelHighlightColor; model.bevelShadowColor = opts.bevelShadowColor; + model.innerGlowWidth = opts.innerGlowWidth; + model.innerGlowColor = opts.innerGlowColor; + model.outerGlowWidth = opts.outerGlowWidth; + model.outerGlowColor = opts.outerGlowColor; return me; }, @@ -65,14 +73,20 @@ export default function(Chart) { }; styleHelpers.drawShadow(chart, vm.shadowOffsetX, vm.shadowOffsetY, - vm.shadowBlur, mergeOpacity(vm.shadowColor, opacity), drawCallback); + vm.shadowBlur, vm.shadowColor, drawCallback); if (backgroundAlpha > 0) { + styleHelpers.drawBackground(vm, drawCallback); styleHelpers.drawBevel(chart, vm.bevelWidth + bevelExtra, mergeOpacity(vm.bevelHighlightColor, opacity), - mergeOpacity(vm.bevelShadowColor, opacity)); + mergeOpacity(vm.bevelShadowColor, opacity), drawCallback); } + styleHelpers.drawInnerGlow(chart, vm.innerGlowWidth, + mergeOpacity(vm.innerGlowColor, opacity), vm.borderWidth, drawCallback); + styleHelpers.drawOuterGlow(chart, vm.outerGlowWidth, + mergeOpacity(vm.outerGlowColor, opacity), vm.borderWidth, drawCallback); + styleHelpers.drawBorder(vm, drawCallback); } }); diff --git a/src/elements/element.styleArc.js b/src/elements/element.styleArc.js index 552137e..1afb42c 100644 --- a/src/elements/element.styleArc.js +++ b/src/elements/element.styleArc.js @@ -26,9 +26,14 @@ export default function(Chart) { if (backgroundAlpha > 0) { styleHelpers.drawBackground(vm, drawCallback); styleHelpers.drawBevel(chart, vm.bevelWidth + bevelExtra, - vm.bevelHighlightColor, vm.bevelShadowColor); + vm.bevelHighlightColor, vm.bevelShadowColor, drawCallback); } + styleHelpers.drawInnerGlow(chart, vm.innerGlowWidth, vm.innerGlowColor, + vm.borderWidth, drawCallback); + styleHelpers.drawOuterGlow(chart, vm.outerGlowWidth, vm.outerGlowColor, + vm.borderWidth, drawCallback); + styleHelpers.drawBorder(vm, drawCallback); } }); diff --git a/src/elements/element.styleLine.js b/src/elements/element.styleLine.js index 392ad51..e4f9612 100644 --- a/src/elements/element.styleLine.js +++ b/src/elements/element.styleLine.js @@ -9,12 +9,20 @@ export default function(Chart) { draw: function() { var me = this; var args = arguments; + var chart = me._chart; var vm = me._view; - styleHelpers.drawShadow(me._chart, vm.shadowOffsetX, vm.shadowOffsetY, - vm.shadowBlur, vm.shadowColor, function() { - Chart.elements.Line.prototype.draw.apply(me, args); - }); + var drawCallback = function() { + Chart.elements.Line.prototype.draw.apply(me, args); + }; + + styleHelpers.drawShadow(chart, vm.shadowOffsetX, vm.shadowOffsetY, + vm.shadowBlur, vm.shadowColor, drawCallback); + + styleHelpers.drawOuterGlow(chart, vm.outerGlowWidth, vm.outerGlowColor, + vm.borderWidth, drawCallback); + + styleHelpers.drawBorder(vm, drawCallback); } }); } diff --git a/src/elements/element.stylePoint.js b/src/elements/element.stylePoint.js index 6eac99d..c3b3ddf 100644 --- a/src/elements/element.stylePoint.js +++ b/src/elements/element.stylePoint.js @@ -26,9 +26,14 @@ export default function(Chart) { if (backgroundAlpha > 0) { styleHelpers.drawBackground(vm, drawCallback); styleHelpers.drawBevel(chart, vm.bevelWidth + bevelExtra, - vm.bevelHighlightColor, vm.bevelShadowColor); + vm.bevelHighlightColor, vm.bevelShadowColor, drawCallback); } + styleHelpers.drawInnerGlow(chart, vm.innerGlowWidth, vm.innerGlowColor, + vm.borderWidth, drawCallback); + styleHelpers.drawOuterGlow(chart, vm.outerGlowWidth, vm.outerGlowColor, + vm.borderWidth, drawCallback); + styleHelpers.drawBorder(vm, drawCallback); } }); diff --git a/src/elements/element.styleRectangle.js b/src/elements/element.styleRectangle.js index 5164bac..c69832d 100644 --- a/src/elements/element.styleRectangle.js +++ b/src/elements/element.styleRectangle.js @@ -26,9 +26,14 @@ export default function(Chart) { if (backgroundAlpha > 0) { styleHelpers.drawBackground(vm, drawCallback); styleHelpers.drawBevel(chart, vm.bevelWidth + bevelExtra, - vm.bevelHighlightColor, vm.bevelShadowColor); + vm.bevelHighlightColor, vm.bevelShadowColor, drawCallback); } + styleHelpers.drawInnerGlow(chart, vm.innerGlowWidth, vm.innerGlowColor, + vm.borderWidth, drawCallback); + styleHelpers.drawOuterGlow(chart, vm.outerGlowWidth, vm.outerGlowColor, + vm.borderWidth, drawCallback); + styleHelpers.drawBorder(vm, drawCallback); } }); diff --git a/src/helpers/helpers.style.js b/src/helpers/helpers.style.js index ba30f4c..c3d7529 100644 --- a/src/helpers/helpers.style.js +++ b/src/helpers/helpers.style.js @@ -21,9 +21,9 @@ export default function() { } }, - drawShadow: function(chart, offsetX, offsetY, blur, color, drawCallback, shadowOnly) { + drawShadow: function(chart, offsetX, offsetY, blur, color, drawCallback, backmost) { var ctx = chart.ctx; - var offset = shadowOnly ? chart.width : 0; + var offset = chart.width; var pixelRatio = chart.currentDevicePixelRatio; ctx.save(); @@ -32,7 +32,7 @@ export default function() { ctx.shadowOffsetY = offsetY * pixelRatio; ctx.shadowBlur = blur * pixelRatio; ctx.shadowColor = color; - if (shadowOnly) { + if (backmost) { ctx.globalCompositeOperation = 'destination-over'; } ctx.translate(-offset, 0); @@ -42,9 +42,19 @@ export default function() { ctx.restore(); }, - drawBevel: function(chart, width, highlightColor, shadowColor) { + setPath: function(ctx, drawCallback) { + ctx.save(); + ctx.beginPath(); + ctx.clip(); + drawCallback(); + ctx.restore(); + }, + + drawBevel: function(chart, width, highlightColor, shadowColor, drawCallback) { var ctx = chart.ctx; - var offset = (width * chart.currentDevicePixelRatio) / 2; + var offset = chart.width; + var pixelRatio = chart.currentDevicePixelRatio; + var shadowOffset = (width * pixelRatio) / 2; if (!width) { return; @@ -53,25 +63,75 @@ export default function() { ctx.save(); ctx.clip(); - // Add rect to make stencil - ctx.rect(-offset, -offset, chart.width + offset * 2, chart.height + offset * 2); + // Make stencil + ctx.translate(-offset, 0); + this.setPath(ctx, drawCallback); + ctx.rect(0, 0, chart.width, chart.height); // Draw bevel shadow - ctx.fillStyle = 'gray'; - ctx.shadowOffsetX = -offset; - ctx.shadowOffsetY = -offset; - ctx.shadowBlur = offset; + ctx.fillStyle = 'black'; + ctx.shadowOffsetX = offset * pixelRatio - shadowOffset; + ctx.shadowOffsetY = -shadowOffset; + ctx.shadowBlur = shadowOffset; ctx.shadowColor = shadowColor; ctx.globalCompositeOperation = 'source-atop'; ctx.fill('evenodd'); // Draw Bevel highlight - ctx.shadowOffsetX = offset; - ctx.shadowOffsetY = offset; + ctx.shadowOffsetX = offset * pixelRatio + shadowOffset; + ctx.shadowOffsetY = shadowOffset; ctx.shadowColor = highlightColor; ctx.fill('evenodd'); ctx.restore(); + }, + + drawGlow: function(chart, width, color, borderWidth, drawCallback, isOuter) { + var ctx = chart.ctx; + var offset = chart.width; + var pixelRatio = chart.currentDevicePixelRatio; + + if (!width) { + return; + } + + ctx.save(); + + // Clip inner or outer area + this.setPath(ctx, drawCallback); + if (isOuter) { + ctx.rect(0, 0, chart.width, chart.height); + } + ctx.clip('evenodd'); + + // Set path + ctx.translate(-offset, 0); + this.setPath(ctx, drawCallback); + if (!isOuter) { + ctx.rect(0, 0, chart.width, chart.height); + } + + // Draw glow + ctx.lineWidth = borderWidth; + ctx.strokeStyle = 'black'; + ctx.fillStyle = 'black'; + ctx.shadowOffsetX = offset * pixelRatio; + ctx.shadowBlur = width * pixelRatio; + ctx.shadowColor = color; + ctx.fill('evenodd'); + if (borderWidth) { + ctx.stroke(); + } + + ctx.restore(); + }, + + drawInnerGlow: function(chart, width, color, borderWidth, drawCallback) { + this.drawGlow(chart, width, color, borderWidth, drawCallback); + }, + + drawOuterGlow: function(chart, width, color, borderWidth, drawCallback) { + this.drawGlow(chart, width, color, borderWidth, drawCallback, true); } }; } diff --git a/src/plugins/plugin.styleLegend.js b/src/plugins/plugin.styleLegend.js index 34326b5..f2bea8f 100644 --- a/src/plugins/plugin.styleLegend.js +++ b/src/plugins/plugin.styleLegend.js @@ -29,6 +29,10 @@ export default function(Chart) { bevelWidth: helpers.valueOrDefault((!helpers.isArray(dataset.pointBevelWidth) ? dataset.pointBevelWidth : dataset.pointBevelWidth[0]), dataset.bevelWidth), bevelHighlightColor: helpers.valueOrDefault((!helpers.isArray(dataset.pointBevelHighlightColor) ? dataset.pointBevelHighlightColor : dataset.pointBevelHighlightColor[0]), dataset.bevelHighlightColor), bevelShadowColor: helpers.valueOrDefault((!helpers.isArray(dataset.pointBevelShadowColor) ? dataset.pointBevelShadowColor : dataset.pointBevelShadowColor[0]), dataset.bevelShadowColor), + innerGlowWidth: helpers.valueOrDefault((!helpers.isArray(dataset.pointInnerGlowWidth) ? dataset.pointInnerGlowWidth : dataset.pointInnerGlowWidth[0]), dataset.innerGlowWidth), + innerGlowColor: helpers.valueOrDefault((!helpers.isArray(dataset.pointInnerGlowColor) ? dataset.pointInnerGlowColor : dataset.pointInnerGlowColor[0]), dataset.innerGlowColor), + outerGlowWidth: helpers.valueOrDefault((!helpers.isArray(dataset.pointOuterGlowWidth) ? dataset.pointOuterGlowWidth : dataset.pointOuterGlowWidth[0]), dataset.outerGlowWidth), + outerGlowColor: helpers.valueOrDefault((!helpers.isArray(dataset.pointOuterGlowColor) ? dataset.pointOuterGlowColor : dataset.pointOuterGlowColor[0]), dataset.outerGlowColor), // Below is extra data used for toggling the datasets datasetIndex: i @@ -145,11 +149,16 @@ export default function(Chart) { drawCallback(); styleHelpers.drawBevel(me.chart, legendItem.bevelWidth + bevelExtra, - legendItem.bevelHighlightColor, legendItem.bevelShadowColor); + legendItem.bevelHighlightColor, legendItem.bevelShadowColor, drawCallback); ctx.restore(); } + styleHelpers.drawInnerGlow(me.chart, legendItem.innerGlowWidth, legendItem.innerGlowColor, + ctx.lineWidth, drawCallback); + styleHelpers.drawOuterGlow(me.chart, legendItem.outerGlowWidth, legendItem.outerGlowColor, + ctx.lineWidth, drawCallback); + if (!isLineWidthZero) { ctx.fillStyle = 'rgba(0, 0, 0, 0)'; drawCallback();