Please see below example that comes from highchart official documents. There is still some space between legend and chart. I want to make the chart as large as possible, but not overlap the legend.
The data of my chart is dynamic. The number of legend items is variable. Therefore I cannot use a fixed marginBottom/ marginTop, eg
chart: {
marginBottom: 50, // does not work for me, as the number of legend items is varied.
marginTop: -10
}
You can remove the padding and margin on the legend to get back some space.
legend : {
margin: 0,
padding: 0
},
Depending on how close you want to get it, you can make margin a negative number if you need to.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.