@ammarkhalidfarooq/dashboard-package 0.3.27 → 0.3.29

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
  },
@@ -4991,6 +4994,53 @@ var OverallSection = function OverallSection(_ref) {
4991
4994
  });
4992
4995
  }
4993
4996
  }
4997
+ if (activeMetric === "Total Donors") {
4998
+ var donorsData = apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors;
4999
+ var _hasStackedData2 = (donorsData === null || donorsData === void 0 ? void 0 : donorsData.paidAds) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.email) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.organic);
5000
+ if (_hasStackedData2) {
5001
+ var _categories2 = ((donorsData === null || donorsData === void 0 ? void 0 : donorsData.organic) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.paidAds) || (donorsData === null || donorsData === void 0 ? void 0 : donorsData.email) || []).map(function (item) {
5002
+ return item.date;
5003
+ });
5004
+ var _series2 = [{
5005
+ name: "Paid Ads",
5006
+ data: ((donorsData === null || donorsData === void 0 ? void 0 : donorsData.paidAds) || []).map(function (item) {
5007
+ return item.value;
5008
+ })
5009
+ }, {
5010
+ name: "Organic",
5011
+ data: ((donorsData === null || donorsData === void 0 ? void 0 : donorsData.organic) || []).map(function (item) {
5012
+ return item.value;
5013
+ })
5014
+ }, {
5015
+ name: "Email",
5016
+ data: ((donorsData === null || donorsData === void 0 ? void 0 : donorsData.email) || []).map(function (item) {
5017
+ return item.value;
5018
+ })
5019
+ }];
5020
+ mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
5021
+ label: "Donor trend",
5022
+ data: undefined,
5023
+ series: _series2,
5024
+ categories: _categories2,
5025
+ stacked: true,
5026
+ colors: ["#6366F1", "#10B981", "#06B6D4"],
5027
+ hideControls: true
5028
+ });
5029
+ } else if (Array.isArray(donorsData) && donorsData.length > 0) {
5030
+ mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
5031
+ label: "Donor trend",
5032
+ data: donorsData.map(function (item) {
5033
+ return item.value;
5034
+ }),
5035
+ categories: donorsData.map(function (item) {
5036
+ return item.date;
5037
+ }),
5038
+ series: undefined,
5039
+ stacked: false,
5040
+ hideControls: true
5041
+ });
5042
+ }
5043
+ }
4994
5044
  mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4995
5045
  label: mainChart.label || activeMetric,
4996
5046
  value: selectedInfo.value,