KunLun
KunLun

Reputation: 3227

Google Chart color of gridline margin

gridlinecolor

What option from Google Chart Api change the color of that lines?

Upvotes: 1

Views: 23

Answers (1)

WhiteHat
WhiteHat

Reputation: 61275

use option --> baselineColor

on either / both --> hAxis, vAxis

var options = {
  hAxis: {
    baselineColor: 'magenta',
  },
  vAxis: {
    baselineColor: 'magenta',
  }
};

see following working snippet...

google.charts.load('current', {
  packages: ['corechart']
}).then(function () {
  var data = google.visualization.arrayToDataTable([
    ['x', 'y'],
    [0, 1],
    [1, 2],
    [2, 3],
  ]);

  var options = {
    hAxis: {
      baselineColor: 'magenta',
    },
    vAxis: {
      baselineColor: 'magenta',
    }
  };

  var chart = new google.visualization.LineChart(
    document.getElementById('chart_div')
  );
  chart.draw(data, options);
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>

Upvotes: 1

Related Questions