diff --git a/src/lib/series/rendering.ts b/src/lib/series/rendering.ts index 4832a8da8f..033368376b 100644 --- a/src/lib/series/rendering.ts +++ b/src/lib/series/rendering.ts @@ -165,9 +165,11 @@ export function renderBars( const barGeometries: BarGeometry[] = []; dataset.forEach((datum) => { const { y0, y1, initialY1 } = datum; + // don't create a bar if the initialY1 value is null. if (initialY1 === null) { return; } + // don't create a bar if the x value is not part of the ordinal scale if (xScaleType === ScaleType.Ordinal && !xDomain.includes(datum.x)) { return; } diff --git a/src/lib/series/series.ts b/src/lib/series/series.ts index 727b2a7614..06766def85 100644 --- a/src/lib/series/series.ts +++ b/src/lib/series/series.ts @@ -344,7 +344,7 @@ export function formatStackedDataSeriesValues( dataseries: RawDataSeries[], scaleToExtent: boolean, ): DataSeries[] { - const yValueStackMap: Map = getYValueStackMap(dataseries); + const yValueStackMap = getYValueStackMap(dataseries); const stackedValues = computeYStackedMapValues(yValueStackMap, scaleToExtent);