@ammarkhalidfarooq/dashboard-package 0.3.20 → 0.3.22
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 +37 -27
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +37 -27
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -4856,39 +4856,49 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
4856
4856
|
var mainChart = extendedCharts.find(function (c) {
|
|
4857
4857
|
return c.label === selectedInfo.label;
|
|
4858
4858
|
}) || primaryCharts[0];
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
return item.
|
|
4867
|
-
})
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4859
|
+
console.log("OverallSection - activeMetric:", activeMetric);
|
|
4860
|
+
console.log("OverallSection - apiData keys:", Object.keys(apiData || {}));
|
|
4861
|
+
if (activeMetric === "Total Raised") {
|
|
4862
|
+
var hasStackedData = (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || (apiData === null || apiData === void 0 ? void 0 : apiData.organic);
|
|
4863
|
+
console.log("OverallSection - hasStackedData:", !!hasStackedData);
|
|
4864
|
+
if (hasStackedData) {
|
|
4865
|
+
var categories = ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
|
|
4866
|
+
return item.date;
|
|
4867
|
+
});
|
|
4868
|
+
var series = [{
|
|
4869
|
+
name: "Paid Ads",
|
|
4870
|
+
data: ((apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || []).map(function (item) {
|
|
4871
|
+
return item.value;
|
|
4872
|
+
})
|
|
4873
|
+
}, {
|
|
4874
|
+
name: "Organic",
|
|
4875
|
+
data: ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || []).map(function (item) {
|
|
4876
|
+
return item.value;
|
|
4877
|
+
})
|
|
4878
|
+
}, {
|
|
4879
|
+
name: "Email",
|
|
4880
|
+
data: ((apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
|
|
4881
|
+
return item.value;
|
|
4882
|
+
})
|
|
4883
|
+
}];
|
|
4884
|
+
console.log("OverallSection - transformed series:", series);
|
|
4885
|
+
mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
|
|
4886
|
+
label: "Total revenue trend",
|
|
4887
|
+
data: undefined,
|
|
4888
|
+
// Clear single data property to force series usage
|
|
4889
|
+
series: series,
|
|
4890
|
+
categories: categories,
|
|
4891
|
+
stacked: true,
|
|
4892
|
+
colors: ["#6366F1", "#10B981", "#06B6D4"]
|
|
4893
|
+
});
|
|
4894
|
+
}
|
|
4886
4895
|
}
|
|
4887
4896
|
mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
|
|
4888
4897
|
label: mainChart.label || activeMetric,
|
|
4889
4898
|
value: selectedInfo.value,
|
|
4890
4899
|
trend: selectedInfo.subValue
|
|
4891
4900
|
});
|
|
4901
|
+
console.log("OverallSection - Final mainChart:", mainChart);
|
|
4892
4902
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4893
4903
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
4894
4904
|
sx: {
|