【问题标题】:Setting height of a chart in Apexcharts在 Apexcharts 中设置图表的高度
【发布时间】:2020-11-18 17:13:00
【问题描述】:

我正在尝试在 Apexcharts 中设置图表的高度,但无论我尝试什么,它似乎都只能在响应模式下工作。

有什么想法吗?

这是一个Codesandbox(这是他们文档中的基本示例,另外我添加了一个高度)。 感谢您的帮助。

【问题讨论】:

  • 你试过在Chart上设置height,即<Chart options={this.state.options} series={this.state.series} type="bar" width="500" height="100" />
  • 我爱你,不,我没有尝试!

标签: apexcharts


【解决方案1】:

您需要将height 添加到实际的Chart 组件中,就像您的示例中已经设置的宽度一样。

这是一个将height 设置为100px 的示例

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

文档 - Props

【讨论】:

  • 谢谢,文档中是这样说的吗?在那种情况下,我完全错过了它
  • 好像在Props下的documentation
  • 啊,对,谢谢。当我点击“高度”时,它会将我带到一个配置选项,所以我就这样下去了。
猜你喜欢
  • 2021-04-18
  • 2017-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-04
  • 2012-11-04
  • 1970-01-01
相关资源
最近更新 更多