Victory Charts background grid

Viewed 5197

Is it possible to display a grid like this using Victory charts?

enter image description here

So far I can only get a grid with both vertical and horizontal lines on top of my bars likes this:

enter image description here

2 Answers

By providing

style={{
      grid: { stroke: '#ddd444', strokeWidth: 1.5 },
    }}

to your dependant axis like

<VictoryAxis
        dependentAxis
        tickFormat={(tick) => `${tick}`}
        style={{
          grid: { stroke: '#F4F5F7', strokeWidth: 0.5 },
        }}
      />

you will achieve desired result.

Related