I am add rowcharts according the user input, append needed div elements, then add rowchart to this element, but I do not know how to retrieve this chart when when handle the label, when I use dc.rowChart("#rowchart_" + checkedValues[i]), it worked but it will throw me error, about the dimisions, and also I cannot set the reset link for the chart. My question is that: Is there ant way to retrieve the chart object?
Appreciate any help!!! Thanks!
for(var i = 0; i < checkedValues.length; i++){
$(".rowCharts").append("<div id='rowchart_" + checkedValues[i] + "' class='col-sm-12 col-md-12 col-lg-5'></div>");
dc.rowChart("#rowchart_" + checkedValues[i])
.width(400)
.height(300)
.margins({ top: 20, left: 10, right: 10, bottom: 20 })
.dimension(ndx.dimension(function (d) { return d[checkedValues[i]]; }))
.group(ndx.dimension(function (d) { return d[checkedValues[i]]; }).group())
// .label(function (d) {
// if (dc.rowChart("#rowchart_" + checkedValues[i]).hasFilter() && !dc.rowChart("#rowchart_" + checkedValues[i]).hasFilter(d.key)) {
// return d.key + '(0%)';
// }
// var label = d.key;
// if (all.value()) {
// label += '(' + (d.value / all.value() * 100).toFixed(2) + '%)';
// }
// return label;
// })
.title(function (d) { return d.value; })
.on('filtered.monitor', chartFilteredCallback)
.elasticX(true)
.rowsCap(10)
.ordering(function (d) { return -d.value })
.xAxis().ticks(5);
}