javascript - Chart.js doughnut text colors -
how change doughnut text color , doughnut filler colors separately? have this:
var color = [ "#3f9f3f", "#ffffff" ]; var chartdata = { label : mylabels, data : mydata, colors : color }; the second color attribute overrides else i've tried. property, donuts specifically, fix this?

i'd text color different black color in chart.
edit:
this jsfiddle found shows basic chart.
http://jsfiddle.net/mayankcpdixit/6xv78/
the question is, how change font color inside doughnut?
edit 2:
realized text color inside donuts, while affected secondary color, painted using canvas.filltext(). such, needed add .fillstyle = "whatever" , works.
change
var mypie = new chart(document.getelementbyid("canvas").getcontext("2d")).doughnut(piedata,{percentageinnercutout : 80}); by
var mypie = new chart(document.getelementbyid("canvas").getcontext("2d")).doughnut(piedata,doughnutoptions); you can find available options here http://www.chartjs.org/docs/#getting-started-global-chart-configuration
for color text can add option
var doughnutoptions= { scalelabel: '<p style="color: red"><%=value%></p>' } change style="color: red" color want
Comments
Post a Comment