Merge remote-tracking branch 'origin/SPM-11'

This commit is contained in:
Johannes Theiner 2019-05-28 15:31:31 +02:00
commit 398c54fa8e
3 changed files with 26 additions and 7 deletions

View File

@ -6,7 +6,7 @@
<!--Cards--> <!--Cards-->
<!--Analyse-Cards--> <!--Analyse-Cards-->
<div id="analysis" class="row container"> <div id="analysis" class="row container black-text">
<!--Übersicht--> <!--Übersicht-->
<div class="col s12 m12"> <div class="col s12 m12">
<div id="overview" class="card white"> <div id="overview" class="card white">
@ -16,7 +16,7 @@
<div class="card-content"> <div class="card-content">
<div> <div>
<canvas id="overview_chart" width="1000" height="400"></canvas> <canvas class="black-text" id="overview_chart" width="1000" height="400"></canvas>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,3 +1,5 @@
Chart.defaults.global.defaultFontColor = "black";
$(document).ready(function () { $(document).ready(function () {
let dataset = $('#dataset'); let dataset = $('#dataset');
request('files').then(results => { request('files').then(results => {
@ -33,7 +35,6 @@ function updateCache() {
} }
} }
function updateAll(uuid) { function updateAll(uuid) {
updateWeekOverviewChart(uuid); updateWeekOverviewChart(uuid);
updateShoppingTimesChart(uuid); updateShoppingTimesChart(uuid);

View File

@ -5,13 +5,15 @@ let week_overview = new Chart($("#overview_chart"), {
data: { data: {
labels: [0, 0, 0, 0, 0], labels: [0, 0, 0, 0, 0],
datasets: [{ datasets: [{
label: "Warenanzahl", label: "Kundenanzahl",
yAxisID: 'y-axis-1',
data: [0, 0, 0, 0, 0], data: [0, 0, 0, 0, 0],
fill: true, fill: true,
backgroundColor: 'rgba(104, 216, 154, 0.5)', backgroundColor: 'rgba(104, 216, 154, 0.5)',
lineTension: 0 lineTension: 0
}, { }, {
label: "Einnahmen in €", label: "Einnahmen in €",
yAxisID: 'y-axis-2',
data: [0, 0, 0, 0, 0], data: [0, 0, 0, 0, 0],
fill: true, fill: true,
backgroundColor: 'rgba(113, 114, 231, 1)', backgroundColor: 'rgba(113, 114, 231, 1)',
@ -47,9 +49,25 @@ let week_overview = new Chart($("#overview_chart"), {
display: false display: false
} }
}], }],
yAxes: [{ yAxes: [
display: true {
}] display: true,
position: 'right',
id: 'y-axis-1',
scaleLabel: {
display: true,
labelString: 'Kundenanzahl'
}
},
{
display: true,
id: 'y-axis-2',
scaleLabel: {
display: true,
labelString: 'Einnahmen in €'
}
}
]
} }
} }
}); });