[英]ChartJs - Adding padding after Y- Axis
I am using chart js 2.7 .I need to add padding after Y-Axis.Means i need a gap before the start and end of the graph. 我正在使用js 2.7图表。我需要在Y轴之后添加填充。这意味着我需要在图表的开始和结束之前留一个空隙。 I need to bring the labels inside the x-axis line. 我需要将标签放入x轴线内。 I found a similar question below. 我在下面找到了类似的问题。
How to Add X axis Padding in chart js Line Graph 如何在图表js折线图中添加X轴填充
But it provides a solution by adding null values. 但是它通过添加空值提供了一种解决方案。 Is there any other solution. 还有其他解决方案吗?
Thanks 谢谢
Add to your options: 添加到您的选项:
options: {
scales: {
yAxes: [{
ticks: {
padding: 100
}
}],
}
}
Working jsfiddle -> https://jsfiddle.net/vz4qhqpw/2664/ 工作jsfiddle-> https://jsfiddle.net/vz4qhqpw/2664/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.