8

I am using dc.js row chart. Something exactly like the day of the week chart in the example of this page

Can someone please suggest how can I change the label colors from white to black.

Andy897
  • 6,915
  • 11
  • 51
  • 86

2 Answers2

18

I your CSS, use .dc-chart g.row text {fill: black;}.

FernOfTheAndes
  • 4,975
  • 2
  • 17
  • 25
  • Can you explain how this works? I thought g.row applied to all g elements having class row. – dev Jun 27 '14 at 15:26
  • You are right, it does. So, in the example given by the OP, there is no inline styling for the `text` elements (or their parent `g` elements with class row) which would have overriden any CSS styling. So, you can go ahead and simply CSS style the `g` elements having class row to whichever color you want and the `text` elements will inherit that (the cascading effect). Here is a minimal [FIDDLE](http://jsfiddle.net/qtH9q/) illustrating my point. – FernOfTheAndes Jun 27 '14 at 16:51
2

Furthermore, for those who try with pie charts, the selector for labels is without the g.row. i.e. : .dc-chart text.pie-slice {fill: black;}