|
@@ -3,6 +3,7 @@
|
|
{% block jquery %}
|
|
{% block jquery %}
|
|
var location_id = document.getElementById("location").value;
|
|
var location_id = document.getElementById("location").value;
|
|
var time_interval = document.getElementById("timeInterval").value;
|
|
var time_interval = document.getElementById("timeInterval").value;
|
|
|
|
+
|
|
var endpoint = '/analytics/analytic-data';
|
|
var endpoint = '/analytics/analytic-data';
|
|
params = {
|
|
params = {
|
|
"location_id": location_id,
|
|
"location_id": location_id,
|
|
@@ -14,15 +15,16 @@
|
|
data: params,
|
|
data: params,
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
success: function(data) {
|
|
-
|
|
|
|
$('#barChart').remove();
|
|
$('#barChart').remove();
|
|
- $('#bar-chart-container').append('<canvas id="barChart" width="400" height="100" class="mt-2"></canvas>');
|
|
|
|
|
|
+ $('#bar-chart-container').append('<canvas id="barChart" width="400" height="120" class="mt-2"></canvas>');
|
|
|
|
|
|
$('#lineChart').remove();
|
|
$('#lineChart').remove();
|
|
- $('#line-chart-container').append('<canvas id="lineChart" width="400" height="100" class="mt-2"></canvas>');
|
|
|
|
|
|
+ $('#line-chart-container').append('<canvas id="lineChart" width="400" height="120" class="mt-2"></canvas>');
|
|
|
|
|
|
var ctx = document.getElementById('lineChart').getContext('2d');
|
|
var ctx = document.getElementById('lineChart').getContext('2d');
|
|
var ctxBar = document.getElementById('barChart').getContext('2d');
|
|
var ctxBar = document.getElementById('barChart').getContext('2d');
|
|
|
|
+ var location_sel = document.getElementById("location")
|
|
|
|
+ var location_name = location_sel.options[location_sel.selectedIndex].text;
|
|
var myLineChart = new Chart(ctx, {
|
|
var myLineChart = new Chart(ctx, {
|
|
type: 'line',
|
|
type: 'line',
|
|
data: {
|
|
data: {
|
|
@@ -34,6 +36,8 @@
|
|
borderColor: 'rgb(75, 192, 192)',
|
|
borderColor: 'rgb(75, 192, 192)',
|
|
backgroundColor: 'rgb(75, 192, 192)',
|
|
backgroundColor: 'rgb(75, 192, 192)',
|
|
borderWidth: 3,
|
|
borderWidth: 3,
|
|
|
|
+ pointRadius: 3,
|
|
|
|
+ pointStyle: 'rect',
|
|
fill: false
|
|
fill: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -42,6 +46,7 @@
|
|
borderColor: 'rgb(54, 162, 235)',
|
|
borderColor: 'rgb(54, 162, 235)',
|
|
backgroundColor: 'rgb(54, 162, 235)',
|
|
backgroundColor: 'rgb(54, 162, 235)',
|
|
borderWidth: 3,
|
|
borderWidth: 3,
|
|
|
|
+ pointRadius: 2,
|
|
fill: false
|
|
fill: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -50,6 +55,7 @@
|
|
borderColor: 'rgb(153, 102, 255)',
|
|
borderColor: 'rgb(153, 102, 255)',
|
|
backgroundColor: 'rgb(153, 102, 255)',
|
|
backgroundColor: 'rgb(153, 102, 255)',
|
|
borderWidth: 3,
|
|
borderWidth: 3,
|
|
|
|
+ pointRadius: 2,
|
|
fill: false
|
|
fill: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -58,6 +64,8 @@
|
|
borderColor: 'rgb(255, 159, 64)',
|
|
borderColor: 'rgb(255, 159, 64)',
|
|
backgroundColor: 'rgb(255, 159, 64)',
|
|
backgroundColor: 'rgb(255, 159, 64)',
|
|
borderWidth: 3,
|
|
borderWidth: 3,
|
|
|
|
+ pointRadius: 3,
|
|
|
|
+ pointStyle: 'rectRot',
|
|
fill: false
|
|
fill: false
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -66,6 +74,8 @@
|
|
borderColor: 'rgb(255, 99, 132)',
|
|
borderColor: 'rgb(255, 99, 132)',
|
|
backgroundColor: 'rgb(255, 99, 132)',
|
|
backgroundColor: 'rgb(255, 99, 132)',
|
|
borderWidth: 3,
|
|
borderWidth: 3,
|
|
|
|
+ pointRadius: 3,
|
|
|
|
+ pointStyle: 'rect',
|
|
fill: false
|
|
fill: false
|
|
},
|
|
},
|
|
]
|
|
]
|
|
@@ -82,6 +92,11 @@
|
|
beginAtZero: true
|
|
beginAtZero: true
|
|
}
|
|
}
|
|
}]
|
|
}]
|
|
|
|
+ },
|
|
|
|
+ title: {
|
|
|
|
+ display: true,
|
|
|
|
+ fontSize: 20,
|
|
|
|
+ text: 'Total Star Rating - ' + location_name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -111,6 +126,11 @@
|
|
drawOnChartArea:false
|
|
drawOnChartArea:false
|
|
}
|
|
}
|
|
}]
|
|
}]
|
|
|
|
+ },
|
|
|
|
+ title: {
|
|
|
|
+ display: true,
|
|
|
|
+ fontSize: 20,
|
|
|
|
+ text: 'Total Review - ' + location_name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|