android - Achartengine graph displaying too much space between values -
i trying plot graph using achartengine. can see image, looks quite ugly.i want , 1. reduce space between values. cannot have space since need add more series it. 2. not plotting negative values, why it's showing lines @ bottom. values displayed @ bottom -1.i want eliminate lines @ bottom. 3. if possible, want change background color of graph black other color. thanks. code included working.
string see = pull.trim(); string str = '"' + see + '"'; int[] intarray = new int[str.length()]; for(int i=0; < str.length(); i++){ intarray[i] = character.digit(str.charat(i), 10); } categoryseries series = new categoryseries("my graph"); for(int = 0; <intarray.length; i++){ series.add("bar ", intarray[i]); } xymultipleseriesdataset dataset = new xymultipleseriesdataset(); dataset.addseries(series.toxyseries()); xyseriesrenderer renderer = new xyseriesrenderer(); renderer.setdisplaychartvalues(true); renderer.setchartvaluesspacing((float) 0.1); renderer.setcolor(getresources().getcolor(r.color.fuchsia)); xymultipleseriesrenderer mrenderer = new xymultipleseriesrenderer(); mrenderer.addseriesrenderer(renderer); mrenderer.setcharttitle("my graph"); mrenderer.setytitle("values"); mrenderer.setzoombuttonsvisible(true); linearlayout chart_container=(linearlayout)findviewbyid(r.id.chart_layout); mchart=(graphicalview)chartfactory.getbarchartview(getbasecontext(), dataset, mrenderer, type.default); chart_container.addview(mchart);
i found out bottom negative values showing because there spaces in string plotting graph.so wrote way, helps in future.
string see = pull.replaceall("\\s+",""); int[] intarray = new int[see.length()]; for(int k=0; k < see.length(); k++){ intarray[k] = character.digit(see.charat(k), 10); }
Comments
Post a Comment