开发者

Use Google Charts for dynamic Data from database

开发者 https://www.devze.com 2023-04-10 11:34 出处:网络
I am planning to use Google charts to display the data available开发者_开发技巧 on my server by an ajax request from the client side. But I am not able to figure out how to set the callback method for

I am planning to use Google charts to display the data available开发者_开发技巧 on my server by an ajax request from the client side. But I am not able to figure out how to set the callback method for the Google API as the callback method will be having some parameters to populate the chart.

The method needs to have the parameters as I was thinking to write the method to be generic to be used elsewhere as well.


Since it has been long since the question is left unanswered, hence replying to my own question.

I found the way to handle this. The trick was pretty simple. Even if you want to pass some parameter in the call back method for Google Charts, pass the name of the method as usual. But in the method itself if the param is set or not. Thing to take care is that Google sends you the event available for the charts, hence you could search for the set params as per your bussiness logic.

Hence if set, no issue and if not set it to blank or some default value.

Hope it helps!!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号