charts - Android :: BitmapFactrory Cuts off image -


We are trying a prototype using the Google Charts API. http://chart.apis.google.com/chart?chf=bg,s,000000&chxs=0,FFFFFFF00,9.5&chxt=x&chs=500x300&cht = P3 & amp; Chco = 3072F3 FF9900 | 80C65A | 990,066 & amp; nbsp; CHD = T: 50,5,5,40 & amp; Chdl = 50% C2% B0% 20Apples | 5% C2% B0% 20Oranges | 5% C2% B0% 20Dates | 40% C2% B 0% 20 Strawberry and CDLP = B & CP = 0.1

Enter image details here Problem

The problem is that when we look at the chart in the browser, it displays the mythology but when we get the bitmapfactor to an image in an image view or SD card Legends disappear to download (this happens even when the legend is placed above, down, left or right).

Code

  Private bitmap loadchart (URL url) {bitmap chart = zero; Try {HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection (); HttpConnection.setDoInput (true); HttpConnection.connect (); InputStream = httpConnection.getInputStream (); Chart = Bitmap Feature Encodestream (is); } Hold (IOException e) {e.printStackTrace (); } // MediaStore picture. Media. GetContentResolver (), chart, "chart.", "Chart page"); Return chart; }   

Here is an image downloaded from the line commented.

We have also noticed that the dimensions of the chart specified in the URL (CHS = 500x300) matches together also the image dimension.

Enter image details here

URL handles encoding without any extra effort that ends using webview.

Comments