diff --git a/src/screens/MainScreen/Dashboard/Details.js b/src/screens/MainScreen/Dashboard/Details.js index eee366d..9cd6cfd 100644 --- a/src/screens/MainScreen/Dashboard/Details.js +++ b/src/screens/MainScreen/Dashboard/Details.js @@ -99,7 +99,7 @@ const Details = () => { - {selectedDetails.map((detail, index) => { + {selectedDetails && selectedDetails.length > 0 ? selectedDetails.map((detail, index) => { const values = modalGraphData[detail.GraphUrl] || []; if (!modalGraphData[detail.GraphUrl]) { @@ -321,7 +321,9 @@ const Details = () => { ); } - })} + }) : + + } { let user_exist_data = useSelector(state => state?.user); const userId = user_exist_data.UserId || ''; + const onClickLogout = () => { setLogoutModal(false); Alert.alert( @@ -373,6 +370,7 @@ const Dashboard = (props) => { } dataMap[url] = responseData; }); + setGraphApiData(dataMap); setTabCache(prev => ({ ...prev, [tabKey]: dataMap })); @@ -400,28 +398,6 @@ const Dashboard = (props) => { return null; // all attempts failed }; - const fetchDetailGraphs = async (detailPages) => { - try { - const resultMap = {}; - - for (let item of detailPages) { - const response = await post(item.GraphUrl, { - parameters: { - projectid: 41654, - year: year, - monthno: month, - storeid: storeData?.StoreId - }, - }); - console.log(`Data for ${item.GraphTitle}:`, response?.data); // Add this - resultMap[item.GraphUrl] = response?.data || []; - } - setModalGraphData(resultMap); - } catch (error) { - console.log("❌ Error fetching detail graphs:", error); - } - }; - const handleScroll = (event) => { const offsetY = event.nativeEvent.contentOffset.y; setShowButton(offsetY > 0); // Show button only if not at the top @@ -525,11 +501,15 @@ const Dashboard = (props) => { }; const renderItem = ({ item }) => { - const apiData = graphApiData[item.GraphUrl]; - // const values = apiData?.data || []; - const values = apiData?.data?.length ? apiData.data : []; - const scoreValue = values.length > 0 ? Object.values(values[0])[0] : null; + // console.log('graphApiData--->', JSON.stringify(graphApiData)); + const apiData = graphApiData[item.GraphUrl]; + // console.log('apiData--->', JSON.stringify(apiData)); + + const values = apiData?.data?.length ? apiData.data : []; + // console.log('values--->', JSON.stringify(values)); + + // const scoreValue = values.length > 0 ? Object.values(values[0])[0] : null; // {scoreValue !== undefined ? `${scoreValue.toFixed(1)}%` : "No Data"} if (apiData?.status === 'error') { @@ -556,43 +536,120 @@ const Dashboard = (props) => { ); //GIFTED CHART LIBRARY ----- + + // case "BarGraph": + // const chartWidth = screenWidth * 0.80; + // const barWidth = 40; + // const barColors = ['#1BF2E0', '#1B7BF2', '#1BC0F2']; + // console.log('BarGraph-valuesvalues=> ', values); + // const barData = values.map((v, idx) => { + // const value = parseFloat(Object.values(v).find(val => typeof val === 'number').toFixed(1)); + // return { + // value, + // label: v.CalendarYear_Month, + // frontColor: barColors[idx % barColors.length], + // topLabelComponent: () => ( + // {value}% + // ) + // }; + // }); + + // const visibleBars = barData.length; + // const totalSpacing = chartWidth - visibleBars * barWidth; + // const spacing = totalSpacing / (visibleBars + 1); + + // if (!values || values == '' || values == undefined || values == null) { + // return null; + // } + + // return ( + // + // {/* */} + // + // {item.GraphTitle} + // + + // + // {/* */} + // + // + // ); + case "BarGraph": const chartWidth = screenWidth * 0.80; const barWidth = 40; const barColors = ['#1BF2E0', '#1B7BF2', '#1BC0F2']; + // Sample API response (you’ll replace this with real API data) + let values2 = [ + { "Month_Id": 91, "CalendarYear_Month": "Jul-25", "Share_of_Shelf_Perc": 40.44959 }, + { "Month_Id": 92, "CalendarYear_Month": "Aug-25", "Share_of_Shelf_Perc": 44.60024 }, + { "Month_Id": 90, "CalendarYear_Month": "Jun-25", "Share_of_Shelf_Perc": 47.94166 }, + ]; + // console.log('BarGraph-values2values2=> ', JSON.stringify(values2)); + console.log('BarGraph-values=> ', JSON.stringify(values)); + + if (!values2 || values2 == '' || values2 == undefined || values2 == null) { + return null; + } + + // ✅ Step 1: Sort by Month_Id + const sortedValues = values2.sort((a, b) => a.CalendarMonth_ID - b.Month_Id); + + // console.log('sortedValues====>',JSON.stringify(sortedValues)); + + + // ✅ Step 2: Prepare chart data const barData = values.map((v, idx) => { - const value = parseFloat(Object.values(v).find(val => typeof val === 'number').toFixed(1)); - - // console.log('valuevaluevalue--->', value); + // Find the first numeric field dynamically (excluding Month_Id) + const numericKey = Object.keys(v).find( + key => key !== "CalendarMonth_ID" && key !== "CalendarYear_Month" && typeof v[key] === "number" + ); + const value = numericKey ? parseFloat(v[numericKey].toFixed(1)) : 0; return { value, label: v.CalendarYear_Month, frontColor: barColors[idx % barColors.length], topLabelComponent: () => ( - {value}% + + {value}% + ) }; - }); const visibleBars = barData.length; const totalSpacing = chartWidth - visibleBars * barWidth; const spacing = totalSpacing / (visibleBars + 1); - if (!values || values == '' || values == undefined || values == null) { - return null; - } - return ( - - {/* */} - - {item.GraphTitle} - - + + {item.GraphTitle} { roundedTop={false} disableScroll={true} yAxisLabelTexts={['0%', '20%', '40%', '60%', '80%', '100%']} - // yAxisLabelTexts={['0%', '👉', '👉', '👉', '👉', '100%']} // 👈 only 0% and 100% yAxisTextStyle={{ color: '#000', fontSize: 12 }} - xAxisLabelTextStyle={{ color: '#000', fontSize: 12, fontWeight: '500', marginTop: 5 }} + xAxisLabelTextStyle={{ color: '#000', fontSize: 12, fontWeight: '500', }} isAnimated width={chartWidth} - hideYAxisText={true} //to hide y axis text - // hideRules={true} + hideYAxisText={true} hideYAxisLine={true} yAxisThickness={0} xAxisThickness={0} rulesLength={chartWidth} - // xAxisLength={chartWidth} hideAxesAndRules={false} - // xAxisLabelTextStyle={{ color: '#000', fontSize: 10, marginTop: 4 }} /> - {/* */} - + ); @@ -712,9 +764,6 @@ const Dashboard = (props) => { ); }); - // console.log('mainTabIndex----->',mainTabIndex); - - return ( diff --git a/src/screens/MainScreen/Dashboard/mainDisplay copy.json b/src/screens/MainScreen/Dashboard/mainDisplay copy.json new file mode 100644 index 0000000..e283ab2 --- /dev/null +++ b/src/screens/MainScreen/Dashboard/mainDisplay copy.json @@ -0,0 +1,631 @@ +{ + "Tabs": [ + { + "MainTabId": 1, + "MainTabName": "MTD", + "MainTabData": { + "subTabs": [ + { + "TabId": 1, + "TabName": "PSS Score", + "TabRow": 1, + "TabCol": 1 + }, + { + "TabId": 2, + "TabName": "PSS Trend", + "TabRow": 1, + "TabCol": 2 + }, + { + "TabId": 3, + "TabName": "SOS Actual", + "TabRow": 1, + "TabCol": 2 + }, + { + "TabId": 4, + "TabName": "OSA", + "TabRow": 1, + "TabCol": 4 + }, + { + "TabId": 5, + "TabName": "Asset", + "TabRow": 1, + "TabCol": 5 + }, + { + "TabId": 6, + "TabName": "Promotion", + "TabRow": 1, + "TabCol": 6 + } + ], + + + + "graphDetails": [ + { + "TabId": 1, + "GraphId": 1, + "GraphType": "ScoreCard", + "GraphTitle": "PSS Score", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/pssscore", + "GraphBackground": "#C3D7FF", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 2, + "GraphType": "ScoreCard", + "GraphTitle": "SOS Actual", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/SOS_Actual_Perc", + "GraphBackground": "#E2C8FE", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 4, + "GraphType": "ScoreCard", + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/OSA_Perc", + "GraphBackground": "#FFF9A1", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 5, + "GraphType": "ScoreCard", + "GraphTitle": "Asset", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/Asset_Perc", + "GraphBackground": "#A2F3DE", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 6, + "GraphType": "ScoreCard", + "GraphTitle": "Promotion", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/Promotion_Perc", + "GraphBackground": "#BFC2FF", + "GraphOptions": {} + }, + + + + + + + { + "TabId": 2, + "GraphId": 1, + "GraphType": "ScoreCard", + "GraphTitle": "PSS Score", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/SOS_Actual_Perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 0, + "DetailsPage": [ + { + "TabId": 2, + "GraphId": 1, + "GraphType": "Table", + "GraphTitle": "PSS - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/sos_actual_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 2, + "GraphId": 2, + "GraphType": "BarGraph", + "GraphTitle": "PSS Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/sos_actual_trend_perc_mtd", + "GraphBackground": "#F4EAFF", + "GraphOptions": { + "axisX": "month", + "axisY": "score", + "labelShow": 1, + "barColors": [ + "#11a4ff", + "#0ea3e3", + "#0b9ddb" + ], + "gridLinesH": 0, + "gridLinesV": 0 + } + }, + + + + + + { + "TabId": 3, + "GraphId": 3, + "GraphType": "ScoreCard", + "GraphTitle": "SOS Actual", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/SOS_Actual_Perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 2, + "GraphId": 1, + "GraphType": "Table", + "GraphTitle": "SOS - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/sos_actual_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 3, + "GraphId": 4, + "GraphType": "BarGraph", + "GraphTitle": "SOS Actual Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/sos_actual_trend_perc_mtd", + "GraphBackground": "#F4EAFF", + "GraphOptions": { + "axisX": "month", + "axisY": "score", + "labelShow": 1, + "barColors": [ + "#11a4ff", + "#0ea3e3", + "#0b9ddb" + ], + "gridLinesH": 0, + "gridLinesV": 0 + } + }, + + + + + + { + "TabId": 4, + "GraphId": 5, + "GraphType": "ScoreCard", + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/OSA_Perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 3, + "GraphId": 3, + "GraphType": "Table", + "GraphTitle": "OSA - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/osa_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 4, + "GraphId": 6, + "GraphType": "BarGraph", + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/osa_trend_perc_mtd", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + + + + + { + "TabId": 5, + "GraphId": 7, + "GraphType": "ScoreCard", + "GraphTitle": "Asset", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/Asset_Perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 5, + "GraphId": 5, + "GraphType": "Table", + "GraphTitle": "Visibility", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/asset_availability_mtd", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + { + "TabId": 5, + "GraphId": 5, + "GraphType": "Table", + "GraphTitle": "Additional Visibility", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/additional_visibility_mtd", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 5, + "GraphId": 8, + "GraphType": "BarGraph", + "GraphTitle": "Asset Details", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/asset_trend_perc_mtd", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + + { + "TabId": 6, + "GraphId": 9, + "GraphType": "ScoreCard", + "GraphTitle": "Promotion", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/Promotion_Perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 6, + "GraphId": 9, + "GraphType": "Table", + "GraphTitle": "Promotion Not Executed", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/promotion_not_executed_mtd", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + { + "TabId": 6, + "GraphId": 10, + "GraphType": "Table", + "GraphTitle": "Promotion executed", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/promotion_executed_mtd", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + + ] + }, + { + "TabId": 6, + "GraphId": 11, + "GraphType": "BarGraph", + "GraphTitle": "Promotion", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/promotion_trend_perc_mtd", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + } + }, + + + + + + + + + + + + + + + + + { + "MainTabId": 2, + "MainTabName": "Last Visit", + "MainTabData": { + "subTabs": [ + { + "TabId": 1, + "TabName": "PSS Score", + "TabRow": 1, + "TabCol": 1 + }, + { + "TabId": 2, + "TabName": "SOS Actual", + "TabRow": 1, + "TabCol": 2 + }, + { + "TabId": 4, + "TabName": "OSA", + "TabRow": 1, + "TabCol": 4 + }, + { + "TabId": 5, + "TabName": "Asset", + "TabRow": 1, + "TabCol": 5 + }, + { + "TabId": 6, + "TabName": "Promotion", + "TabRow": 1, + "TabCol": 6 + } + ], + "graphDetails": [ + { + "TabId": 1, + "GraphId": 1, + "GraphType": "ScoreCard", + "GraphTitle": "PSS Score", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/PSS_Score_LSV_Perc", + "GraphBackground": "#E2C8FE", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 2, + "GraphType": "ScoreCard", + "GraphTitle": "SOS Actual", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/sos_actual_lsv_perc", + "GraphBackground": "#E2C8FE", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 4, + "GraphType": "ScoreCard", + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/osa_lsv_perc", + "GraphBackground": "#FFF9A1", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 5, + "GraphType": "ScoreCard", + "GraphTitle": "Asset", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/asset_lsv_perc", + "GraphBackground": "#A2F3DE", + "GraphOptions": {} + }, + { + "TabId": 1, + "GraphId": 6, + "GraphType": "ScoreCard", + "GraphTitle": "Promotion", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/promotion_lsv_perc", + "GraphBackground": "#BFC2FF", + "GraphOptions": {} + }, + + + + + + { + "TabId": 2, + "GraphId": 1, + "GraphType": "ScoreCard", + "GraphTitle": "PSS Score", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/SOS_Actual_Perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 0, + "DetailsPage": [ + { + "TabId": 2, + "GraphId": 1, + "GraphType": "Table", + "GraphTitle": "PSS - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/sos_actual_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + + { + "TabId": 2, + "GraphId": 2, + "GraphType": "BarGraph", + "GraphTitle": "PSS Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/sos_actual_trend_perc_mtd", + "GraphBackground": "#F4EAFF", + "GraphOptions": { + "axisX": "month", + "axisY": "score", + "labelShow": 1, + "barColors": [ + "#11a4ff", + "#0ea3e3", + "#0b9ddb" + ], + "gridLinesH": 0, + "gridLinesV": 0 + } + }, + + + + + + + { + "TabId": 3, + "GraphId": 3, + "GraphType": "ScoreCard", + "GraphTitle": "SOS Actual", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/sos_actual_lsv_perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 2, + "GraphId": 1, + "GraphType": "Table", + "GraphTitle": "SOS Actual - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detlsv/sos_actual_lsv_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 3, + "GraphId": 4, + "GraphType": "BarGraph", + "GraphTitle": "SOS Actual Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/sos_actual_trend_lsv_perc", + "GraphBackground": "#F4EAFF", + "GraphOptions": { + "axisX": "month", + "axisY": "score", + "labelShow": 1, + "barColors": [ + "#11a4ff", + "#0ea3e3", + "#0b9ddb" + ], + "gridLinesH": 1, + "gridLinesV": 1 + } + }, + + + + + + { + "TabId": 4, + "GraphId": 5, + "GraphType": "ScoreCard", + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/osa_lsv_perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 4, + "GraphId": 7, + "GraphType": "Table", + "GraphTitle": "OSA - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detlsv/osa_lsv_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 4, + "GraphId": 6, + "GraphType": "BarGraph", + "GraphTitle": "OSA Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/osa_trend_lsv_perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + + { + "TabId": 5, + "GraphId": 7, + "GraphType": "ScoreCard", + "GraphTitle": "Asset", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/asset_lsv_perc", + "GraphBa ckground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 5, + "GraphId": 5, + "GraphType": "Table", + "GraphTitle": "Visibility", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/asset_availability_lsv", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + { + "TabId": 5, + "GraphId": 5, + "GraphType": "Table", + "GraphTitle": "Additional Visibility", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/additional_visibility_lsv", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 5, + "GraphId": 8, + "GraphType": "BarGraph", + "GraphTitle": "Asset Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/asset_trend_lsv_perc", + "GraphBackground": "#fff", + "GraphOptions": { + "axisX": "month", + "axisY": "score", + "labelShow": 1, + "barColors": [ + "#11a4ff", + "#0ea3e3", + "#0b9ddb" + ], + "gridLinesH": 1, + "gridLinesV": 1 + } + }, + + { + "TabId": 6, + "GraphId": 9, + "GraphType": "ScoreCard", + "GraphTitle": "Promotion", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/promotion_lsv_perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 1, + "DetailsPage": [ + { + "TabId": 6, + "GraphId": 9, + "GraphType": "Table", + "GraphTitle": "Promotion Not Executed", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detlsv/promotion_not_executed_lsv", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + { + "TabId": 6, + "GraphId": 10, + "GraphType": "Table", + "GraphTitle": "Promotion executed", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detlsv/promotion_executed_lsv", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 6, + "GraphId": 11, + "GraphType": "BarGraph", + "GraphTitle": "Promotion", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/promotion_trend_lsv_perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/screens/MainScreen/Dashboard/mainDisplay.json b/src/screens/MainScreen/Dashboard/mainDisplay.json index 61c4b32..abbad9f 100644 --- a/src/screens/MainScreen/Dashboard/mainDisplay.json +++ b/src/screens/MainScreen/Dashboard/mainDisplay.json @@ -13,6 +13,12 @@ }, { "TabId": 2, + "TabName": "PSS Trend", + "TabRow": 1, + "TabCol": 2 + }, + { + "TabId": 3, "TabName": "SOS Actual", "TabRow": 1, "TabCol": 2 @@ -85,10 +91,62 @@ "GraphBackground": "#BFC2FF", "GraphOptions": {} }, + + + + + + { "TabId": 2, "GraphId": 1, "GraphType": "ScoreCard", + "GraphTitle": "PSS Score", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/pssscore", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 0, + "DetailsPage": [ + { + "TabId": 2, + "GraphId": 1, + "GraphType": "Table", + "GraphTitle": "PSS - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/sos_actual_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + { + "TabId": 2, + "GraphId": 2, + "GraphType": "BarGraph", + "GraphTitle": "PSS Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/pss_trend_perc_mtd_O", + "GraphBackground": "#F4EAFF", + "GraphOptions": { + "axisX": "month", + "axisY": "score", + "labelShow": 1, + "barColors": [ + "#11a4ff", + "#0ea3e3", + "#0b9ddb" + ], + "gridLinesH": 0, + "gridLinesV": 0 + } + }, + + + + + + { + "TabId": 3, + "GraphId": 3, + "GraphType": "ScoreCard", "GraphTitle": "SOS Actual", "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/SOS_Actual_Perc", "GraphBackground": "#ECFFFA", @@ -107,11 +165,11 @@ ] }, { - "TabId": 2, - "GraphId": 2, + "TabId": 3, + "GraphId": 4, "GraphType": "BarGraph", "GraphTitle": "SOS Actual Trend", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/sos_actual_trend_perc_mtd", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/sos_actual_trend_perc_mtd_O", "GraphBackground": "#F4EAFF", "GraphOptions": { "axisX": "month", @@ -126,12 +184,17 @@ "gridLinesV": 0 } }, - { - "TabId": 3, - "GraphId": 3, + + + + + + { + "TabId": 4, + "GraphId": 5, "GraphType": "ScoreCard", - "GraphTitle": "SOS Compliance", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/SOS_Compliance_Perc", + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/OSA_Perc", "GraphBackground": "#ECFFFA", "GraphOptions": {}, "clickable": 1, @@ -140,36 +203,29 @@ "TabId": 3, "GraphId": 3, "GraphType": "Table", - "GraphTitle": "SOS Compliance - Category", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/sos_sompliance_perc_on_category", + "GraphTitle": "OSA - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/osa_perc_on_category", "GraphBackground": "#ECFFFA", "GraphOptions": {} } ] }, { - "TabId": 3, - "GraphId": 4, + "TabId": 4, + "GraphId": 6, "GraphType": "BarGraph", - "GraphTitle": "SOS Compliance Trend", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/sos_compliance_trend_perc_mtd", - "GraphBackground": "#fff", - "GraphOptions": { - "axisX": "month", - "axisY": "score", - "labelShow": 1, - "barColors": [ - "#11a4ff", - "#0ea3e3", - "#0b9ddb" - ], - "gridLinesH": 1, - "gridLinesV": 1 - } - }, + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/osa_trend_perc_mtd_O", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + }, + + + + { "TabId": 5, - "GraphId": 5, + "GraphId": 7, "GraphType": "ScoreCard", "GraphTitle": "Asset", "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/Asset_Perc", @@ -199,43 +255,14 @@ }, { "TabId": 5, - "GraphId": 6, - "GraphType": "BarGraph", - "GraphTitle": "Asset Details", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/asset_trend_perc_mtd", - "GraphBackground": "#ECFFFA", - "GraphOptions": {} - }, - { - "TabId": 4, - "GraphId": 7, - "GraphType": "ScoreCard", - "GraphTitle": "OSA", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/mtd/OSA_Perc", - "GraphBackground": "#ECFFFA", - "GraphOptions": {}, - "clickable": 1, - "DetailsPage": [ - { - "TabId": 3, - "GraphId": 3, - "GraphType": "Table", - "GraphTitle": "OSA - Category", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/osa_perc_on_category", - "GraphBackground": "#ECFFFA", - "GraphOptions": {} - } - ] - }, - { - "TabId": 4, "GraphId": 8, "GraphType": "BarGraph", - "GraphTitle": "OSA", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/osa_trend_perc_mtd", + "GraphTitle": "Asset Details", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/asset_trend_perc_mtd_O", "GraphBackground": "#ECFFFA", "GraphOptions": {} }, + { "TabId": 6, "GraphId": 9, @@ -272,13 +299,29 @@ "GraphId": 11, "GraphType": "BarGraph", "GraphTitle": "Promotion", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/promotion_trend_perc_mtd", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpimtd/promotion_trend_perc_mtd_O", "GraphBackground": "#ECFFFA", "GraphOptions": {} } ] } }, + + + + + + + + + + + + + + + + { "MainTabId": 2, "MainTabName": "Last Visit", @@ -290,8 +333,15 @@ "TabRow": 1, "TabCol": 1 }, - { + { "TabId": 2, + "TabName": "PSS Trend", + "TabRow": 1, + "TabCol": 2 + }, + + { + "TabId": 3, "TabName": "SOS Actual", "TabRow": 1, "TabCol": 2 @@ -361,10 +411,63 @@ "GraphBackground": "#BFC2FF", "GraphOptions": {} }, - { + + + + + + { "TabId": 2, "GraphId": 1, "GraphType": "ScoreCard", + "GraphTitle": "PSS Score", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/PSS_Score_LSV_Perc", + "GraphBackground": "#ECFFFA", + "GraphOptions": {}, + "clickable": 0, + "DetailsPage": [ + { + "TabId": 2, + "GraphId": 1, + "GraphType": "Table", + "GraphTitle": "PSS - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detmtd/sos_actual_perc_on_category", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} + } + ] + }, + + { + "TabId": 2, + "GraphId": 2, + "GraphType": "BarGraph", + "GraphTitle": "PSS Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/pss_trend_perc_lsv_O", + "GraphBackground": "#F4EAFF", + "GraphOptions": { + "axisX": "month", + "axisY": "score", + "labelShow": 1, + "barColors": [ + "#11a4ff", + "#0ea3e3", + "#0b9ddb" + ], + "gridLinesH": 0, + "gridLinesV": 0 + } + }, + + + + + + + { + "TabId": 3, + "GraphId": 3, + "GraphType": "ScoreCard", "GraphTitle": "SOS Actual", "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/sos_actual_lsv_perc", "GraphBackground": "#ECFFFA", @@ -383,11 +486,11 @@ ] }, { - "TabId": 2, - "GraphId": 2, + "TabId": 3, + "GraphId": 4, "GraphType": "BarGraph", "GraphTitle": "SOS Actual Trend", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/sos_actual_trend_lsv_perc", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/sos_actual_trend_lsv_perc_O", "GraphBackground": "#F4EAFF", "GraphOptions": { "axisX": "month", @@ -402,50 +505,45 @@ "gridLinesV": 1 } }, + + + + + { - "TabId": 3, - "GraphId": 3, + "TabId": 4, + "GraphId": 5, "GraphType": "ScoreCard", - "GraphTitle": "SOS Compliance", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/sos_compliance_lsv_perc", + "GraphTitle": "OSA", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/osa_lsv_perc", "GraphBackground": "#ECFFFA", "GraphOptions": {}, "clickable": 1, "DetailsPage": [ { - "TabId": 3, - "GraphId": 3, + "TabId": 4, + "GraphId": 7, "GraphType": "Table", - "GraphTitle": "SOS Actual - Category", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/detlsv/sos_compliance_lsv_perc_on_category", + "GraphTitle": "OSA - Category", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/detlsv/osa_lsv_perc_on_category", "GraphBackground": "#ECFFFA", "GraphOptions": {} } ] }, { - "TabId": 3, - "GraphId": 4, + "TabId": 4, + "GraphId": 6, "GraphType": "BarGraph", - "GraphTitle": "SOS Compliance Trend", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/sos_compliance_trend_lsv_perc", - "GraphBackground": "#fff", - "GraphOptions": { - "axisX": "month", - "axisY": "score", - "labelShow": 1, - "barColors": [ - "#11a4ff", - "#0ea3e3", - "#0b9ddb" - ], - "gridLinesH": 1, - "gridLinesV": 1 - } + "GraphTitle": "OSA Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/osa_trend_lsv_perc_O", + "GraphBackground": "#ECFFFA", + "GraphOptions": {} }, + { "TabId": 5, - "GraphId": 5, + "GraphId": 7, "GraphType": "ScoreCard", "GraphTitle": "Asset", "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/asset_lsv_perc", @@ -475,10 +573,10 @@ }, { "TabId": 5, - "GraphId": 6, + "GraphId": 8, "GraphType": "BarGraph", - "GraphTitle": "Asset Details", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/asset_trend_lsv_perc", + "GraphTitle": "Asset Trend", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/asset_trend_lsv_perc_O", "GraphBackground": "#fff", "GraphOptions": { "axisX": "month", @@ -493,36 +591,7 @@ "gridLinesV": 1 } }, - { - "TabId": 4, - "GraphId": 7, - "GraphType": "ScoreCard", - "GraphTitle": "OSA", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/lsv/osa_lsv_perc", - "GraphBackground": "#ECFFFA", - "GraphOptions": {}, - "clickable": 1, - "DetailsPage": [ - { - "TabId": 4, - "GraphId": 7, - "GraphType": "Table", - "GraphTitle": "OSA - Category", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/detlsv/osa_lsv_perc_on_category", - "GraphBackground": "#ECFFFA", - "GraphOptions": {} - } - ] - }, - { - "TabId": 4, - "GraphId": 8, - "GraphType": "BarGraph", - "GraphTitle": "OSA", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/osa_trend_lsv_perc", - "GraphBackground": "#ECFFFA", - "GraphOptions": {} - }, + { "TabId": 6, "GraphId": 9, @@ -558,7 +627,7 @@ "GraphId": 11, "GraphType": "BarGraph", "GraphTitle": "Promotion", - "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/promotion_trend_lsv_perc", + "GraphUrl": "https://dax.parinaam.in/execute/dabur/kpilsv/promotion_trend_lsv_perc_O", "GraphBackground": "#ECFFFA", "GraphOptions": {} } diff --git a/src/screens/MainScreen/Dashboard/style.js b/src/screens/MainScreen/Dashboard/style.js index e0ed65a..ef026ed 100644 --- a/src/screens/MainScreen/Dashboard/style.js +++ b/src/screens/MainScreen/Dashboard/style.js @@ -363,5 +363,19 @@ export const styles = StyleSheet.create({ marginTop: 10, marginBottom: 10, - } + }, + barGraphView: { + width: '100%', + alignItems: 'center', + justifyContent: 'center', + padding: 10, + borderWidth: 0.5, + borderRadius: 25, + }, + trendTitle: { + color: '#000', + fontSize: 16, + fontWeight: '600', + marginBottom: 10 + }, });