mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Stat: Cut the top of the chart issue (#88640)
* fix(stat): update config on range change
This commit is contained in:
parent
f1dce0c7d7
commit
618c51e193
@ -86,7 +86,12 @@ export class Sparkline extends PureComponent<SparklineProps, State> {
|
|||||||
let rebuildConfig = false;
|
let rebuildConfig = false;
|
||||||
|
|
||||||
if (prevProps.sparkline !== this.props.sparkline) {
|
if (prevProps.sparkline !== this.props.sparkline) {
|
||||||
rebuildConfig = !compareDataFrameStructures(this.state.alignedDataFrame, prevState.alignedDataFrame);
|
const isStructureChanged = !compareDataFrameStructures(this.state.alignedDataFrame, prevState.alignedDataFrame);
|
||||||
|
const isRangeChanged = !isEqual(
|
||||||
|
alignedDataFrame.fields[1].state?.range,
|
||||||
|
prevState.alignedDataFrame.fields[1].state?.range
|
||||||
|
);
|
||||||
|
rebuildConfig = isStructureChanged || isRangeChanged;
|
||||||
} else {
|
} else {
|
||||||
rebuildConfig = !isEqual(prevProps.config, this.props.config);
|
rebuildConfig = !isEqual(prevProps.config, this.props.config);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user