3
0
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 ()

* Graph: Remove interpolation logic from graph stacking

* Improving tooltip
This commit is contained in:
Torkel Ödegaard 2020-11-13 10:32:08 +01:00 committed by GitHub
parent 01a4951da0
commit dff451992d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 13 deletions
public
app/plugins/panel/graph
vendor/flot

View File

@ -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

View File

@ -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;