Js charts change line chart axis size font / color and background lines

I am trying to change the color of the background lines, and the font size and the color of the axis are to no avail. I am currently using the latest version of charts.js and cannot figure out how to make changes. In the old version of the diagrams, I could change them, but this code no longer works.

http://www.chartjs.org/docs

Here is my code:

var lineoptions = {
    legend:{
      display:false
    },
    scales:{
      yAxes:[{
        display:false
      }]
    },
    tooltips:{
      enabled:false
    },
    elements:{
      point:{
        radius:4,
        borderWidth:2
      }
    }
  };
  var linedata = {
    labels:[
      "618",
      "39",
      "1734",
      "3459"
    ],
    datasets:[
    {
      data:[618,39,1734,3459],
      fill:false,
      borderColor:"rgba(227,6,20,1)",
      pointBorderColor:"rgba(227,6,20,1)",
      pointBackgroundColor:"rgba(255,255,255,1)",
      pointHoverBackgroundColor:"rgba(255,255,255,1)",
      pointHoverBorderColor:"rgba(227,6,20,1)",
    }]
  };
  var linechart = document.getElementById("canvas-line").getContext("2d");
  var myLineChart = new Chart(linechart,{
    type:'line',
    data:linedata,
    options:lineoptions
  });

* EDIT *

I managed to change the color of the axis information using this:

defaultFontColor:'#6d6e71',

But I still need to figure out how to change the background lines of the chart itself (lines x and y).

+4
source share
1 answer

OK I understood:

scales:{
  xAxes:[{
    gridLines:{
      color:"rgba(255,255,255,0.5)",
      zeroLineColor:"rgba(255,255,255,0.5)"
    }
  }],
  yAxes:[{
    display:false
  }],
}
+9
source

All Articles