@eclipse-scout/chart 25.1.3 → 25.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3623,11 +3623,20 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
3623
3623
  ...options,
3624
3624
  space: null
3625
3625
  });
3626
+ if (yBoundary.maxValue === 0 && yBoundary.minValue === 0) {
3627
+ // Max and min value are both 0 if the values in the dataset are all 0.
3628
+ // The default behaviour would lead to a scale from 0 to 1 without any ticks between.
3629
+ // (The option "onlyIntegers" is true (zeros are integers), which prevents any ticks between 0 and 1).
3630
+ // With setting the max value to 5 we achieve a nice looking scale with some ticks with integer values between.
3631
+ yBoundary.maxValue = 5;
3632
+ }
3626
3633
  if (datasets.length && datasetsDiffType.length) {
3627
3634
  yBoundaryDiffType = this._computeMaxMinValue(config, datasetsDiffType, {
3628
3635
  ...options,
3629
3636
  space: null
3630
3637
  });
3638
+ // Note: we do not adjust the yBoundary of the different type in the case of max and min value are both 0,
3639
+ // because the secondary scale is never shown alone and therefore does not to have to look nicely.
3631
3640
  let yBoundaryRange = yBoundary.maxValue - yBoundary.minValue,
3632
3641
  yBoundaryRangeDiffType = yBoundaryDiffType.maxValue - yBoundaryDiffType.minValue;
3633
3642
  if (yBoundaryRange && yBoundaryRangeDiffType && (yBoundaryRange / yBoundaryRangeDiffType > 10 || yBoundaryRangeDiffType / yBoundaryRange > 10)) {