1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
function GrasChartOverheadCompare(args)
{
//save enables
this.ids = args.block_ids;
//input checking
if (this.ids.length <= 1) gras_error_dialog(
"GrasChartOverheadCompare",
"Error making overhead compare chart.\n"+
"Specify at least 2 blocks for this chart."
);
//make new chart
this.chart = new google.visualization.PieChart(args.panel);
this.title = "Overhead Comparison";
}
GrasChartOverheadCompare.prototype.update = function(history)
{
var point = history[history.length-1];
var data_set = new Array();
data_set.push(['Task', 'Percent']);
$.each(this.ids, function(index, id)
{
var percents = gras_extract_percent_times(point, id);
data_set.push([id, percents['total']]);
});
var data = google.visualization.arrayToDataTable(data_set)
var options = {
width:$('#page').width()/5,
chartArea:{left:5,top:0,right:5,bottom:0,width:"100%",height:"100%"},
};
this.chart.draw(data, options);
};
|