-
Notifications
You must be signed in to change notification settings - Fork 1
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
Compliance chart #45
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
77923ed
started creating scatterplot chart layout
sylvr3 976ce7f
added Chart.js to list of included scripts in hbs template
sylvr3 9eed3f5
attempting to get example scatterplot to display on page
sylvr3 f0f4738
removed extraneous code
sylvr3 9f68dc4
more code cleanup
sylvr3 894ce15
extending chart type for scatter chart
sylvr3 7f252d9
Sample scatterplot now shows data
sylvr3 d40cef5
Moved scatterchart data into patient presenter
sylvr3 48e4e85
Merge branch 'master' into compliance-chart
sylvr3 4ec90d9
Changed x and y axis labels and moved scatterplot data back to hbs
sylvr3 3300f62
scatter plot with time series will not appear
sylvr3 38d85eb
Merge branch 'master' into compliance-chart
sylvr3 07bdf0a
time series x axis formatting
sylvr3 3191cc1
converting scatterplot data into time series
sylvr3 ae3253f
jshint
beccannlittle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,18 @@ | |
<div class="col-sm-8"> | ||
<div id="calendar"></div> | ||
</div> | ||
<div class="col-lg-4 col-md-6"> | ||
<canvas id="scatterChart" width="400" height="400"></canvas> | ||
</div> | ||
<div class="col-xs-12"> | ||
<div class="card"> | ||
<div class="card-block"> | ||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<h4 class="card-title"> | ||
Trials | ||
</h4> | ||
</div> | ||
<div class="col-sm-4"> | ||
<div class="card card-inverse card-primary"> | ||
<div class="card-block"> | ||
|
@@ -106,5 +118,67 @@ | |
allDayDefault: true, | ||
events: surveys | ||
}); | ||
|
||
|
||
|
||
}); | ||
|
||
var scatterChartData = { | ||
datasets: [{ | ||
label: "My First dataset", | ||
data: [{ | ||
x: 0, | ||
y: 0 | ||
}, { | ||
x: 1, | ||
y: 51 | ||
}, { | ||
x: 2, | ||
y: 52 | ||
}, { | ||
x: 3, | ||
y: 53 | ||
}, { | ||
x: 4, | ||
y: 54 | ||
} | ||
], // data | ||
borderColor: "rgba(220,220,220,1)", | ||
backgroundColor: "rgba(220,220,220,0.2)", | ||
pointBorderColor: "rgba(220,220,220,1)", | ||
pointBackgroundColor: "rgba(220,220,220,1)", | ||
pointBorderWidth: "1" | ||
}] // datasets | ||
}; //chartData | ||
|
||
window.onload = function() { | ||
var ctx = document.getElementById("scatterChart").getContext("2d"); | ||
window.myScatter = Chart.Scatter(ctx, { | ||
data: scatterChartData, | ||
options: { | ||
scales: { | ||
xAxes: [{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sylvr3 time series is simple. |
||
position: 'top', | ||
gridLines: { | ||
zeroLineColor: "rgba(0,255,0,1)" | ||
}, | ||
scaleLabel: { | ||
show: true, | ||
labelString: 'x axis' | ||
} | ||
}], | ||
yAxes: [{ | ||
position: 'right', | ||
gridLines: { | ||
zeroLineColor: "rgba(0,255,0,1)" | ||
}, | ||
scaleLabel: { | ||
show: true, | ||
labelString: 'y axis' | ||
} | ||
}] | ||
} | ||
} | ||
}); | ||
}; | ||
</script> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then replace the x values with dates.
Like so:
https://github.com/nnnick/Chart.js/blob/v2.0-dev/samples/line-time-point-data.html#L54