Ell*_*esa 4 javascript highcharts
我正在设置一个图表,其中图例位于折线图下方.出于某种原因,图例似乎与其上方的x轴重叠.我对图例的设置如下:
legend: {
layout: 'horizontal',
align: 'center',
itemWidth: LegendWidth,
verticalAlign: 'bottom',
floating: true,
margin: 25,
borderWidth: 3,
useHTML:true,
}
Run Code Online (Sandbox Code Playgroud)
LegendWidth动态设置在哪里.我已经为保证金添加了一个值,但它仍然重叠.

您应该将legend.y设置为某个正数以将其向下移动.
legend: {
layout: 'horizontal',
align: 'center',
itemWidth: LegendWidth,
verticalAlign: 'bottom',
floating: true,
margin: 25,
borderWidth: 3,
useHTML:true,
y : 25 /* pushes the legend 25 points down */
}
Run Code Online (Sandbox Code Playgroud)