Vinoth Kumar Vinoth Kumar - 1 month ago 13
CSS Question

How to move a pie chart down?

I have created a

pie chart
with the following code.

customeractivity
.width(262)
.height(120)
.slicesCap(5)
.colors(d3.scale.ordinal().range(["#FFDA33","#05BCDC","#EA7262","#0071CF","#58A531","#E51F30"]))
.dimension(Age_GrpDimension)
.group(Age_GrpGroup)
.legend(dc.legend().x(0).y(16).itemHeight(15).gap(3))

.on('pretransition', function(chart) {
chart.selectAll('text.pie-slice').text(function(d) {
return Math.round(dc.utils.printSingleValue((d.endAngle - d.startAngle) / (2*Math.PI) * 100)*10)/10+ '%';
})
});

customeractivity.render();


The
pie chart
looked like this:

enter image description here

Do anyone know how to move this pie chart down?
I tried adding
space
, but it had some side effects. So, I'm stuck now. Please help me out.

Answer

Use tag for the heading Forecast Customer Activity,then use padding to move the chart down. Try the following code.

<div class="x_content" style="margin: 20px 0px 0px -24px;color:black;width:200px;height:255px;background:#ffffff;border:1px solid black;">
<h style="margin: 3px 0px 0px 0px;font-size:13px;"><b>&nbsp;&nbsp;&nbsp;Forecast Customer Activity</b></h>
<div id="customeractivity" style="margin: 0px 0px 0px 0px;padding:30px 0px 0px 0px;">
</div>
</div>