@ammarkhalidfarooq/dashboard-package 0.6.25 → 0.6.26

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.
package/dist/index.cjs.js CHANGED
@@ -5911,8 +5911,9 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
5911
5911
  var chargebackSeries = chartData.map(function (item) {
5912
5912
  return parseFloat((item.chargebackRate || 0).toFixed(2));
5913
5913
  });
5914
- var maxVal = Math.max.apply(Math, _toConsumableArray(chargebackSeries).concat(_toConsumableArray(refundSeries), [1]));
5915
- var yAxisMax = Math.ceil(maxVal * 1.2);
5914
+ var dataMax = Math.max.apply(Math, [0].concat(_toConsumableArray(chargebackSeries), _toConsumableArray(refundSeries)));
5915
+ var hasChartData = dataMax > 0;
5916
+ var yAxisMax = hasChartData ? Math.ceil(Math.max(dataMax, 1) * 1.2) : 0.5;
5916
5917
  var chartOptions = {
5917
5918
  chart: {
5918
5919
  type: "area",
@@ -5998,7 +5999,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
5998
5999
  legend: {
5999
6000
  show: false
6000
6001
  },
6001
- annotations: {
6002
+ annotations: hasChartData ? {
6002
6003
  yaxis: [{
6003
6004
  y: 1,
6004
6005
  borderColor: "#EF4444",
@@ -6016,7 +6017,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
6016
6017
  offsetX: 10
6017
6018
  }
6018
6019
  }]
6019
- },
6020
+ } : {},
6020
6021
  tooltip: {
6021
6022
  shared: true,
6022
6023
  y: {