@@ -2319,6 +2319,9 @@ export default {
23192319 this .scaleGroups [datapoint .scaleLabel ].autoScaleYLabels = autoScaleYLabels;
23202320 this .scaleGroups [datapoint .scaleLabel ].unique = this .activeSeriesWithStackRatios .filter (el => el .scaleLabel === datapoint .scaleLabel ).length === 1
23212321
2322+ const areaZeroPosition = this .mutableConfig .useIndividualScale ? datapoint .autoScaling ? autoScaleZeroPosition : zeroPosition : this .zero ;
2323+ const adustedAreaZeroPosition = Math .max (Math .max (datapoint .autoScaling ? autoScaleZeroPosition : scaleYLabels .at (- 1 ).y , this .drawingArea .top ), areaZeroPosition);
2324+
23222325 return {
23232326 ... datapoint,
23242327 yOffset,
@@ -2337,14 +2340,13 @@ export default {
23372340 ? this .createIndividualAreaWithCuts (datapoint .autoScaling
23382341 ? autoScalePlots
23392342 : plots,
2340- datapoint . autoScaling ? autoScaleZeroPosition : zeroPosition ,
2343+ adustedAreaZeroPosition ,
23412344 )
23422345 : this .createIndividualArea (datapoint .autoScaling
23432346 ? autoScalePlots .filter (p => p .value !== null )
23442347 : plots .filter (p => p .value !== null ),
2345- datapoint .autoScaling ? autoScaleZeroPosition : zeroPosition,)
2346- : this .createArea (plots .filter (p => p .value !== null ), yOffset),
2347-
2348+ adustedAreaZeroPosition)
2349+ : this .createIndividualArea (plots .filter (p => p .value !== null ), adustedAreaZeroPosition),
23482350 curveAreas: ! datapoint .useArea
23492351 ? []
23502352 : createSmoothAreaSegments (
@@ -2355,7 +2357,7 @@ export default {
23552357 : this .FINAL_CONFIG .line .cutNullValues
23562358 ? plots
23572359 : plots .filter (p => p .value !== null ),
2358- this . mutableConfig . useIndividualScale ? datapoint . autoScaling ? autoScaleZeroPosition : zeroPosition : this . zero ,
2360+ adustedAreaZeroPosition ,
23592361 this .FINAL_CONFIG .line .cutNullValues ),
23602362 straight: datapoint .autoScaling ? autoScaleStraight : straight,
23612363 groupId: this .scaleGroups [datapoint .scaleLabel ].groupId
@@ -3161,8 +3163,7 @@ export default {
31613163 }
31623164 }
31633165 },
3164- createArea (plots , yOffset ) {
3165- const zero = this .mutableConfig .isStacked ? this .drawingArea .bottom - yOffset : this .drawingArea .bottom ;
3166+ createArea (plots , zero ) {
31663167 if (! plots[0 ]) return [- 10 ,- 10 , ' ' , - 10 , - 10 ];
31673168 const start = { x: plots[0 ].x , y: zero };
31683169 const end = { x: plots .at (- 1 ).x , y: zero };
0 commit comments