删除Chart.js折线图中的背景色

时间:2019-06-23 13:19:18

标签: chart.js ng2-charts chartjs-2.6.0

我已经这样设置了折线图:
I want to remove the green color from the background and make it transparent

如何从背景中去除绿色并将其变为透明

1 个答案:

答案 0 :(得分:2)

在数据集选项中将填充属性设置为false

<div id="parent">
  <p>read me read me read me</p>
  <div class="ignore-me">and thus ignore this text</div>
  <p>read me read me read me</p>
  <script class="ignore-me"></script>
  <p>read me read me read me</p>
  <link class="ignore-me">
</div>

<button id="Bt-Copy">copy to clipboard (except red part)</button>

您可以参考这个小提琴: https://jsfiddle.net/red_stapler/u5aanta8/1/

还参考图表Js Docs https://www.chartjs.org/docs/latest/charts/line.html