2016-09-17 86 views

回答

3

您可以在图表选项编辑您的数据集显示:

options: { 
    scales: { 
     // The following will affect the vertical lines (xAxe) of your dataset 
     xAxes: [{ 
      gridLines: { 
       // You can change the color, the dash effect, the main axe color, etc. 
       borderDash: [8, 4], 
       color: "#348632" 
      } 
     }], 

     // And this will affect the horizontal lines (yAxe) of your dataset 
     yAxes: [{ 
      gridLines: { 
       borderDash: [8, 4], 
       color: "#348632" 
      } 
     }] 
    } 
} 

现在你知道该怎么做,只是改变它,你怎么想的那样。
查看Chart.js文档中的Grid Line Configuration向下滚动)查看可编辑的内容。

如果需要的话,这里有一个工作示例on this jsFiddle其结果是:

enter image description here

+1

非常感谢你的帮助! –

相关问题