mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Heatmap: honor dashboard timezone in x axis and fix tooltip time range (#56909)
This commit is contained in:
parent
7767002e12
commit
53ac77d4a5
@ -59,8 +59,16 @@ const HeatmapHoverCell = ({ data, hover, showHistogram }: Props) => {
|
|||||||
const yBucketMin = yDispSrc?.[yMinIdx];
|
const yBucketMin = yDispSrc?.[yMinIdx];
|
||||||
const yBucketMax = yDispSrc?.[yMaxIdx];
|
const yBucketMax = yDispSrc?.[yMaxIdx];
|
||||||
|
|
||||||
const xBucketMin = xVals?.[index];
|
let xBucketMin: number;
|
||||||
const xBucketMax = xBucketMin + data.xBucketSize;
|
let xBucketMax: number;
|
||||||
|
|
||||||
|
if (data.xLayout === HeatmapCellLayout.le) {
|
||||||
|
xBucketMax = xVals?.[index];
|
||||||
|
xBucketMin = xBucketMax - data.xBucketSize!;
|
||||||
|
} else {
|
||||||
|
xBucketMin = xVals?.[index];
|
||||||
|
xBucketMax = xBucketMin + data.xBucketSize!;
|
||||||
|
}
|
||||||
|
|
||||||
const count = countVals?.[index];
|
const count = countVals?.[index];
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ export const HeatmapPanel: React.FC<HeatmapPanelProps> = ({
|
|||||||
ySizeDivisor: scaleConfig?.type === ScaleDistribution.Log ? +(options.calculation?.yBuckets?.value || 1) : 1,
|
ySizeDivisor: scaleConfig?.type === ScaleDistribution.Log ? +(options.calculation?.yBuckets?.value || 1) : 1,
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [options, data.structureRev]);
|
}, [options, timeZone, data.structureRev]);
|
||||||
|
|
||||||
const renderLegend = () => {
|
const renderLegend = () => {
|
||||||
if (!info.heatmap || !options.legend.show) {
|
if (!info.heatmap || !options.legend.show) {
|
||||||
|
@ -250,6 +250,7 @@ export function prepConfig(opts: PrepConfigOpts) {
|
|||||||
placement: AxisPlacement.Bottom,
|
placement: AxisPlacement.Bottom,
|
||||||
isTime: true,
|
isTime: true,
|
||||||
theme: theme,
|
theme: theme,
|
||||||
|
timeZone,
|
||||||
});
|
});
|
||||||
|
|
||||||
const yField = dataRef.current?.heatmap?.fields[1]!;
|
const yField = dataRef.current?.heatmap?.fields[1]!;
|
||||||
|
Loading…
Reference in New Issue
Block a user