Use the data obtained in the parse of my Web Service to transform into a graph in Android

1

I have a web service that returns me some values, for example, the answer to my parse is now:

TheparsethatIdidtogetthefilteredvalueswasthis:

StringvalFormaOutros=doc.getElementsByTagName("VALOR").item(0).getTextContent();

    String descForma = doc.getElementsByTagName("DESCRICAO").item(0).getTextContent();
    String valForma = doc.getElementsByTagName("VALOR").item(1).getTextContent();
    String descForma1 = doc.getElementsByTagName("DESCRICAO").item(1).getTextContent();
    String valForma1 = doc.getElementsByTagName("VALOR").item(2).getTextContent();
    String descForma2 = doc.getElementsByTagName("DESCRICAO").item(2).getTextContent();
    String valForma2 = doc.getElementsByTagName("VALOR").item(3).getTextContent();
    String descForma3 = doc.getElementsByTagName("DESCRICAO").item(3).getTextContent();
    String valForma3 = doc.getElementsByTagName("VALOR").item(4).getTextContent();
    String descForma4 = doc.getElementsByTagName("DESCRICAO").item(4).getTextContent();
    String valForma4 = doc.getElementsByTagName("VALOR").item(5).getTextContent();
    String descForma5 = doc.getElementsByTagName("DESCRICAO").item(5).getTextContent();
    String valForma5 = doc.getElementsByTagName("VALOR").item(6).getTextContent();


    FormasDePagamento.tvFormas.setText("Outros: "+ valFormaOutros+ "\n"+ descForma + ": " + valForma + "\n" + descForma1 + ": " + valForma1 + "\n" + descForma2 + ": " + valForma2 + "\n" + descForma3 + ": " + valForma3 + "\n" + descForma4 + ": " + valForma4 + "\n" + descForma5 + ": " + valForma5);

So it returns me these print values above ..

Now, I would like to re-use this data to form a pie chart so that my customers can see the indicators with greater accuracy. Does anyone have an idea of what can be done, or even redone?

    
asked by anonymous 29.09.2014 / 15:21

1 answer

1

You can use HoloGraphLibrary. I have never used it but it seems to be simple. link

In github you have this example:

PieGraph pg = (PieGraph)findViewById(R.id.graph);
PieSlice slice = new PieSlice();
slice.setColor(Color.parseColor("#99CC00"));
slice.setValue(2);
pg.addSlice(slice);
slice = new PieSlice();
slice.setColor(Color.parseColor("#FFBB33"));
slice.setValue(3);
pg.addSlice(slice);
slice = new PieSlice();
slice.setColor(Color.parseColor("#AA66CC"));
slice.setValue(8);
pg.addSlice(slice);
    
01.10.2014 / 01:09