Request timed out

28 views
Skip to first unread message

Cristiano Pinheiro

unread,
Mar 23, 2017, 3:17:13 PM3/23/17
to Google Visualization API
Hi.
I´m trying to do a simple chart using an external URL that returns a JSON:

<html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
    google.load('visualization', '1', {packages:['corechart']});
    google.setOnLoadCallback(desenhaGrafico);
    function desenhaGrafico() {
          var wrapper = new google.visualization.ChartWrapper({
          dataSourceUrl:'https://raw.github.com/caelum/caelum-online/master/google-chart-tools/07-dados.json',
          chartType: 'AreaChart',
          containerId: 'meu_grafico',
          options:{width:900, height:300}
        });
          wrapper.draw();
       }
    </script>
        </head>
        <body>
          <div id="meu_grafico"> </div>
        </body>
</html>

You can check the existence of URL by browser.
I´ve tried other valid URLs, but the result is the same.

But I´m receiving the message
Request timed out
What can be?
Thanks in advance

Daniel LaLiberte

unread,
Mar 23, 2017, 3:40:01 PM3/23/17
to Google Visualization API
When I visit that URL, I get this error message in a box:

Error: Parse error on line 29: ...[ { "v": new Date(2011, 01, 0 ---------------------^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

In strict JSON, you can't use the JavaScript new operator.  Maybe the timeout you see is related to that.

The code you are returning from that URL, even without a syntax error, is not going to work with the ChartWrapper.  At the top, I see: 

google.visualization.Query.setResponse(
{ ...
Which is a function call, not a JSON object.  I believe all you want is the value after your "table" property.


--
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/5093181e-25f7-4c29-a11c-33b0d2fc0370%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Cristiano Pinheiro

unread,
Mar 23, 2017, 3:50:54 PM3/23/17
to google-visua...@googlegroups.com
Hi Daniel.
Thanks for answer.

But I receive the same error in other URL:


<html>
        <head>
          <meta http-equiv="content-type" content="text/html; charset=utf-8">
          <script type="text/javascript" src="https://www.google.com/jsapi"></script>
          <script type="text/javascript">
            google.load('visualization', '1', {packages:['corechart']});
            google.setOnLoadCallback(desenhaGrafico);
            function desenhaGrafico() {
              var wrapper = new google.visualization.ChartWrapper({
                dataSourceUrl:'http://www.improving.com.br/api/test/hits-by-browser',

                chartType: 'AreaChart',
                containerId: 'meu_grafico',
                options:{width:900, height:300}
              });
              wrapper.draw();
            }
          </script>
        </head>
        <body>
          <div id="meu_grafico" />
        </body>
      </html>


And this URL the format is correct.
WHat can be?

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 a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/mMF2u5F53cI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

Daniel LaLiberte

unread,
Mar 23, 2017, 4:20:50 PM3/23/17
to Google Visualization API
I see this error for that new URL:

Action not found

For request 'GET /api/test/hits-by-browser'




To unsubscribe from this group and all its topics, 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.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages