diff --git a/ts/src/stats/histogram-graph.ts b/ts/src/stats/histogram-graph.ts index 628218441..86806df44 100644 --- a/ts/src/stats/histogram-graph.ts +++ b/ts/src/stats/histogram-graph.ts @@ -102,7 +102,7 @@ export function histogramGraph( const areaData = cumsum(areaCounts); const yAreaScale = y.copy().domain([0, data.total]); - if (data.showArea && data.bins.length) { + if (data.showArea && data.bins.length && areaData.slice(-1)[0]) { svg.select("path.area") .datum(areaData as any) .attr( diff --git a/ts/src/stats/reviews.ts b/ts/src/stats/reviews.ts index a725a9499..6ce9bc790 100644 --- a/ts/src/stats/reviews.ts +++ b/ts/src/stats/reviews.ts @@ -309,7 +309,7 @@ export function renderReviews( const areaData = cumsum(areaCounts); const yAreaScale = y.copy().domain([0, areaData.slice(-1)[0]]); - if (bins.length) { + if (areaData.slice(-1)[0]) { svg.select("path.area") .datum(areaData as any) .attr(