mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
You can now specify segment color in data parameter
This commit is contained in:
parent
b98ae8ab1d
commit
e31c466528
@ -76,7 +76,7 @@ class Morris.Donut extends Morris.EventEmitter
|
|||||||
next = last + min + C * (value / total)
|
next = last + min + C * (value / total)
|
||||||
seg = new Morris.DonutSegment(
|
seg = new Morris.DonutSegment(
|
||||||
cx, cy, w*2, w, last, next,
|
cx, cy, w*2, w, last, next,
|
||||||
@options.colors[idx % @options.colors.length],
|
@data[i].color || @options.colors[idx % @options.colors.length],
|
||||||
@options.backgroundColor, idx, @raphael)
|
@options.backgroundColor, idx, @raphael)
|
||||||
seg.render()
|
seg.render()
|
||||||
@segments.push seg
|
@segments.push seg
|
||||||
|
@ -1576,7 +1576,7 @@
|
|||||||
for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) {
|
for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) {
|
||||||
value = _ref1[i];
|
value = _ref1[i];
|
||||||
next = last + min + C * (value / total);
|
next = last + min + C * (value / total);
|
||||||
seg = new Morris.DonutSegment(cx, cy, w * 2, w, last, next, this.options.colors[idx % this.options.colors.length], this.options.backgroundColor, idx, this.raphael);
|
seg = new Morris.DonutSegment(cx, cy, w * 2, w, last, next, this.data[i].color || this.options.colors[idx % this.options.colors.length], this.options.backgroundColor, idx, this.raphael);
|
||||||
seg.render();
|
seg.render();
|
||||||
this.segments.push(seg);
|
this.segments.push(seg);
|
||||||
seg.on('hover', this.select);
|
seg.on('hover', this.select);
|
||||||
|
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