@ammarkhalidfarooq/dashboard-package 0.6.25 → 0.6.27

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: {
@@ -17072,7 +17073,7 @@ var OverallSection = function OverallSection(_ref) {
17072
17073
  spacing: 3,
17073
17074
  sx: {
17074
17075
  mb: 0,
17075
- mt: "6px"
17076
+ mt: "12px"
17076
17077
  },
17077
17078
  children: /*#__PURE__*/jsxRuntime.jsx(RenderChartCard, {
17078
17079
  item: mainChart,
@@ -17748,7 +17749,7 @@ var OrganicSection = function OrganicSection(_ref) {
17748
17749
  container: true,
17749
17750
  spacing: 3,
17750
17751
  sx: {
17751
- mt: "6px"
17752
+ mt: "12px"
17752
17753
  },
17753
17754
  children: [/*#__PURE__*/jsxRuntime.jsx(RenderChartCard, {
17754
17755
  item: mainChart,