如何将饼图向下移动?

时间:2022-12-03 17:33:43

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:

饼状图是这样的:

如何将饼图向下移动?

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.

有人知道怎么把饼图往下移动吗?我试着增加空间,但它有一些副作用。所以,我现在困了。请帮帮我。

1 个解决方案

#1


1  

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>

#1


1  

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>