You can now specify segment color in data parameter

This commit is contained in:
Josef Rousek 2013-09-11 14:37:32 +02:00
parent b98ae8ab1d
commit e31c466528
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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

File diff suppressed because one or more lines are too long