mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Visualizations: Hue gradient mode now applies to the line color (#80805)
This commit is contained in:
parent
f97cea5522
commit
2cdf73f584
@ -172,6 +172,10 @@ export class UPlotSeriesBuilder extends PlotConfigBuilder<SeriesProps, Series> {
|
||||
return getScaleGradientFn(1, theme, colorMode, thresholds, hardMin, hardMax, softMin, softMax);
|
||||
}
|
||||
|
||||
if (gradientMode === GraphGradientMode.Hue) {
|
||||
return getHueGradientFn(lineColor ?? FALLBACK_COLOR, 1, theme);
|
||||
}
|
||||
|
||||
return lineColor ?? FALLBACK_COLOR;
|
||||
}
|
||||
|
||||
|
@ -68,8 +68,8 @@ export function getHueGradientFn(
|
||||
ctx
|
||||
);
|
||||
|
||||
const color1 = tinycolor(color).spin(-15);
|
||||
const color2 = tinycolor(color).spin(15);
|
||||
const color1 = tinycolor(color).spin(-25).darken(5);
|
||||
const color2 = tinycolor(color).saturate(20).spin(20).brighten(10);
|
||||
|
||||
if (theme.isDark) {
|
||||
gradient.addColorStop(0, color2.lighten(10).setAlpha(opacity).toString());
|
||||
|
@ -156,17 +156,17 @@ exports[`GraphNG utils preparePlotConfigBuilder 1`] = `
|
||||
"fill": [Function],
|
||||
"paths": [Function],
|
||||
"points": {
|
||||
"fill": "#ff0000",
|
||||
"fill": [Function],
|
||||
"filter": [Function],
|
||||
"show": true,
|
||||
"size": undefined,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/number",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
"value": [Function],
|
||||
"width": 2,
|
||||
},
|
||||
@ -202,17 +202,17 @@ exports[`GraphNG utils preparePlotConfigBuilder 1`] = `
|
||||
"fill": [Function],
|
||||
"paths": [Function],
|
||||
"points": {
|
||||
"fill": "#ff0000",
|
||||
"fill": [Function],
|
||||
"filter": [Function],
|
||||
"show": true,
|
||||
"size": undefined,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/number",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
"value": [Function],
|
||||
"width": 2,
|
||||
},
|
||||
@ -225,17 +225,17 @@ exports[`GraphNG utils preparePlotConfigBuilder 1`] = `
|
||||
"fill": [Function],
|
||||
"paths": [Function],
|
||||
"points": {
|
||||
"fill": "#ff0000",
|
||||
"fill": [Function],
|
||||
"filter": [Function],
|
||||
"show": true,
|
||||
"size": undefined,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/number",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
"value": [Function],
|
||||
"width": 2,
|
||||
},
|
||||
|
@ -156,17 +156,17 @@ exports[`GraphNG utils preparePlotConfigBuilder 1`] = `
|
||||
"fill": [Function],
|
||||
"paths": [Function],
|
||||
"points": {
|
||||
"fill": "#ff0000",
|
||||
"fill": [Function],
|
||||
"filter": [Function],
|
||||
"show": true,
|
||||
"size": undefined,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/number",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
"value": [Function],
|
||||
"width": 2,
|
||||
},
|
||||
@ -202,17 +202,17 @@ exports[`GraphNG utils preparePlotConfigBuilder 1`] = `
|
||||
"fill": [Function],
|
||||
"paths": [Function],
|
||||
"points": {
|
||||
"fill": "#ff0000",
|
||||
"fill": [Function],
|
||||
"filter": [Function],
|
||||
"show": true,
|
||||
"size": undefined,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/number",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
"value": [Function],
|
||||
"width": 2,
|
||||
},
|
||||
@ -225,17 +225,17 @@ exports[`GraphNG utils preparePlotConfigBuilder 1`] = `
|
||||
"fill": [Function],
|
||||
"paths": [Function],
|
||||
"points": {
|
||||
"fill": "#ff0000",
|
||||
"fill": [Function],
|
||||
"filter": [Function],
|
||||
"show": true,
|
||||
"size": undefined,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/number",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
"stroke": [Function],
|
||||
"value": [Function],
|
||||
"width": 2,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user