@@ -23,6 +23,7 @@ class Morris.Donut
23
23
' #042135'
24
24
],
25
25
backgroundColor : ' #FFFFFF' ,
26
+ labelColor : ' #000000' ,
26
27
formatter : Morris .commas
27
28
28
29
# Create and render a donut chart.
@@ -78,8 +79,8 @@ class Morris.Donut
78
79
seg .on ' hover' , @select
79
80
last = next
80
81
idx += 1
81
- @text1 = @ drawEmptyDonutLabel (cx, cy - 10 , 15 , 800 )
82
- @text2 = @ drawEmptyDonutLabel (cx, cy + 10 , 14 )
82
+ @text1 = @ drawEmptyDonutLabel (cx, cy - 10 , @options . labelColor , 15 , 800 )
83
+ @text2 = @ drawEmptyDonutLabel (cx, cy + 10 , @options . labelColor , 14 )
83
84
max_value = Math .max .apply (null , d .value for d in @data )
84
85
idx = 0
85
86
for d in @data
@@ -110,8 +111,10 @@ class Morris.Donut
110
111
text2scale = Math .min (maxWidth / text2bbox .width , maxHeightBottom / text2bbox .height )
111
112
@text2 .attr (transform : " S#{ text2scale} ,#{ text2scale} ,#{ text2bbox .x + text2bbox .width / 2 } ,#{ text2bbox .y } " )
112
113
113
- drawEmptyDonutLabel : (xPos , yPos , fontSize , fontWeight ) ->
114
- text = @raphael .text (xPos, yPos, ' ' ).attr (' font-size' , fontSize)
114
+ drawEmptyDonutLabel : (xPos , yPos , color , fontSize , fontWeight ) ->
115
+ text = @raphael .text (xPos, yPos, ' ' )
116
+ .attr (' font-size' , fontSize)
117
+ .attr (' fill' , color)
115
118
text .attr (' font-weight' , fontWeight) if fontWeight?
116
119
return text
117
120
0 commit comments