Vue-chartjs: Add horizontal grid lines in a bar chart

Created on 7 Dec 2017  ยท  3Comments  ยท  Source: apertureless/vue-chartjs

Hi,
I have tried several options in order to draw grid lines to ease the reading of my bar chart.
Currently i have this:
without_line
but i would like to get that:
with_line
with the horizontal lines

I tried

gridLines
beginAtZero
etc..

but can't find the option parameter to do so.

Thank you for your help

โ“ question

Most helpful comment

It's in the scale object.

const options = {
  scales: {
    yAxes: [{
      ticks: {
        beginAtZero: true
      },
      gridLines: {
        display: false
      }
    }],
    xAxes: [ {
      gridLines: {
        display: true
      },
    }]
  }
}

All 3 comments

It's in the scale object.

const options = {
  scales: {
    yAxes: [{
      ticks: {
        beginAtZero: true
      },
      gridLines: {
        display: false
      }
    }],
    xAxes: [ {
      gridLines: {
        display: true
      },
    }]
  }
}

where did you put that peice of code? thanks

It is the second argument you pass to this.renderChart(data, options)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kurbar picture kurbar  ยท  4Comments

rzb picture rzb  ยท  4Comments

DavidSotoA picture DavidSotoA  ยท  3Comments

timster picture timster  ยท  5Comments

LeeLenaleee picture LeeLenaleee  ยท  3Comments