Window.onresize cannot trigger dashboard draw?

26 views
Skip to first unread message

Sean Larson

unread,
Apr 4, 2018, 7:32:58 PM4/4/18
to Google Visualization API
Hello,

When working with only a single chart I was able to tie the 'onresize' event to the myChartName.draw() function. 

However, I am now using a dashboard and cannot seem to get the same functionality. Not clear on why the switch broke it.

Any advice?
Message has been deleted
Message has been deleted

Sean Larson

unread,
Apr 5, 2018, 10:54:14 AM4/5/18
to Google Visualization API
OK. Some lessons learned. 

I first tried adding the window resize event into the google 'onready' event, but this caused a significant decrease in performance as it seemed to be duplicating the embedded "tabular representation of the data" hidden element. 

So, I instead opted for a document ready event outside of the google chart function, which called a debounce script, which eventually triggers the chart.draw(). 

Ibrahim Pala

unread,
Apr 20, 2018, 8:04:39 AM4/20/18
to Google Visualization API
Add This After draw(data)

----
window.addEventListener("resize",drawfunctionname, false);
----

drawfunctionname must be your draw function name be carefully :)


5 Nisan 2018 Perşembe 02:32:58 UTC+3 tarihinde Sean Larson yazdı:
Reply all
Reply to author
Forward
0 new messages