admin管理员组文章数量:1292646
I'm trying to remove the padding / margin of amChart.
I've tried to use am4core.percent(100)
for chart.width
and chart.plotContainer.width
.
I'm browsing the web for a bit, without success. I don't know if it's because of the amChart logo in bottom left creating that padding.
I'm trying to remove the padding / margin of amChart.
I've tried to use am4core.percent(100)
for chart.width
and chart.plotContainer.width
.
I'm browsing the web for a bit, without success. I don't know if it's because of the amChart logo in bottom left creating that padding.
Share Improve this question edited Jun 18, 2020 at 11:31 rid 63.6k31 gold badges157 silver badges197 bronze badges asked Jun 18, 2020 at 11:30 Axel.LAxel.L 311 silver badge2 bronze badges 1- chart.padding(0, 0, 0, 0); – Buda Sergiu Flavius Commented Feb 5, 2021 at 15:18
3 Answers
Reset to default 5For AmCharts 5 the correct way for setting padding to 0 is:
const chart = root.container.children.push(am5xy.XYChart.new(root, {
paddingRight: 0,
paddingTop: 0,
paddingBottom: 0,
paddingLeft: 0,
}));
Have a look at their doc: https://www.amcharts./docs/v5/reference/xychart/#paddingBottom_setting
Also knowing how a XY chart is structured in AmCharts 5 can be very handy: https://www.amcharts./docs/v5/charts/xy-chart/xy-chart-containers/
chart.paddingTop = 0;
chart.paddingBottom = 0;
chart.paddingLeft = 0;
chart.paddingRight = 0;
Example: https://codepen.io/rsaraceni/pen/xxRGGvQ
If you are using amcharts 5 I got a slightly different answer. The paddings is part of the charts "_settings" attribute
chart._settings.paddingRight = 0;
chart._settings.paddingLeft = 0;
chart._settings.paddingTop = 0;
chart._settings.paddingBottom = 0;
本文标签: javascriptHow to remove amCharts container paddingStack Overflow
版权声明:本文标题:javascript - How to remove amCharts container padding? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741557548a2385248.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论