multiple independent charts

28 views
Skip to first unread message

Michael X

unread,
Sep 20, 2016, 2:24:04 PM9/20/16
to Google Visualization API
hi 


i have been asked to create a chart and allow other programmers to add charts independent of the first chart.
is this possible ?

thanks
Michael

Daniel LaLiberte

unread,
Sep 20, 2016, 2:45:02 PM9/20/16
to Google Visualization API
If you are asking whether there can be multiple charts on the same page that don't have to know about each other, you can do that now if you use the latest version.   

There should still only be one load of the loader; if you try to load the loader more than one time, it will throw an error.

There is a documentation page on drawing multlple charts in the same page:  https://developers.google.com/chart/interactive/docs/basic_multiple_charts

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/a6933038-5dec-41cf-aefd-90f711641344%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Michael X

unread,
Sep 20, 2016, 2:57:14 PM9/20/16
to Google Visualization API
what they want is to :

new Programmer needs to add a chart to existing set of chart , so he/she adds code to call a function and passes the url which returns a JSON data structure :

    function testAjax(str1) {

        var data2={};

        var result={};

        $.ajax({ 

    type: 'GET'

    url: str1,

    data: { get_param: 'value' }

    dataType: 'json',

    async: false,

    success: function (data2) { 

         result = data2;

    }

})

  return result;


};


then he call APIs to draw the chart on some '<div id=div1></div> 

is it possible to call : var chart = new google.charts.Bar(document.getElementById(div1))  var data = new google.visualization.DataTable(); ..... 

thanks
Michael


On Tuesday, September 20, 2016 at 11:45:02 AM UTC-7, Daniel LaLiberte wrote:
If you are asking whether there can be multiple charts on the same page that don't have to know about each other, you can do that now if you use the latest version.   

There should still only be one load of the loader; if you try to load the loader more than one time, it will throw an error.

There is a documentation page on drawing multlple charts in the same page:  https://developers.google.com/chart/interactive/docs/basic_multiple_charts
On Tue, Sep 20, 2016 at 2:24 PM, Michael X <ma8...@gmail.com> wrote:
hi 


i have been asked to create a chart and allow other programmers to add charts independent of the first chart.
is this possible ?

thanks
Michael

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.



--

Daniel LaLiberte

unread,
Sep 20, 2016, 3:02:21 PM9/20/16
to Google Visualization API
Yes, the documentation page should make it clear how.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages