I am attempting to manually adjust the width of a pie chart that has already been generated. The chart is constructed and displayed using an angular factory and directive, and I want to access this chart from a controller. Is there a method similar to
var chart = dc.pieChart("#pieChart");
that I can utilize for this purpose:
chart
.width(500)
dc.redrawAll()
How can I retrieve a chart that has already been rendered in order to perform the above action?
I ended up passing the chart object back through a custom object on the scope just to access it successfully.
// within another function
$scope.thisObject.charts.forEach(function(d){
if (d.name === element.id) {
// found the correct object
d.chart
.width(500)
.height(500)
dc.chart.render();
// this method works for bar graphs, rows, and line charts, but not pies?
}
})