fix invalid cumulative path when no data available
This commit is contained in:
parent
572e2d10dc
commit
38838a6d0b
@ -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(
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user