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