Apexcharts.js: Cannot set height on any chart

Created on 29 Jul 2020  路  2Comments  路  Source: apexcharts/apexcharts.js

Bug report

Codesandbox

Codesandbox

Explanation

  • What is the behavior you expect?
    I expect to be able to determine the height of the stacked horizontal bar using the "height" option.
    I also tried to set the height of the chart through the parent's div, by setting a fixed height, but it seems to not work.

  • What is happening instead?
    The height of the stacked horizontal bar in the example cannot be set. Everything is always "responsive". I also tried with a Pie chart and I also cannot set the height there.

  • What error message are you getting?
    No error message, but I can't resize the height of the chart.

Note

In this CodePen (not using the react wrapper) it seems to be working, but I am not sure if the issue is the react wrapper or something else.
Also, in your basic example trying to add a height doesn't work.

Codesandbox

Most helpful comment

I have found a solution in setting the height in the Component, so like:

          height="200px"
          options={options}
          series={series}
          type="bar"

So the problem is solved in this way, but I still don't understand if the height option in the config should work or not :)

All 2 comments

I have found a solution in setting the height in the Component, so like:

          height="200px"
          options={options}
          series={series}
          type="bar"

So the problem is solved in this way, but I still don't understand if the height option in the config should work or not :)

In Vue/React, the height prop in the component overrides the height key in options.
So, the behavior is correct. Glad you solved it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

felixalguzman picture felixalguzman  路  3Comments

maasha picture maasha  路  3Comments

jlil picture jlil  路  3Comments

artfulrobot picture artfulrobot  路  3Comments

frlinw picture frlinw  路  3Comments