2017년 3월 5일 일요일

limit on the URL length for the Google Chart API(deprecated)



Continuous to my question before: Unable to show chart correctly

I read the web below. 
https://developers.google.com/chart/image/faq
Is there a limit on the URL length for the Google Chart API? What is the maximum URL length?
The maximum length of a URL is not determined by the Google Chart API, but rather by web browser and web server considerations. The longest URL that Google accepts in a chart GET request is 2048 characters in length, after URL-encoding (e.g., | becomes %7C). For POST, this limit is 16K.

I have no much knowledge on http or javascript.  So I unable to use the Google Chart API(non deprecated version) in app inventor. But I would like to maximize the query record in Google Chart API(deprecated) . If I am not wrong , I guess the method I using is GET method. So the longest URL limited to 2048 characters. 
Like this in app inventor : call webviewer1.GoToUrl
http://chart.googleapis.com/chart?cht=lc&chs=350x300&chd=t:20,35,10,10|30,55,25,5&chxr=1,0,200&chds=0,200&chco=0A8C8A,EBB671&chbh=a,0&chxt=x,y&chxl=0:|Pizza|Pasta|Pide|Salad&chdl=Systolic|Diastolic&chg=0,5 

So is it possible to use POST method in App Inventor 2? If it is not possible I have to limit the query record size to eliminate the record exceed problem.

--
generally you can use the Post method in App Inventor, but your example is a Get example, which means in your case you can't
your URL currently has 214 characters, you still have some space...

--
This is only the example I show for reference . There is 4 records now . But I expect my app would query 1000 or more records in final. So the limited in URL length would be exceeded in entire method. So I am seeking better method to overcome the limitation.

-- 
you might want to take a look at http://www.chartjs.org/
I have a pie chart example here https://puravidaapps.com/pie.php
other chart types are also available there...

--

댓글 없음:

댓글 쓰기