diff options
author | Josh Blum | 2013-03-27 03:54:02 -0500 |
---|---|---|
committer | Josh Blum | 2013-03-27 03:54:02 -0500 |
commit | 561c9054a51a03162bcc50deba8e3a7e0e05cd3c (patch) | |
tree | 4231981c5b52e9c3cd632d576eda510f277f24b2 /python | |
parent | e344e8da8af6c8c4612a6d932f5efad653b95d78 (diff) | |
download | sandhi-561c9054a51a03162bcc50deba8e3a7e0e05cd3c.tar.gz sandhi-561c9054a51a03162bcc50deba8e3a7e0e05cd3c.tar.bz2 sandhi-561c9054a51a03162bcc50deba8e3a7e0e05cd3c.zip |
gras: workaround for google chart shrink on resize issue
Diffstat (limited to 'python')
-rw-r--r-- | python/gras/query/chart_factory.js | 10 | ||||
-rw-r--r-- | python/gras/query/chart_handler_breakdown.js | 2 | ||||
-rw-r--r-- | python/gras/query/chart_overall_throughput.js | 2 | ||||
-rw-r--r-- | python/gras/query/chart_overhead_compare.js | 2 |
4 files changed, 15 insertions, 1 deletions
diff --git a/python/gras/query/chart_factory.js b/python/gras/query/chart_factory.js index 6132ab2..210ee18 100644 --- a/python/gras/query/chart_factory.js +++ b/python/gras/query/chart_factory.js @@ -18,6 +18,7 @@ function gras_chart_factory_update(registry, point) { $.each(registry.active_charts, function(index, chart_info) { + chart_info.point = point; //store last data point chart_info.chart.update(point); }); } @@ -171,7 +172,9 @@ function gras_chart_factory_make(registry, args) { args['width'] = chart_box.width(); args['height'] = chart_box.height(); - args['position'] = chart_box.offset() + args['position'] = chart_box.offset(); + chart.gc_resize = false; + chart.update(chart_info.point); gras_chart_save(registry); }; @@ -180,6 +183,11 @@ function gras_chart_factory_make(registry, args) { if ('width' in args) chart_box.width(args.width); if ('height' in args) chart_box.height(args.height); + }, + start: function(event, ui) + { + chart.gc_resize = true; + chart.update(chart_info.point); }}); chart_box.css('position', 'absolute'); diff --git a/python/gras/query/chart_handler_breakdown.js b/python/gras/query/chart_handler_breakdown.js index f897c5b..459c2d3 100644 --- a/python/gras/query/chart_handler_breakdown.js +++ b/python/gras/query/chart_handler_breakdown.js @@ -32,6 +32,8 @@ GrasChartHandlerBreakdown.prototype.update = function(point) var options = { chartArea:{left:5,top:0,right:5,bottom:0,width:"100%",height:"100%"}, }; + if (this.gc_resize) options.width = 50; + if (this.gc_resize) options.height = 50; this.chart.draw(data, options); }; diff --git a/python/gras/query/chart_overall_throughput.js b/python/gras/query/chart_overall_throughput.js index 7b99fa4..280c10a 100644 --- a/python/gras/query/chart_overall_throughput.js +++ b/python/gras/query/chart_overall_throughput.js @@ -41,5 +41,7 @@ GrasChartOverallThroughput.prototype.update = function(point) var options = { legend: {'position': 'bottom'}, }; + if (this.gc_resize) options.width = 50; + if (this.gc_resize) options.height = 50; this.chart.draw(chart_data, options); }; diff --git a/python/gras/query/chart_overhead_compare.js b/python/gras/query/chart_overhead_compare.js index f4771b6..9ad324c 100644 --- a/python/gras/query/chart_overhead_compare.js +++ b/python/gras/query/chart_overhead_compare.js @@ -32,6 +32,8 @@ GrasChartOverheadCompare.prototype.update = function(point) var options = { chartArea:{left:5,top:0,right:5,bottom:0,width:"100%",height:"100%"}, }; + if (this.gc_resize) options.width = 50; + if (this.gc_resize) options.height = 50; this.chart.draw(data, options); }; |