]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Merge branch 'master' into file-size-reduction 2491/head
authorEvert Timberg <evert.timberg+github@gmail.com>
Thu, 12 May 2016 22:57:22 +0000 (18:57 -0400)
committerEvert Timberg <evert.timberg+github@gmail.com>
Thu, 12 May 2016 22:57:22 +0000 (18:57 -0400)
Conflicts:
src/controllers/controller.doughnut.js
src/controllers/controller.polarArea.js

1  2 
src/core/core.datasetController.js

index e483e3f3ea2ddf96edcaa69eed88b00b4ea16530,dad49e234a50f9290f4f24eb2014d36e1a40823d..cfd069ef885b6b9558d95d027a27985cc3ab281d
@@@ -71,36 -71,9 +71,37 @@@ module.exports = function(Chart) 
                // Controllers should implement the following
                addElements: noop,
                addElementAndReset: noop,
 -              draw: noop,
 -              removeHoverStyle: noop,
 -              setHoverStyle: noop,
 +              draw: function(ease) {
 +                      var easingDecimal = ease || 1;
 +                      helpers.each(this.getMeta().data, function(element, index) {
 +                              element.transition(easingDecimal).draw();
 +                      });
 +              },
 +              removeHoverStyle: function(element, elementOpts) {
 +                      var dataset = this.chart.data.datasets[element._datasetIndex],
 +                              index = element._index,
 +                              custom = element.custom,
 +                              valueOrDefault = helpers.getValueAtIndexOrDefault,
 +                              color = helpers.color,
 +                              model = element._model;
 +
 +                      model.backgroundColor = custom && custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor);
 +                      model.borderColor = custom && custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor);
 +                      model.borderWidth = custom && custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth);
 +              },
 +              setHoverStyle: function(element) {
 +                      var dataset = this.chart.data.datasets[element._datasetIndex],
 +                              index = element._index,
 +                              custom = element.custom,
 +                              valueOrDefault = helpers.getValueAtIndexOrDefault,
 +                              color = helpers.color,
++                              getHoverColor = helpers.getHoverColor,
 +                              model = element._model;
 +
-                       model.backgroundColor = custom && custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, color(model.backgroundColor).saturate(0.5).darken(0.1).rgbString());
-                       model.borderColor = custom && custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, color(model.borderColor).saturate(0.5).darken(0.1).rgbString());
++                      model.backgroundColor = custom && custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor));
++                      model.borderColor = custom && custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor));
 +                      model.borderWidth = custom && custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
 +              },
                update: noop
        });