From a61d8257645660e3089c29e99e18f83b6f2b1be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarom=C3=ADr=20=C4=8Cervenka?= Date: Sun, 28 Oct 2012 13:36:19 +0100 Subject: [PATCH 1/2] Added support for redrawing chart from the external script. --- lib/google_visualr/base_chart.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/google_visualr/base_chart.rb b/lib/google_visualr/base_chart.rb index 6ae00ca..f29eaa2 100644 --- a/lib/google_visualr/base_chart.rb +++ b/lib/google_visualr/base_chart.rb @@ -15,6 +15,10 @@ def initialize(data_table, options={}) def chart_name class_name end + + def draw_fn_name element_id + "draw_#{element_id.sub('-', '_')}_Chart" + end def options @options @@ -34,17 +38,21 @@ def add_listener(event, callback) # *div_id [Required] The ID of the DIV element that the Google Chart should be rendered in. def to_js(element_id) js = "\n" - js - end + js + end end From 271a98eeba94a3ce90ea278c972c566e4f55e9c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarom=C3=ADr=20=C4=8Cervenka?= Date: Sun, 28 Oct 2012 13:46:59 +0100 Subject: [PATCH 2/2] Fixed: Typo in draw_fn_name. --- lib/google_visualr/base_chart.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/google_visualr/base_chart.rb b/lib/google_visualr/base_chart.rb index f29eaa2..6f7fae9 100644 --- a/lib/google_visualr/base_chart.rb +++ b/lib/google_visualr/base_chart.rb @@ -17,7 +17,7 @@ def chart_name end def draw_fn_name element_id - "draw_#{element_id.sub('-', '_')}_Chart" + "draw_#{element_id.gsub('-', '_')}_Chart" end def options