@hestia-earth/ui-components 0.41.46 → 0.41.47

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.
@@ -14400,12 +14400,16 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
14400
14400
  }
14401
14401
  : { textFn: ({ data }) => `${valueRatio(data, total)}%` });
14402
14402
  }, ...(ngDevMode ? [{ debugName: "afterBarDrawSettings" }] : []));
14403
+ this.chartMin = computed(() => {
14404
+ const values = this.values().map(v => v.value);
14405
+ return values.some(v => v < 0) ? Math.min(...values) : 0;
14406
+ }, ...(ngDevMode ? [{ debugName: "chartMin" }] : []));
14403
14407
  this.configuration = computed(() => ({
14404
14408
  options: {
14405
14409
  scales: {
14406
14410
  x: {
14407
14411
  afterDataLimits: scale => increaseScaleLimits(scale),
14408
- min: Math.min(...this.values().map(v => v.value)),
14412
+ min: this.chartMin(),
14409
14413
  max: Math.max(...this.values().map(v => v.value))
14410
14414
  }
14411
14415
  }