在具有拖放功能的Highcharts中,轴会自动调整,以便您可以拖动到当前范围之外。例如,在下图中,Y轴从2-9开始:
import React from "react";
import { render } from "react-dom";
import Highcharts from "highcharts";
import more from "highcharts/highcharts-more";
import draggable from "highcharts/modules/draggable-points";
import HighchartsReact from "highcharts-react-official";
if (typeof Highcharts === "object") {
more(Highcharts);
draggable(Highcharts);
}
class App extends React.Component {
render() {
return (
<HighchartsReact
highcharts={Highcharts}
constructorType={"chart"}
options={{
tooltip: {
valueDecimals: 2
},
series: [
{
name: "Range",
data: [[0, 3, 8], [1, 3, 8], [2, 3, 8]],
type: "arearange",
dragDrop: {
draggableHigh: true,
draggableLow: true
},
linkedTo: ":previous"
}
]
}}
/>
);
}
}
render(<App />, document.getElementById("root"));有关实时示例,请参阅this demo。
问题是调整太快了。例如,尝试将一个点从y = 8拖动到y = 14。Y轴调整非常敏感,以至于在我有时间停止拖动之前,点是30。当我向下拖动点时,同样的问题也发生在相反的方向。尝试了几次后,我完全无法将该点的值设置为14。
所以问题是:我如何降低自动调整的速度?
(请注意,这里有一个dragSensitivity选项,但它在本例中并不相关。)
发布于 2020-02-05 19:46:30
您是否已尝试将liveRedraw功能设置为false?我认为这将满足您的要求,因为当此选项设置为false时,拖动精度会更好。
演示:https://codesandbox.io/s/too-sensitive-y-axis-adjustment-with-highcharts-drag-and-drop-7f41g
接口名:https://api.highcharts.com/highcharts/plotOptions.arearange.dragDrop.liveRedraw
https://stackoverflow.com/questions/60062199
复制相似问题