From c358135a63eefc407f12295d012b8021aef00862 Mon Sep 17 00:00:00 2001 From: Leon Sorokin Date: Fri, 22 Sep 2023 04:32:32 -0500 Subject: [PATCH] TimeSeries: Apply selected line style to custom pathBuilders (#75261) --- .../uPlot/config/UPlotSeriesBuilder.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/grafana-ui/src/components/uPlot/config/UPlotSeriesBuilder.ts b/packages/grafana-ui/src/components/uPlot/config/UPlotSeriesBuilder.ts index 9fbe511517e..74b4140e23d 100644 --- a/packages/grafana-ui/src/components/uPlot/config/UPlotSeriesBuilder.ts +++ b/packages/grafana-ui/src/components/uPlot/config/UPlotSeriesBuilder.ts @@ -80,19 +80,19 @@ export class UPlotSeriesBuilder extends PlotConfigBuilder { // GraphDrawStyle.Points mode also needs this for fill/stroke sharing & re-use in series.points. see getColor() below. lineConfig.stroke = lineColor; + lineConfig.width = lineWidth; + if (lineStyle && lineStyle.fill !== 'solid') { + if (lineStyle.fill === 'dot') { + lineConfig.cap = 'round'; + } + lineConfig.dash = lineStyle.dash ?? [10, 10]; + } + if (pathBuilder != null) { lineConfig.paths = pathBuilder; - lineConfig.width = lineWidth; } else if (drawStyle === GraphDrawStyle.Points) { lineConfig.paths = () => null; } else if (drawStyle != null) { - lineConfig.width = lineWidth; - if (lineStyle && lineStyle.fill !== 'solid') { - if (lineStyle.fill === 'dot') { - lineConfig.cap = 'round'; - } - lineConfig.dash = lineStyle.dash ?? [10, 10]; - } lineConfig.paths = (self: uPlot, seriesIdx: number, idx0: number, idx1: number) => { let pathsBuilder = mapDrawStyleToPathBuilder( drawStyle,