Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compliance chart #45

Merged
merged 15 commits into from
Oct 26, 2015
Merged
65 changes: 53 additions & 12 deletions view/template/patient.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,11 @@
Patient: {{ patient.id }}
</li>
</ol>
<div class="col-sm-8">
<div class="col-sm-6">
<div id="calendar"></div>
</div>
<div class="col-sm-4">
<div class="card card-inverse card-primary">
<div class="card-block">
<p class="card-text">
Here is where we would have a sweet graph of the clinician's total patients over time for this trial.
</p>
<a href="#" class="btn btn-secondary btn-block">
ADD NEW
</a>
</div>
</div>
<div class="col-sm-6">
<canvas id="complianceChart" width="400" height="400"></canvas>
</div>
<div class="col-sm-12">
<div class="card">
Expand Down Expand Up @@ -106,5 +97,55 @@
allDayDefault: true,
events: surveys
});

let config = {
type: 'line',
data: {
labels: ['01/01/2015 20:00', '01/02/2015 21:00', '01/03/2015 22:00', '01/04/2015 23:00', '01/05/2015 03:00', '01/06/2015 10:00', '01/07/2015 04:00'],
datasets: [
{
label: 'Hours until survey expired',
data: [23, 18, 20, 15, 4, 0, 1]
}
]
},
options: {
responsive: true,
scales: {
xAxes: [
{
type: 'time',
display: true,
time: {
format: 'MMDDYYYY HHmm',
round: 'day'
},
scaleLabel: {
show: true,
labelString: 'Date'
}
}
],
yAxes: [
{
display: true,
scaleLabel: {
show: true,
labelString: 'Hours until survey expires'
}
}
]
},
elements: {
line: {
tension: 0.3
}
}
}
};

let ctx = document.getElementById('complianceChart').getContext('2d');

window.radarChart = new Chart(ctx, config);
});
</script>