mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
Rename strokeColor -> backgroundColor.
This commit is contained in:
parent
2cce7c43de
commit
d87c0ef8ae
@ -24,7 +24,7 @@ Morris.Donut({
|
||||
{value: 10, label: 'baz'},
|
||||
{value: 5, label: 'A really really long label'}
|
||||
],
|
||||
strokeColor: '#ccc',
|
||||
backgroundColor: '#ccc',
|
||||
formatter: function (x) { return x + "%"}
|
||||
});
|
||||
</pre>
|
@ -22,7 +22,7 @@ class Morris.Donut
|
||||
'#052C48'
|
||||
'#042135'
|
||||
],
|
||||
strokeColor: '#FFFFFF',
|
||||
backgroundColor: '#FFFFFF',
|
||||
formatter: Morris.commas
|
||||
|
||||
# Create and render a donut chart.
|
||||
@ -72,7 +72,7 @@ class Morris.Donut
|
||||
@segments = []
|
||||
for d in @data
|
||||
next = last + min + C * (d.value / total)
|
||||
seg = new Morris.DonutSegment(cx, cy, w*2, w, last, next, @options.colors[idx % @options.colors.length], @options.strokeColor, d)
|
||||
seg = new Morris.DonutSegment(cx, cy, w*2, w, last, next, @options.colors[idx % @options.colors.length], @options.backgroundColor, d)
|
||||
seg.render @r
|
||||
@segments.push seg
|
||||
seg.on 'hover', @select
|
||||
@ -115,7 +115,7 @@ class Morris.Donut
|
||||
#
|
||||
# @private
|
||||
class Morris.DonutSegment extends Morris.EventEmitter
|
||||
constructor: (@cx, @cy, @inner, @outer, p0, p1, @color, @strokeColor, @data) ->
|
||||
constructor: (@cx, @cy, @inner, @outer, p0, p1, @color, @backgroundColor, @data) ->
|
||||
@sin_p0 = Math.sin(p0)
|
||||
@cos_p0 = Math.cos(p0)
|
||||
@sin_p1 = Math.sin(p1)
|
||||
@ -151,7 +151,7 @@ class Morris.DonutSegment extends Morris.EventEmitter
|
||||
render: (r) ->
|
||||
@arc = r.path(@hilight).attr(stroke: @color, 'stroke-width': 2, opacity: 0)
|
||||
@seg = r.path(@path)
|
||||
.attr(fill: @color, stroke: @strokeColor, 'stroke-width': 3)
|
||||
.attr(fill: @color, stroke: @backgroundColor, 'stroke-width': 3)
|
||||
.hover(=> @fire('hover', @))
|
||||
|
||||
select: =>
|
||||
|
10
morris.js
10
morris.js
@ -1304,7 +1304,7 @@
|
||||
|
||||
Donut.prototype.defaults = {
|
||||
colors: ['#0B62A4', '#3980B5', '#679DC6', '#95BBD7', '#B0CCE1', '#095791', '#095085', '#083E67', '#052C48', '#042135'],
|
||||
strokeColor: '#FFFFFF',
|
||||
backgroundColor: '#FFFFFF',
|
||||
formatter: Morris.commas
|
||||
};
|
||||
|
||||
@ -1351,7 +1351,7 @@
|
||||
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
||||
d = _ref1[_j];
|
||||
next = last + min + C * (d.value / total);
|
||||
seg = new Morris.DonutSegment(cx, cy, w * 2, w, last, next, this.options.colors[idx % this.options.colors.length], this.options.strokeColor, d);
|
||||
seg = new Morris.DonutSegment(cx, cy, w * 2, w, last, next, this.options.colors[idx % this.options.colors.length], this.options.backgroundColor, d);
|
||||
seg.render(this.r);
|
||||
this.segments.push(seg);
|
||||
seg.on('hover', this.select);
|
||||
@ -1439,13 +1439,13 @@
|
||||
|
||||
__extends(DonutSegment, _super);
|
||||
|
||||
function DonutSegment(cx, cy, inner, outer, p0, p1, color, strokeColor, data) {
|
||||
function DonutSegment(cx, cy, inner, outer, p0, p1, color, backgroundColor, data) {
|
||||
this.cx = cx;
|
||||
this.cy = cy;
|
||||
this.inner = inner;
|
||||
this.outer = outer;
|
||||
this.color = color;
|
||||
this.strokeColor = strokeColor;
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.data = data;
|
||||
this.deselect = __bind(this.deselect, this);
|
||||
|
||||
@ -1487,7 +1487,7 @@
|
||||
});
|
||||
return this.seg = r.path(this.path).attr({
|
||||
fill: this.color,
|
||||
stroke: this.strokeColor,
|
||||
stroke: this.backgroundColor,
|
||||
'stroke-width': 3
|
||||
}).hover(function() {
|
||||
return _this.fire('hover', _this);
|
||||
|
2
morris.min.js
vendored
2
morris.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user