|
@@ -292,11 +292,49 @@ function renderNewVsReturningCustomersChart($new_vs_returning) {
|
|
<div class="chart-header">
|
|
<div class="chart-header">
|
|
<h2 class="chart-title">新老客户分析</h2>
|
|
<h2 class="chart-title">新老客户分析</h2>
|
|
</div>
|
|
</div>
|
|
- <div class="chart-row">
|
|
|
|
- <div class="chart-column">
|
|
|
|
|
|
+ <style>
|
|
|
|
+ .pie-charts-container {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+ }
|
|
|
|
+ .pie-chart-wrapper {
|
|
|
|
+ flex: 0 0 48%;
|
|
|
|
+ max-width: 48%;
|
|
|
|
+ }
|
|
|
|
+ .customer-stats-summary {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ padding: 15px;
|
|
|
|
+ background-color: #f9f9f9;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ }
|
|
|
|
+ .stats-row {
|
|
|
|
+ display: flex;
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
+ }
|
|
|
|
+ .stat-item {
|
|
|
|
+ flex: 1;
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ }
|
|
|
|
+ .stat-label {
|
|
|
|
+ display: block;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
+ color: #555;
|
|
|
|
+ }
|
|
|
|
+ .stat-value {
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ color: #333;
|
|
|
|
+ }
|
|
|
|
+ </style>
|
|
|
|
+ <div class="pie-charts-container">
|
|
|
|
+ <div class="pie-chart-wrapper">
|
|
|
|
+ <h3 style="text-align: center; margin-bottom: 15px;">客户数量分布</h3>
|
|
<canvas id="newVsReturningCustomersChart"></canvas>
|
|
<canvas id="newVsReturningCustomersChart"></canvas>
|
|
</div>
|
|
</div>
|
|
- <div class="chart-column">
|
|
|
|
|
|
+ <div class="pie-chart-wrapper">
|
|
|
|
+ <h3 style="text-align: center; margin-bottom: 15px;">销售额分布</h3>
|
|
<canvas id="newVsReturningAmountChart"></canvas>
|
|
<canvas id="newVsReturningAmountChart"></canvas>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -357,13 +395,10 @@ function renderNewVsReturningCustomersChart($new_vs_returning) {
|
|
},
|
|
},
|
|
options: {
|
|
options: {
|
|
responsive: true,
|
|
responsive: true,
|
|
|
|
+ maintainAspectRatio: true,
|
|
plugins: {
|
|
plugins: {
|
|
legend: {
|
|
legend: {
|
|
position: 'bottom',
|
|
position: 'bottom',
|
|
- },
|
|
|
|
- title: {
|
|
|
|
- display: true,
|
|
|
|
- text: '客户数量分布'
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -389,51 +424,14 @@ function renderNewVsReturningCustomersChart($new_vs_returning) {
|
|
},
|
|
},
|
|
options: {
|
|
options: {
|
|
responsive: true,
|
|
responsive: true,
|
|
|
|
+ maintainAspectRatio: true,
|
|
plugins: {
|
|
plugins: {
|
|
legend: {
|
|
legend: {
|
|
position: 'bottom',
|
|
position: 'bottom',
|
|
- },
|
|
|
|
- title: {
|
|
|
|
- display: true,
|
|
|
|
- text: '销售额分布'
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
- <style>
|
|
|
|
- .chart-row {
|
|
|
|
- display: flex;
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
- }
|
|
|
|
- .chart-column {
|
|
|
|
- flex: 0 0 50%;
|
|
|
|
- max-width: 50%;
|
|
|
|
- }
|
|
|
|
- .customer-stats-summary {
|
|
|
|
- margin-top: 20px;
|
|
|
|
- padding: 15px;
|
|
|
|
- background-color: #f9f9f9;
|
|
|
|
- border-radius: 5px;
|
|
|
|
- }
|
|
|
|
- .stats-row {
|
|
|
|
- display: flex;
|
|
|
|
- margin-bottom: 15px;
|
|
|
|
- }
|
|
|
|
- .stat-item {
|
|
|
|
- flex: 1;
|
|
|
|
- padding: 0 10px;
|
|
|
|
- }
|
|
|
|
- .stat-label {
|
|
|
|
- display: block;
|
|
|
|
- font-weight: bold;
|
|
|
|
- margin-bottom: 5px;
|
|
|
|
- color: #555;
|
|
|
|
- }
|
|
|
|
- .stat-value {
|
|
|
|
- font-size: 16px;
|
|
|
|
- color: #333;
|
|
|
|
- }
|
|
|
|
- </style>
|
|
|
|
<?php
|
|
<?php
|
|
}
|
|
}
|