Chart area background color chartjs

前端 未结 2 780
悲哀的现实
悲哀的现实 2020-12-08 19:17

I have problem with chart js, i want to coloring chart area like image above

I try to find configuration from charJs Docs , but nothing matched. its possible or not

2条回答
  •  爱一瞬间的悲伤
    2020-12-08 19:47

    The canvas background is transparent by definition, like any element, so you just need to define the background-color in your canvas, for example, in your case you will need this CSS:

    JSFiddle

    canvas#barChart {
      background-color: #f00;
    }
    

    or HTML inline, to clarify the idea:

    
    

提交回复
热议问题