如何减少 amcharts4 中的 PieChart 边框大小(宽度)?
How to reduce PieChart border size(width) in amcharts4?
如何减小 amcharts 中的 PieChart 边框大小(宽度),如下所示?我想像第二个一样减小第一个图表边框大小(宽度)。我已经将 innerRadius 属性 设置为 100%。
您必须将 innerRadius
和 radius
都增加到足够大的值以使圆更细。
chart.innerRadius = am4core.percent(100);
chart.radius = am4core.percent(100);
演示:
var chart = am4core.create("chartdiv", am4charts.PieChart);
chart.data = [{
"category": "",
"value": 100
}];
chart.innerRadius = am4core.percent(100)
chart.radius = am4core.percent(100)
var pieSeries = chart.series.push(new am4charts.PieSeries());
pieSeries.dataFields.value = "value";
pieSeries.dataFields.category = "category";
pieSeries.ticks.template.disabled = true;
pieSeries.labels.template.disabled = true;
var label = pieSeries.createChild(am4core.Label)
label.text = "100%";
label.horizontalCenter = "middle";
label.verticalCenter = "middle";
label.fontSize = "2em";
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
#chartdiv {
width: 200px;
height: 200px;
}
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/charts.js"></script>
<div id="chartdiv"></div>
如何减小 amcharts 中的 PieChart 边框大小(宽度),如下所示?我想像第二个一样减小第一个图表边框大小(宽度)。我已经将 innerRadius 属性 设置为 100%。
您必须将 innerRadius
和 radius
都增加到足够大的值以使圆更细。
chart.innerRadius = am4core.percent(100);
chart.radius = am4core.percent(100);
演示:
var chart = am4core.create("chartdiv", am4charts.PieChart);
chart.data = [{
"category": "",
"value": 100
}];
chart.innerRadius = am4core.percent(100)
chart.radius = am4core.percent(100)
var pieSeries = chart.series.push(new am4charts.PieSeries());
pieSeries.dataFields.value = "value";
pieSeries.dataFields.category = "category";
pieSeries.ticks.template.disabled = true;
pieSeries.labels.template.disabled = true;
var label = pieSeries.createChild(am4core.Label)
label.text = "100%";
label.horizontalCenter = "middle";
label.verticalCenter = "middle";
label.fontSize = "2em";
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
#chartdiv {
width: 200px;
height: 200px;
}
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/charts.js"></script>
<div id="chartdiv"></div>