mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
Graph: Fixes stacking issues like floating bars when data is not aligned (#29051)
* Graph: Remove interpolation logic from graph stacking * Improving tooltip
This commit is contained in:
parent
01a4951da0
commit
dff451992d
public
@ -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
|
||||
|
4
public/vendor/flot/jquery.flot.stack.js
vendored
4
public/vendor/flot/jquery.flot.stack.js
vendored
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user