Display row chart label regardless of bar size

847 views
Skip to first unread message

Clint Gibler

unread,
Jan 16, 2015, 2:28:08 PM1/16/15
to dc-js-us...@googlegroups.com
Hi,

First off, thank you everyone who has contributed to dc.js! I'm still relatively new to using it but I've been impressed with its functionality so far.

I'm building a row chart for data that has a fairly large value range-- say <10 to ~200+. Thus some of the rows are rather small. However, many of the rows have labels that are quite long, and in my specific situation, it's very important to be able to see the full label.

Here is a simple JSFiddle example:   http://jsfiddle.net/Lw42y75e/2/

What I've tried so far:
  • Moving the labels to the right with .labelOffsetX(num), but the label is still cut off by the length of the bar.
  • Reviewed the row-chart.js source - it doesn't appear to have the options I want.
  • The "long labels" thread is similar but my question is more about displaying the full labels than being able to click on the bars.
  • This issue is also similar but it's about y axis label truncation, I don't believe increasing the margins helps in this situation.
If there was an easy way to have the full label to the right of rows that would be ideal, but if there's another nice way to present this information that'd be great too.


My apologies if the answer is simple, I'm generally more of a backend than UI guy.

Thanks for your time,
Clint


Bradley Spatz

unread,
Jan 17, 2015, 7:37:43 AM1/17/15
to dc-js-us...@googlegroups.com
Make the label text color black? (Or different from the background beyond the bar)

Clint Gibler

unread,
Jan 29, 2015, 7:21:57 PM1/29/15
to dc-js-us...@googlegroups.com
Worked great, thanks!

In case it's useful to anyone else, I added the CSS:
    .dc-chart g.row text {
      fill
: black;
   
}
Reply all
Reply to author
Forward
0 new messages