首页 > 解决方案 > chart.scrollablePlotArea 意外行为

问题描述

我正在尝试在scrollBar我的图表中添加一个,但它没有按预期工作。我很难让它出现。我找到的解决方案是从我的xAxischart.scrollablePlotAreacontainerPropsreact-component

containerProps={{
  className: "chart",
  style: {
    height: "500px",
    minWidth: "280px"
  }
}}

随之scrollBar出现了,但出现了一些意想不到的行为,首先是fullScreen坏了(它开始出现黑条),其次是customButton开始随着图表移动。我在exporting.buttons.contextButton API上进行了搜索,但找不到任何属性来固定其位置。

是一个工作演示,感谢任何帮助。

标签: javascriptreactjshighchartsreact-highcharts

解决方案


我找到的解决方案是从我的 react-component 中删除 containerProps

scrollablePlotArea在不删除 的情况下似乎可以正常工作containerProps,但容器宽度必须小于 set scrollablePlotArea.minWidth

首先全屏坏了(它开始出现黑条)

这是一个已经修复的错误。下一个版本后将在 Highcharts npm 中提供。

https://github.com/highcharts/highcharts/issues/12832

第二个 customButton 开始随着图表移动

您是如何找到此功能的?API 中似乎customButton不可用,这意味着不完全支持。


推荐阅读