diff --git a/mainJs.js b/mainJs.js index 0fc014a..73e8667 100644 --- a/mainJs.js +++ b/mainJs.js @@ -1,63 +1,22 @@ google.charts.load('current', {'packages':['corechart']}); -google.charts.setOnLoadCallback(drawChart); -google.charts.load('current', {'packages':['bar']}); -google.charts.setOnLoadCallback(drawChart); + google.charts.setOnLoadCallback(drawChart); -function drawChart() { + function drawChart() { - var data = google.visualization.arrayToDataTable([ - ['Task', 'Hours per Day'], - ['Food and Dining', 11], - ['Clothing', 2], - ['Entertainment', 2], - ['Transportation', 7], - ['Other', 1] - ]); + var data = google.visualization.arrayToDataTable([ + ['Task', 'Hours per Day'], + ['Work', 11], + ['Eat', 2], + ['Commute', 2], + ['Watch TV', 2], + ['Sleep', 7] + ]); - var options = { - title: 'My Daily Activities' - }; + var options = { + title: 'My Daily Activities' + }; + + var chart = new google.visualization.PieChart(document.getElementById('piechart')); - var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); - } -}; - -function drawChart() { - var data = google.visualization.arrayToDataTable([ - ['Category', 'You', 'Average 18 Year Old'], - ['Food and Dining', 1000, 400], - ['Utilities', 1170, 460], - ['Clothing', 660, 120], - ['Entertainment', 1030, 540], - ['Transportation', 1030, 540], - ['Other', 1030, 540] - ]); - - var options = { - chart: { - title: 'Comparing Spending Habits', - subtitle: 'Based on other 18 year olds', - }, - bars: 'horizontal', // Required for Material Bar Charts. - hAxis: { - format: 'decimal' - }, - height: 400, - colors: ['#1b9e77', '#d95f02', '#7570b3'] - }; - - var chart = new google.charts.Bar(document.getElementById('chart_div')); - - chart.draw(data, google.charts.Bar.convertOptions(options)); - - var btns = document.getElementById('btn-group'); - - btns.onclick = function(e) { - - if (e.target.tagName === 'BUTTON') { - options.hAxis.format = e.target.id === 'none' ? '' : e.target.id; - chart.draw(data, google.charts.Bar.convertOptions(options)); - } - } -} + } diff --git a/profile.html b/profile.html index 0b9e564..8c5735f 100644 --- a/profile.html +++ b/profile.html @@ -1,32 +1,10 @@ -< +
- + +