diff options
author | Josh Blum | 2013-03-25 02:39:08 -0500 |
---|---|---|
committer | Josh Blum | 2013-03-25 02:39:08 -0500 |
commit | a23b425c689ac66cd4d6e986b8a4292e19fc9710 (patch) | |
tree | 8d98021148e0463a9bc025d1d1be6f8956f0d1dd /python/gras/stats/chart_handler_breakdown.js | |
parent | 8cd3da02902c7071284d268b535f6fdf58bb8c3f (diff) | |
parent | 03782249b936ec973537b305e40b3db360e6f93a (diff) | |
download | sandhi-a23b425c689ac66cd4d6e986b8a4292e19fc9710.tar.gz sandhi-a23b425c689ac66cd4d6e986b8a4292e19fc9710.tar.bz2 sandhi-a23b425c689ac66cd4d6e986b8a4292e19fc9710.zip |
Merge branch 'chart_factory'
completes #55
Diffstat (limited to 'python/gras/stats/chart_handler_breakdown.js')
-rw-r--r-- | python/gras/stats/chart_handler_breakdown.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/python/gras/stats/chart_handler_breakdown.js b/python/gras/stats/chart_handler_breakdown.js new file mode 100644 index 0000000..8e90fc3 --- /dev/null +++ b/python/gras/stats/chart_handler_breakdown.js @@ -0,0 +1,37 @@ +function GrasChartHandlerBreakdown(args) +{ + //input checking + if (args.block_ids.length != 1) throw gras_error_dialog( + "GrasChartHandlerBreakdown", + "Error making handler breakdown chart.\n"+ + "Specify only one block for this chart." + ); + + //save enable + this.block_id = args.block_ids[0]; + + //make new chart + this.chart = new google.visualization.PieChart(args.panel); + + this.title = "Handler Breakdown - " + this.block_id; +} + +GrasChartHandlerBreakdown.prototype.update = function(point) +{ + var percents = gras_extract_percent_times(point, this.block_id); + var data = google.visualization.arrayToDataTable([ + ['Task', 'Percent'], + ['Work prep', percents['prep']], + ['Work task', percents['work']], + ['Work post', percents['post']], + ['Input tasks', percents['input']], + ['Output tasks', percents['output']], + ]); + + var options = { + width:GRAS_CHARTS_STD_WIDTH, + chartArea:{left:5,top:0,right:5,bottom:0,width:"100%",height:"100%"}, + }; + + this.chart.draw(data, options); +}; |