如何在日期时间刻度上将x轴标签从边缘移开?

时间:2019-03-06 09:39:30

标签: anychart

我有这张图表:https://playground.anychart.com/D7okDBpO/2

我希望绘图和x轴标签在左右边缘都有一些填充(原因之一是最后一个x标签现在甚至还不完全可见),类似于图表顺序比例尺被渲染。对于剧情,我设法做到了:

series.left(30);
series.right(30);

但是我找不到x标签的解决方案。我尝试过的:

// This doesn't work because it moves both first and last label
chart.xAxis().labels().offsetX(-30);

// This doesn't work because it moves all the labels, even the ones in the middle
chart.xAxis().labels().padding().left(50);

1 个答案:

答案 0 :(得分:1)

您是否正在寻找此设置:

chart.left(20);
chart.right(20);

https://playground.anychart.com/miB1VAbq吗?