Skip to content

Commit

Permalink
Fix stacked areas overflow on null values when connectNulls is true
Browse files Browse the repository at this point in the history
  • Loading branch information
alxnddr committed Feb 8, 2024
1 parent 031a908 commit e4ed74c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/chart/line/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type Cartesian2D from '../../coord/cartesian/Cartesian2D';
import SeriesData from '../../data/SeriesData';
import Axis from '../../coord/Axis';
import type { LineSeriesOption } from './LineSeries';
import { SeriesModel } from '../../echarts';

interface CoordInfo {
dataDimsForPoint: string[]
Expand Down Expand Up @@ -121,7 +122,12 @@ export function getStackedOnPoint(
if (dataCoordInfo.stacked) {
value = data.get(data.getCalculationInfo('stackedOverDimension'), idx) as number;
}
if (isNaN(value)) {

const seriesModel = data.hostModel as SeriesModel;
const seriesValue = seriesModel.getRawValue(idx) as number;

// If there's a series value but no stacked value, start the area from the coordinate system start value
if (isNaN(value) && !isNaN(seriesValue)) {
value = dataCoordInfo.valueStart;
}

Expand Down

0 comments on commit e4ed74c

Please sign in to comment.