timezone fixes and default parameters

This commit is contained in:
terraputix
2026-02-16 11:36:49 +01:00
parent 60b89c5856
commit 527052aa70
5 changed files with 114 additions and 18 deletions
@@ -171,7 +171,14 @@
});
const tooltipBase = (
formatter: (params: Record<string, unknown>[]) => string
formatter: (
params: Array<{
axisValue: number;
seriesName: string;
marker: string;
value: number | number[] | null;
}>
) => string
): Record<string, unknown> => ({
trigger: 'axis',
axisPointer: {
@@ -181,7 +188,13 @@
backgroundColor: colors.tooltipBg,
color: colors.text,
borderColor: colors.tooltipBorder,
borderWidth: 1
borderWidth: 1,
formatter: (params: { axisDimension: string; value: number }) => {
if (params.axisDimension === 'x') {
return formatZoned(new Date(params.value), data.timezone, 'EEE d MMM HH:mm');
}
return params.value.toFixed(1);
}
}
},
backgroundColor: colors.tooltipBg,