简体   繁体   English

如何调整DC.js饼图上的标签?

[英]How can I adjust the labels on a DC.js pie chart?

I have a DC.js pie chart with some really small values comparatively. 我有一个DC.js饼图,其中包含一些相对较小的值。 I'm trying to adjust the labels so they aren't on the actual chart. 我正在尝试调整标签,以使它们不在实际图表上。 I want them to be off preferably with lines drawn to the slices. 我希望它们最好是在切片上画线。 (something like this http://www.telerik.com/help/aspnet-ajax/media/htmlchart-piechart-simple-example.png ) (类似http://www.telerik.com/help/aspnet-ajax/media/htmlchart-piechart-simple-example.png

I'm can't find any examples of this with DC.js and the only thing close is this ( Label outside arc (Pie chart) d3.js ), with d3.js, but I'm a little confused as how to implement in dc. 我在DC.js上找不到任何示例,而唯一接近的是d3.js( 在弧外标签(饼图)d3.js )和d3.js,但是我有点困惑在DC中实施。

Anything to point me in the right direction would be greatly appreciated. 任何指向我正确方向的事情将不胜感激。

I think currently you would have to suppress the built in titles with .renderTitle(false) and then implement the custom titles in a renderlet . 我觉得目前你将不得不抑制内置的职称.renderTitle(false) ,然后执行自定义标题在renderlet You would reselect the slices and then apply pretty much the code in that other question. 您将重新选择切片,然后在另一个问题中应用几乎所有代码。 The data will already be attached to the slices. 数据将已附加到切片。

The titles would appear a moment later, as that's how renderlets work, but perhaps that wouldn't be such a bad effect. 标题将在稍后显示,因为这就是renderlet的工作方式,但这也许并不是那么糟糕。

Of course, I haven't tried this, just a suggestion.. 当然,我还没有尝试过,只是一个建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM