最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to change label color in Morris.js charts? - Stack Overflow

programmeradmin1浏览0评论

I'm using morris.js charts which are fantastically easy to setup but I can't workout how to change the color for labels when rendering a Donut graph. By default it prints them in black but I want the graph on top of a dark background.

Does anyone know how to change the label color?

I'm using morris.js charts which are fantastically easy to setup but I can't workout how to change the color for labels when rendering a Donut graph. By default it prints them in black but I want the graph on top of a dark background.

Does anyone know how to change the label color?

Share Improve this question asked Dec 11, 2012 at 0:11 RomanRoman 10.4k18 gold badges69 silver badges103 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4
<div id="bar-chart" class="morris-chart" style="height: 180px"></div>

.morris-chart text {
  fill: white;
}

To change the label color, simply add labelColor property to Morris.Donut config object like below

Morris.Donut({
  labelColor: '#FFF'
});
发布评论

评论列表(0)

  1. 暂无评论