aboutsummaryrefslogtreecommitdiff
path: root/templates/beerpage.jinja2
diff options
context:
space:
mode:
authorSean Dolan <sed9182@rit.edu>2019-07-28 21:00:40 +0000
committerSean Dolan <sed9182@rit.edu>2019-07-28 21:00:40 +0000
commit5798bd13acef073f9bf1241aeb588fb9fe3b3156 (patch)
tree8b22924b667ec6b6ee0266e31c21d6f83c9fd83c /templates/beerpage.jinja2
parentba8ea946e5b146cfb79edbe278f7c4084825431c (diff)
Sean dev
Diffstat (limited to 'templates/beerpage.jinja2')
-rw-r--r--templates/beerpage.jinja268
1 files changed, 24 insertions, 44 deletions
diff --git a/templates/beerpage.jinja2 b/templates/beerpage.jinja2
index e0aede0..ab60c6b 100644
--- a/templates/beerpage.jinja2
+++ b/templates/beerpage.jinja2
@@ -4,54 +4,34 @@
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script>
google.charts.load('current', {packages: ['corechart', 'bar']});
-google.charts.setOnLoadCallback(drawAnnotations);
+ google.charts.setOnLoadCallback(drawAnnotations);
-function drawAnnotations() {
- var data = new google.visualization.DataTable();
- data.addColumn('timeofday', 'Time of Day');
- data.addColumn('number', 'Motivation Level');
- data.addColumn({type: 'string', role: 'annotation'});
- data.addColumn('number', 'Energy Level');
- data.addColumn({type: 'string', role: 'annotation'});
+ function drawAnnotations() {
+ var data = new google.visualization.DataTable();
+ data.addColumn('string', 'Style');
+ data.addColumn('number', 'Degree likeness');
- data.addRows([
- [{v: [8, 0, 0], f: '8 am'}, 1, '1', .25, '.2'],
- [{v: [9, 0, 0], f: '9 am'}, 2, '2', .5, '.5'],
- [{v: [10, 0, 0], f:'10 am'}, 3, '3', 1, '1'],
- [{v: [11, 0, 0], f: '11 am'}, 4, '4', 2.25, '2'],
- [{v: [12, 0, 0], f: '12 pm'}, 5, '5', 2.25, '2'],
- [{v: [13, 0, 0], f: '1 pm'}, 6, '6', 3, '3'],
- [{v: [14, 0, 0], f: '2 pm'}, 7, '7', 3.25, '3'],
- [{v: [15, 0, 0], f: '3 pm'}, 8, '8', 5, '5'],
- [{v: [16, 0, 0], f: '4 pm'}, 9, '9', 6.5, '6'],
- [{v: [17, 0, 0], f: '5 pm'}, 10, '10', 10, '10'],
- ]);
+ data.addRows([
+ {% for item in style_map %}
+ [{v: '{{ item['name'] }}'}, {{ item['score'] }} ],
+ {% endfor %}
+ ]);
- var options = {
- title: 'Motivation and Energy Level Throughout the Day',
- annotations: {
- alwaysOutside: true,
- textStyle: {
- fontSize: 14,
- color: '#000',
- auraColor: 'none'
- }
- },
- hAxis: {
- title: 'Time of Day',
- format: 'h:mm a',
- viewWindow: {
- min: [7, 30, 0],
- max: [17, 30, 0]
- }
- },
- vAxis: {
- title: 'Rating (scale of 1-10)'
- }
- };
+ var options = {
+ hAxis: {
+ title: 'Style'
+ },
+ vAxis: {
+ title: 'Taste more like'
+ },
+ tooltip : {
+ trigger: 'none'
+ },
+ legend: {position: 'none'}
+ };
- var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
- chart.draw(data, options);
+ var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
+ chart.draw(data, options);
}
</script>