I'm building a dc.js-based visualization where one of the charts is a pie chart. See:
http://jsfiddle.net/luiseth/t8we6/
The peculiarity of my case is that the labels that this chart will display are usually rather long, so much that usually get clipped by the chart's container (the <div>
). So I thought of having them appear on a legend, but I haven't been able to figure how to have the legend appear to the right of the chart. How can I do that? Playing around with the width
has not helped at all, since the chart gets positioned at the center of the <div>
.
My code at the moment is:
chart.width(500)
.height(180)
.radius(80)
.dimension(categoryDimension)
.group(categoryGroup)
.legend(dc.legend().x(140).y(0).gap(5));
Plus a .label
directive to replace the label with a percentage.