TimeSeries: Apply selected line style to custom pathBuilders (#75261)

This commit is contained in:
Leon Sorokin 2023-09-22 04:32:32 -05:00 committed by GitHub
parent e5fbc4a4cd
commit c358135a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.
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,