mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
TimeSeries: Apply selected line style to custom pathBuilders (#75261)
This commit is contained in:
parent
e5fbc4a4cd
commit
c358135a63
@ -80,19 +80,19 @@ export class UPlotSeriesBuilder extends PlotConfigBuilder<SeriesProps, Series> {
|
|||||||
// GraphDrawStyle.Points mode also needs this for fill/stroke sharing & re-use in series.points. see getColor() below.
|
// GraphDrawStyle.Points mode also needs this for fill/stroke sharing & re-use in series.points. see getColor() below.
|
||||||
lineConfig.stroke = lineColor;
|
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) {
|
if (pathBuilder != null) {
|
||||||
lineConfig.paths = pathBuilder;
|
lineConfig.paths = pathBuilder;
|
||||||
lineConfig.width = lineWidth;
|
|
||||||
} else if (drawStyle === GraphDrawStyle.Points) {
|
} else if (drawStyle === GraphDrawStyle.Points) {
|
||||||
lineConfig.paths = () => null;
|
lineConfig.paths = () => null;
|
||||||
} else if (drawStyle != 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) => {
|
lineConfig.paths = (self: uPlot, seriesIdx: number, idx0: number, idx1: number) => {
|
||||||
let pathsBuilder = mapDrawStyleToPathBuilder(
|
let pathsBuilder = mapDrawStyleToPathBuilder(
|
||||||
drawStyle,
|
drawStyle,
|
||||||
|
Loading…
Reference in New Issue
Block a user