Reactjs 收到新值时如何进行自动缩放
我有一个带有条形图的组件,但我有一个套接字,可以接收此条形图的新值。如果值从19变为200,我必须双击重置缩放。是否有自动执行该操作的配置 我的plotly配置是:Reactjs 收到新值时如何进行自动缩放,reactjs,plotly.js,Reactjs,Plotly.js,我有一个带有条形图的组件,但我有一个套接字,可以接收此条形图的新值。如果值从19变为200,我必须双击重置缩放。是否有自动执行该操作的配置 我的plotly配置是: layout: { autosize: true, xaxis: { title: bottomText, autorange: true }, yaxis: { title: leftText, autorange: t
layout: {
autosize: true,
xaxis: {
title: bottomText,
autorange: true
},
yaxis: {
title: leftText,
autorange: true
},
dragmode: 'zoom',
hovermode: 'closest',
margin: {
t:20,
b: 150
},
transition: {
duration: 500,
easing: 'cubic-in-out'
}
},
data: [{
x: details.index,
y: details.fw,
type: 'bar'
}],
config: {
displaylogo: false,
locale: 'es',
}
更新图表时,您可以通过将新值指定给
layout.uirevision
来重置缩放。请参见更新图表时,您可以通过将新值指定给布局.ui修订版来重置缩放。看