admin管理员组

文章数量:1308161

How can I render only specific chart not all using dc.js.

renderAll() function accepts group. However, what is group in this context is not clear. Following doesnt work,

var priceChart = dc.rowChart("#price-chart");
dc.renderAll(priceChart)

How can I render only specific chart not all using dc.js.

renderAll() function accepts group. However, what is group in this context is not clear. Following doesnt work,

var priceChart = dc.rowChart("#price-chart");
dc.renderAll(priceChart)
Share Improve this question edited Mar 18, 2014 at 23:21 Jack Daniel's asked Mar 18, 2014 at 0:46 Jack Daniel'sJack Daniel's 2,61325 silver badges28 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 6

What you want to write instead is :

var priceChart = dc.rowChart("#price-chart","mygroup");
dc.renderAll("mygroup");

PriceChart.render() works now as well.

In case you wanna render all charts in the same group (for example, under "mygroup" you have rowChart, barChart... then when you do renderAll("mygroup") it will render everything under the same group.

var priceChart = dc.rowChart("#price-chart","mygroup");
dc.renderAll("mygroup"); 

In some cases you dont want to do it, you should use

priceChart.render();

instead of

dc.renderAll("mygroup");

本文标签: javascriptRender only specific chart using dcjsStack Overflow