git add .
git commit "fix dashboard charts rendering and views data display"
This commit is contained in:
@@ -174,46 +174,98 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
||||
<script>
|
||||
const tourChart = document.getElementById('tourViewsChart');
|
||||
new Chart(tourChart, {
|
||||
|
||||
type: 'bar',
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
data: {
|
||||
|
||||
labels: @json($tourViews->pluck('date')),
|
||||
const tourData = @json($tourViews);
|
||||
|
||||
datasets: [{
|
||||
const flightData = @json($flightViews);
|
||||
|
||||
|
||||
|
||||
new Chart(document.getElementById('tourViewsChart'), {
|
||||
|
||||
type: 'bar',
|
||||
|
||||
data: {
|
||||
|
||||
labels: tourData.map(item => item.date),
|
||||
|
||||
datasets: [{
|
||||
|
||||
label: 'بازدید تورها',
|
||||
|
||||
data: tourData.map(item => item.total),
|
||||
|
||||
}]
|
||||
|
||||
},
|
||||
|
||||
options: {
|
||||
|
||||
responsive: true,
|
||||
|
||||
scales: {
|
||||
|
||||
y: {
|
||||
|
||||
beginAtZero: true
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
new Chart(document.getElementById('flightViewsChart'), {
|
||||
|
||||
type: 'bar',
|
||||
|
||||
data: {
|
||||
|
||||
labels: flightData.map(item => item.date),
|
||||
|
||||
datasets: [{
|
||||
|
||||
label: 'بازدید پروازها',
|
||||
|
||||
data: flightData.map(item => item.total),
|
||||
|
||||
}]
|
||||
|
||||
},
|
||||
|
||||
options: {
|
||||
|
||||
responsive: true,
|
||||
|
||||
scales: {
|
||||
|
||||
y: {
|
||||
|
||||
beginAtZero: true
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
label: 'بازدید تورها',
|
||||
|
||||
data: @json($tourViews->pluck('total'))
|
||||
|
||||
}]
|
||||
}
|
||||
});
|
||||
const flightChart = document.getElementById('flightViewsChart');
|
||||
new Chart(flightChart, {
|
||||
|
||||
type: 'bar',
|
||||
|
||||
data: {
|
||||
|
||||
labels: @json($flightViews->pluck('date')),
|
||||
|
||||
datasets: [{
|
||||
|
||||
label: 'بازدید پروازها',
|
||||
|
||||
data: @json($flightViews->pluck('total'))
|
||||
}]
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
||||
</script>@endsection
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user