GraphNG: Do not set fillColor from GraphNG only opacity (#29851)

* GraphNG: Do not set fillColor from GraphNG only opacity

* use color settings if they exist

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Torkel ÖdegaardandRyan McKinley authored and GitHub committed 2020-12-15 21:50:40 +01:00
1 parent f3694935ed
commit 4e1cab1e69
2 files changed
+7 -6

No files matched your search

@@ -157,14 +157,13 @@ export const GraphNG: React.FC<GraphNGProps> = ({
builder.addSeries({
scaleKey,
drawStyle: customConfig.drawStyle!,
lineColor: seriesColor,
lineColor: customConfig.lineColor ?? seriesColor,
lineWidth: customConfig.lineWidth,
lineInterpolation: customConfig.lineInterpolation,
showPoints,
pointSize: customConfig.pointSize,
pointColor: seriesColor,
pointColor: customConfig.pointColor ?? seriesColor,
fillOpacity: customConfig.fillOpacity,
fillColor: seriesColor,
spanNulls: customConfig.spanNulls || false,
});
@@ -81,9 +81,11 @@ export class UPlotSeriesBuilder extends PlotConfigBuilder<SeriesProps, Series> {
}
if (fillOpacityNumber !== 0) {
fillConfig.fill = tinycolor(fillColor ?? lineColor)
.setAlpha(fillOpacityNumber / 100)
.toRgbString();
fillConfig = {
fill: tinycolor(fillColor ?? lineColor)
.setAlpha(fillOpacityNumber / 100)
.toRgbString(),
};
}
return {