fix zoom
Gitea Actions Demo / build_and_push (push) Successful in 1m14s
Details
Gitea Actions Demo / build_and_push (push) Successful in 1m14s
Details
This commit is contained in:
parent
02e96853f3
commit
b17b67dc90
|
|
@ -523,6 +523,7 @@ type ChartRefEl = { chart: ChartJS };
|
|||
// and are never re-rendered, so no Ref wrapper is needed. Using a bare array
|
||||
// also sidesteps deep generic instantiation of Ref<Array<{ chart: Chart }>>.
|
||||
const chartRefs: Array<ChartRefEl> = [];
|
||||
let pendingRezoom = false;
|
||||
const group = new ChartGroup([]);
|
||||
const mapX = ref<Array<number>>([]);
|
||||
let currentCoordinates = ref<Array<number> | null>([]);
|
||||
|
|
@ -1172,7 +1173,10 @@ const setChartRef = (_key: string, el: unknown) => {
|
|||
chartRefs.every((ref) => !!ref.chart)
|
||||
) {
|
||||
group.charts = collectCharts();
|
||||
if (pendingRezoom) {
|
||||
pendingRezoom = false;
|
||||
applySelectedRangeZoom();
|
||||
}
|
||||
} else if (retries > 0) {
|
||||
nextTick(() => tryFinalize(retries - 1));
|
||||
}
|
||||
|
|
@ -1188,6 +1192,7 @@ const switchXAxis = (mode: XAxisMode) => {
|
|||
chartRefs.length = 0;
|
||||
group.charts = [];
|
||||
xAxisMode.value = mode;
|
||||
pendingRezoom = true;
|
||||
};
|
||||
onMounted(() => {
|
||||
group.charts = collectCharts();
|
||||
|
|
|
|||
Loading…
Reference in New Issue