Sparkline: Fixes issue with sparkline that sent in custom fillColor instead of fillOpacity (#29825)

* Sparkline: Fixes issue with sparkline that sent in custom fillColor instead of fillOpacity

* Updated
This commit is contained in:
Torkel Ödegaard
2020-12-15 09:56:09 +01:00
committed by GitHub
parent c2cad26ca9
commit b8025c7702
@@ -73,14 +73,19 @@ export class UPlotSeriesBuilder extends PlotConfigBuilder<SeriesProps, Series> {
let fillConfig: any | undefined;
let fillOpacityNumber = fillOpacity ?? 0;
if (fillColor && fillOpacityNumber !== 0) {
if (fillColor) {
fillConfig = {
fill: tinycolor(fillColor)
.setAlpha(fillOpacityNumber / 100)
.toRgbString(),
fill: fillColor,
};
}
if (fillOpacityNumber !== 0) {
fillConfig.fill = tinycolor(fillColor ?? lineColor)
.setAlpha(fillOpacityNumber / 100)
.toRgbString();
}
return {
scale: scaleKey,
spanGaps: spanNulls,