/base/000_base/bower_components/highcharts/js/modules/solid-gauge.src.js |
@@ -1,5 +1,5 @@ |
/** |
* @license Highcharts JS v5.0.10 (2017-03-31) |
* @license Highcharts JS v5.0.12 (2017-05-24) |
* Solid angular gauge module |
* |
* (c) 2010-2017 Torstein Honsi |
@@ -70,8 +70,7 @@ |
|
|
initDataClasses: function(userOptions) { |
var axis = this, |
chart = this.chart, |
var chart = this.chart, |
dataClasses, |
colorCounter = 0, |
options = this.options; |
@@ -91,7 +90,10 @@ |
colorCounter = 0; |
} |
} else { |
dataClass.color = axis.tweenColors(H.color(options.minColor), H.color(options.maxColor), i / (userOptions.dataClasses.length - 1)); |
dataClass.color = H.color(options.minColor).tweenTo( |
H.color(options.maxColor), |
i / (userOptions.dataClasses.length - 1) |
); |
} |
} |
}); |
@@ -152,61 +154,15 @@ |
// The position within the gradient |
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1); |
|
color = this.tweenColors( |
from.color, |
color = from.color.tweenTo( |
to.color, |
pos |
); |
} |
return color; |
}, |
/* |
* Return an intermediate color between two colors, according to pos where 0 |
* is the from color and 1 is the to color. |
*/ |
tweenColors: function(from, to, pos) { |
// Check for has alpha, because rgba colors perform worse due to lack of |
// support in WebKit. |
var hasAlpha, |
ret; |
|
// Unsupported color, return to-color (#3920) |
if (!to.rgba.length || !from.rgba.length) { |
ret = to.input || 'none'; |
|
// Interpolate |
} else { |
from = from.rgba; |
to = to.rgba; |
hasAlpha = (to[3] !== 1 || from[3] !== 1); |
ret = (hasAlpha ? 'rgba(' : 'rgb(') + |
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' + |
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' + |
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) + |
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')'; |
} |
return ret; |
} |
}; |
|
/** |
* Handle animation of the color attributes directly |
*/ |
each(['fill', 'stroke'], function(prop) { |
H.Fx.prototype[prop + 'Setter'] = function() { |
this.elem.attr( |
prop, |
colorAxisMethods.tweenColors( |
H.color(this.start), |
H.color(this.end), |
this.pos |
), |
null, |
true |
); |
}; |
}); |
|
// The solidgauge series type |
H.seriesType('solidgauge', 'gauge', { |
colorByPoint: true |
@@ -313,7 +269,7 @@ |
} |
} else { |
point.graphic = renderer.arc(shapeArgs) |
.addClass('highcharts-point') |
.addClass(point.getClassName(), true) |
.attr({ |
fill: toColor, |
'sweep-flag': 0 |