how to the first and last X axis lables in google line chart?

32 Views Asked by At

I have created a google line chart with the following option, but the first and last X-axis labels are NOT shown, how to fix it?

        hAxis: {
          gridlines: {
            count: 9,            
            units: {
              days: {format: ['MMM dd']},
              hours: {format: ['ha']},
            }
          },              
        },
        vAxis: {
          ticks: [0, 54, 70, 180, 250, 350]
        }

enter image description here

1

There are 1 best solutions below

0
WhiteHat On

try adding more space for the labels to be displayed,
using the chartArea, left & right options...

chartArea: {
  left: 40,   // <-- 40 is arbitrary, increase until they appear
  right: 40
}