@ammarkhalidfarooq/dashboard-package 0.3.26 → 0.3.28

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
@@ -282,7 +282,7 @@ var RevenueChart = function RevenueChart(_ref) {
282
282
  theme: 'light',
283
283
  y: {
284
284
  formatter: function formatter(value) {
285
- return metric === 'Revenue' ? "$".concat((value || 0).toLocaleString()) : value || 0;
285
+ return (metric === null || metric === void 0 ? void 0 : metric.toLowerCase()) === 'revenue' ? "$".concat((value || 0).toLocaleString()) : value || 0;
286
286
  }
287
287
  }
288
288
  }
@@ -346,8 +346,11 @@ var RevenueChart = function RevenueChart(_ref) {
346
346
  axisTicks: {
347
347
  show: false
348
348
  },
349
- tickAmount: 7,
349
+ tickAmount: 5,
350
350
  labels: {
351
+ rotate: 0,
352
+ rotateAlways: false,
353
+ hideOverlappingLabels: true,
351
354
  style: {
352
355
  colors: '#A1A1A8',
353
356
  fontSize: '12px'
@@ -371,7 +374,7 @@ var RevenueChart = function RevenueChart(_ref) {
371
374
  fontSize: '12px'
372
375
  },
373
376
  formatter: function formatter(value) {
374
- return metric === 'Revenue' ? "$".concat(value) : value || 0;
377
+ return (metric === null || metric === void 0 ? void 0 : metric.toLowerCase()) === 'revenue' ? "$".concat((value || 0).toLocaleString()) : value || 0;
375
378
  }
376
379
  }
377
380
  },
@@ -4948,7 +4951,37 @@ var OverallSection = function OverallSection(_ref) {
4948
4951
  }
4949
4952
  if (activeMetric === "Net Raised") {
4950
4953
  var netData = apiData === null || apiData === void 0 ? void 0 : apiData.netRaised;
4951
- if (Array.isArray(netData) && netData.length > 0) {
4954
+ var _hasStackedData = (netData === null || netData === void 0 ? void 0 : netData.paidAds) || (netData === null || netData === void 0 ? void 0 : netData.email) || (netData === null || netData === void 0 ? void 0 : netData.organic);
4955
+ if (_hasStackedData) {
4956
+ var _categories = ((netData === null || netData === void 0 ? void 0 : netData.organic) || (netData === null || netData === void 0 ? void 0 : netData.paidAds) || (netData === null || netData === void 0 ? void 0 : netData.email) || []).map(function (item) {
4957
+ return item.date;
4958
+ });
4959
+ var _series = [{
4960
+ name: "Paid Ads",
4961
+ data: ((netData === null || netData === void 0 ? void 0 : netData.paidAds) || []).map(function (item) {
4962
+ return item.value;
4963
+ })
4964
+ }, {
4965
+ name: "Organic",
4966
+ data: ((netData === null || netData === void 0 ? void 0 : netData.organic) || []).map(function (item) {
4967
+ return item.value;
4968
+ })
4969
+ }, {
4970
+ name: "Email",
4971
+ data: ((netData === null || netData === void 0 ? void 0 : netData.email) || []).map(function (item) {
4972
+ return item.value;
4973
+ })
4974
+ }];
4975
+ mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4976
+ label: "Net revenue trend",
4977
+ data: undefined,
4978
+ series: _series,
4979
+ categories: _categories,
4980
+ stacked: true,
4981
+ colors: ["#6366F1", "#10B981", "#06B6D4"],
4982
+ hideControls: true
4983
+ });
4984
+ } else if (Array.isArray(netData) && netData.length > 0) {
4952
4985
  mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4953
4986
  label: "Net revenue trend",
4954
4987
  data: netData.map(function (item) {
@@ -4958,7 +4991,6 @@ var OverallSection = function OverallSection(_ref) {
4958
4991
  return item.date;
4959
4992
  }),
4960
4993
  series: undefined,
4961
- // Ensure we use single data
4962
4994
  stacked: false,
4963
4995
  hideControls: true
4964
4996
  });