1

Im using react-google-charts

This is my chart code

<Chart
  chartType="Bar"
  loader={<div>Loading Chart</div>}
  data={[
    ["", "Credit", "Debit"],
    [
      "AVERAGE",
      avg_credit,
      avg_debit,
    ],
    [
      "30 Days",
      sum_values[0].CREDIT,
      sum_values[0].DEBIT,
    ],
    [
      "60 Days",
      sum_values[1].CREDIT,
      sum_values[1].DEBIT,
    ],
    [
      "90 Days",
      sum_values[2].CREDIT,
      sum_values[2].DEBIT,
    ],
  ]}
  options={{
    legend: { position: "none" },
    hAxis: {
      baselineColor: "none",
      ticks: [],
    },
  }}
/>

I have added the hAxis option there because I would like to completely remove the Y-axis (It's bar, it's numbering, and it's grid lines going horizontally through the graph), but they don't seem to have any effect, what can I do to achieve it? Thanks

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
Omar Hussein
  • 1,057
  • 2
  • 13
  • 31
  • given `"Bar"` is a _material_ chart, the `ticks` option is [not supported](https://github.com/google/google-visualization-issues/issues/2143) -- does [this answer](https://stackoverflow.com/a/50061663/5090771) help? – WhiteHat Feb 12 '20 at 12:40

1 Answers1

0

Try this. It will remove axis and text of that axis

hAxis: { textPosition: "none", gridlines: { count: 0 } },
  vAxis: { textPosition: "none", gridlines: { count: 0 } },
  baselineColor:"transparent",