Add new graphs for watches by day of week and hour of day.

Clean up some graph styling
This commit is contained in:
Tim 2015-06-24 00:10:09 +02:00
parent 71a2e75fef
commit 0224c709b0
6 changed files with 257 additions and 3 deletions

View file

@ -8152,7 +8152,7 @@ ol.test >li {
}
.graphs-instance {
height: 350px;
height: 300px;
padding: 20px;
background-color: #282828;
margin-right: 20px;
@ -8160,7 +8160,9 @@ ol.test >li {
}
.watch-chart {
height: 360px;
margin-top: 10px;
height: 300px;
width: 100%;
}
.graphs-load {

View file

@ -30,13 +30,42 @@ from plexpy import helpers
</div>
</div>
</div>
<div id="currentActivity">
<div>
<div class="graphs-instance">
<div class="watch-chart" id="chart_div_plays_by_day">
<div class="graphs-load"><i class="fa fa-refresh fa-spin"></i> Loading chart...</div><br>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span6">
<div class="wellheader">
<div class="dashboard-wellheader">
<h3>Watches by day of week (Past 30 days)</h3>
</div>
</div>
<div class="graphs-instance">
<div class="watch-chart" id="chart_div_plays_by_dayofweek" style="float: left;">
<div class="graphs-load"><i class="fa fa-refresh fa-spin"></i> Loading chart...</div><br>
</div>
</div>
</div>
<div class="span6">
<div class="wellheader">
<div class="dashboard-wellheader">
<h3>Watches by hour of day (Past 30 days)</h3>
</div>
</div>
<div class="graphs-instance">
<div class="watch-chart" id="chart_div_plays_by_hourofday">
<div class="graphs-load"><i class="fa fa-refresh fa-spin"></i> Loading chart...</div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -47,7 +76,10 @@ from plexpy import helpers
<script src="interfaces/default/js/moment-with-locale.js"></script>
<script src="interfaces/default/js/highcharts/js/highcharts.js"></script>
<script src="interfaces/default/js/graphs/plays_by_day.js"></script>
<script src="interfaces/default/js/graphs/plays_by_dayofweek.js"></script>
<script src="interfaces/default/js/graphs/plays_by_hourofday.js"></script>
<script>
$(document).ready(function () {
$.ajax({
url: "get_plays_by_date",
type: 'get',
@ -64,5 +96,30 @@ from plexpy import helpers
var hc_plays_by_day = new Highcharts.Chart(hc_plays_by_day_options);
}
});
$.ajax({
url: "get_plays_by_dayofweek",
type: 'get',
data: { time_range: '30' },
dataType: "json",
success: function(data) {
hc_plays_by_dayofweek_options.xAxis.categories = data.categories;
hc_plays_by_dayofweek_options.series = data.series;
var hc_plays_by_dayofweek = new Highcharts.Chart(hc_plays_by_dayofweek_options);
}
});
$.ajax({
url: "get_plays_by_hourofday",
type: 'get',
data: { time_range: '30' },
dataType: "json",
success: function(data) {
hc_plays_by_hourofday_options.xAxis.categories = data.categories;
hc_plays_by_hourofday_options.series = data.series;
var hc_plays_by_hourofday = new Highcharts.Chart(hc_plays_by_hourofday_options);
}
});
});
</script>
</%def>

View file

@ -0,0 +1,45 @@
var hc_plays_by_dayofweek_options = {
chart: {
type: 'column',
backgroundColor: 'rgba(0,0,0,0)',
renderTo: 'chart_div_plays_by_dayofweek'
},
title: {
text: ''
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
legend: {
enabled: true,
itemStyle: {
font: '9pt "Open Sans", sans-serif',
color: '#A0A0A0'
},
itemHoverStyle: {
color: '#FFF'
},
itemHiddenStyle: {
color: '#444'
}
},
credits: {
enabled: false
},
colors: ['#F9AA03', '#FFFFFF'],
xAxis: {
categories: [{}]
},
yAxis: {
title: {
text: null
}
},
tooltip: {
},
series: [{}]
};

View file

@ -0,0 +1,45 @@
var hc_plays_by_hourofday_options = {
chart: {
type: 'column',
backgroundColor: 'rgba(0,0,0,0)',
renderTo: 'chart_div_plays_by_hourofday'
},
title: {
text: ''
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
legend: {
enabled: true,
itemStyle: {
font: '9pt "Open Sans", sans-serif',
color: '#A0A0A0'
},
itemHoverStyle: {
color: '#FFF'
},
itemHiddenStyle: {
color: '#444'
}
},
credits: {
enabled: false
},
colors: ['#F9AA03', '#FFFFFF'],
xAxis: {
categories: [{}]
},
yAxis: {
title: {
text: null
}
},
tooltip: {
},
series: [{}]
};