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 Ödegaard 2020-12-15 21:50:40 +01:00 committed by GitHub
parent f3694935ed
commit 4e1cab1e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -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,
});

View File

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