6

I am trying to set the height of a chart in Apexcharts, but it seems to only work in responsive mode, no matter what I try.

Any idea?

Here is a Codesandbox (it's the basic example from their docs, plus I added a height). Thanks for any help.

akmur
  • 1,465
  • 2
  • 24
  • 37

1 Answers1

10

You need to add the height to the actual Chart component like the width that has already been set in your example.

Here's an example of setting the height to 100px

<Chart options={this.state.options} series={this.state.series} type="bar" width="500" height="100" />

Documentation - Props

enter image description here

Shoejep
  • 4,414
  • 4
  • 22
  • 26
  • Thx, does it say so in the docs? In that case I totally missed it – akmur Jul 29 '20 at 08:13
  • It looks like it's in the [documentation](https://apexcharts.com/docs/react-charts/) under **Props** – Shoejep Jul 29 '20 at 08:18
  • Ah, right, thx. When I clicked on "height" it would bring me to a configuration option, so i just went down that way. – akmur Jul 29 '20 at 09:16