is it possible to duplicate the y axis labels to the right side of a google chart?

Viewed 50

is there anyone having some experience with Google Charts, who was facing a similar problem before? I basically need to display the same y axis labels on the both sides of the graph, as shown on the image: image of the graph

Here is my dataset:

['Date', 'Drilling', 'Stacked', 'Cold stacked', 'Construction', 'Repair']
['2020-09-16', 406, 171, 135, 67, 3]
['2020-09-17', 407, 170, 135, 67, 3]
['2020-09-18', 408, 169, 135, 67, 3]
['2020-09-19', 408, 169, 135, 67, 3]
['2020-09-20', 409, 168, 135, 67, 3]
['2020-09-21', 408, 169, 135, 67, 3]
['2020-09-22', 406, 171, 135, 67, 3]
['2020-09-23', 407, 170, 135, 67, 3]
...and so on...

And graph settings:

{
  isStacked: true,
  colors: ['#ff4852', '#005BFF', '#FFAB2E', '#af5ddf', '#00A580'],
  vAxis: {
    format: '######',
  },
  chartArea: {
    top: '30',
    height: '75%',
    width: '80%',
  },
  series: {
    0: {
      textPosition: 'none',
    },
  },
  vAxes: {
    1: {
      textPosition: 'none',
    },
  },
  hAxes: {
    0: {
      gridlines: { color: 'transparent' },
    },
  },
}

1 Answers

Need to test it out but let's try as below. Otherwise you have to duplicate the series data and set it to 'targetAxisIndex: 1'.

series: {
  0: {
    targetAxisIndex: 0,
    targetAxisIndex: 1,
  },
},

Related