@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.
@@ -3627,11 +3627,20 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
3627
3627
  ...options,
3628
3628
  space: null
3629
3629
  });
3630
+ if (yBoundary.maxValue === 0 && yBoundary.minValue === 0) {
3631
+ // Max and min value are both 0 if the values in the dataset are all 0.
3632
+ // The default behaviour would lead to a scale from 0 to 1 without any ticks between.
3633
+ // (The option "onlyIntegers" is true (zeros are integers), which prevents any ticks between 0 and 1).
3634
+ // With setting the max value to 5 we achieve a nice looking scale with some ticks with integer values between.
3635
+ yBoundary.maxValue = 5;
3636
+ }
3630
3637
  if (datasets.length && datasetsDiffType.length) {
3631
3638
  yBoundaryDiffType = this._computeMaxMinValue(config, datasetsDiffType, {
3632
3639
  ...options,
3633
3640
  space: null
3634
3641
  });
3642
+ // Note: we do not adjust the yBoundary of the different type in the case of max and min value are both 0,
3643
+ // because the secondary scale is never shown alone and therefore does not to have to look nicely.
3635
3644
  let yBoundaryRange = yBoundary.maxValue - yBoundary.minValue,
3636
3645
  yBoundaryRangeDiffType = yBoundaryDiffType.maxValue - yBoundaryDiffType.minValue;
3637
3646
  if (yBoundaryRange && yBoundaryRangeDiffType && (yBoundaryRange / yBoundaryRangeDiffType > 10 || yBoundaryRangeDiffType / yBoundaryRange > 10)) {