简体   繁体   English

ChartJS 网格线不应超过 X 轴 (Y = 0) Line & Re-style Y Axis Color and Width

[英]ChartJS Grid Lines shouldn't surpass the X Axis (Y = 0) Line & Re-style Y Axis Color and Width

I am currently developing a component in which the grid lines on the vertical axis (the only ones present) should stop exactly on the X Axis Lines (Y = 0) line and not surpass this limit.我目前正在开发一个组件,其中垂直轴上的网格线(唯一存在的网格线)应该恰好停在 X 轴线 (Y = 0) 线上并且不超过此限制。 Something similar to what is going on on the Y Axis (X = 0) on the Image attached, but in this case there are no grid lines at all, the grid lines should be present on the vertical Axis.类似于附加图像上 Y 轴 (X = 0) 上发生的事情,但在这种情况下根本没有网格线,网格线应该出现在垂直轴上。

Also the style of the X Axis Lines is different to the Y Axis Lines style (Width and Color) and I can't find a way to modify them independently neither in ChartJS Documentation nor in Stackoverflow questions.此外,X 轴线的样式与 Y 轴线的样式(宽度和颜色)不同,我无法在 ChartJS 文档和 Stackoverflow 问题中找到独立修改它们的方法。

Thank you.谢谢你。

在此处输入图像描述

Add 'tickColor' to 'white'.将“tickColor”添加到“白色”。 It should fix it.它应该修复它。

Ex:前任:

      x: {
        grid: {
          display: true,
          tickColor: 'white'
        },
      }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM