Commit dff45199 by Torkel Ödegaard Committed by GitHub

Graph: Fixes stacking issues like floating bars when data is not aligned (#29051)

* Graph: Remove interpolation logic from graph stacking

* Improving tooltip
parent 01a4951d
......@@ -102,17 +102,11 @@ export default function GraphTooltip(this: any, elem: any, dashboard: any, scope
minTime = pointTime;
}
if (series.stack) {
if (panel.tooltip.value_type === 'individual') {
value = series.data[hoverIndex][1];
} else if (!series.stack) {
value = series.data[hoverIndex][1];
} else {
lastValue += series.data[hoverIndex][1];
value = lastValue;
}
} else {
value = series.data[hoverIndex][1];
value = series.data[hoverIndex][1];
if (series.stack && value !== null && panel.tooltip.value_type !== 'individual') {
lastValue += value;
value = lastValue;
}
// Highlighting multiple Points depending on the plot type
......
......@@ -134,7 +134,7 @@ charts or filled areas).
// we got past point below, might need to
// insert interpolated extra point
if (i > 0 && points[i - ps] != null) {
intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px);
intery = 0;
newpoints.push(qx);
newpoints.push(intery + qy);
for (m = 2; m < ps; ++m)
......@@ -151,7 +151,7 @@ charts or filled areas).
// we might be able to interpolate a point below,
// this can give us a better y
if (j > 0 && otherpoints[j - otherps] != null)
bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx);
bottom = 0;
newpoints[l + accumulateOffset] += bottom;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment