Skip to content

Commit

Permalink
Remove present and missing from chart
Browse files Browse the repository at this point in the history
Fixes cmbi#34
  • Loading branch information
jonblack committed Nov 25, 2016
1 parent 4e7932a commit 8e7317f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions whynot/frontend/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,10 @@ def load_statistics():
def count(databank_name):
"Called by the databank page, while the loading icon is displayed"

# TODO: speed up this method

_log.info("request for databank %s summary" % databank_name)

cs = count_summary(databank_name)
cs = {l: d for l, d in list(cs.items()) if l not in ['missing', 'present']}

return jsonify({
'labels': list(sorted(cs.keys())),
Expand Down
6 changes: 2 additions & 4 deletions whynot/frontend/templates/databank.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,18 @@ <h1>{{ databank['name'] }}</h1>
method: 'GET',
dataType: 'json',
success: function(d) {
// TODO: format data
var ctx = document.getElementById("chart-" + databank_name);

var chart = new Chart(ctx, {
type: 'pie',
data: {
labels: d.labels,
datasets: [{
data: d.data,
backgroundColor: [
"#FFCE56", "#FF6384", "#B2B2B2", "#36A2EB", "#F99744", "#57CE54"
"#FFCE56", "#B2B2B2", "#F99744", "#57CE54"
],
hoverBackgroundColor: [
"#FFCE56", "#FF6384", "#B2B2B2", "#36A2EB", "#F99744", "#57CE54"
"#FFCE56", "#B2B2B2", "#F99744", "#57CE54"
]
}]
},
Expand Down

0 comments on commit 8e7317f

Please sign in to comment.