fix invalid cumulative path when no data available

This commit is contained in:
Damien Elmes 2020-07-01 13:32:01 +10:00
parent 572e2d10dc
commit 38838a6d0b
2 changed files with 2 additions and 2 deletions

View File

@ -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(

View File

@ -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(