How do I refresh the PieGraph values?
Issue #56
resolved
I have implemented the pie graph and have it working, but when I update a data change the graph does not match the data that is implemented unless I leave the activity and return. Any recommendations on solving this issue?
The graphs HoloGraphLibrary is one of my favorites. I hope to hear back.
Comments (7)
-
repo owner -
reporter String eD1 = caloriesConsumed.getText().toString(); item_1 = Integer.parseInt(eD1); String eD2 = caloriesLeft.getText().toString(); item_2 = Integer.parseInt(eD2); PieGraph pg = (PieGraph) findViewById(R.id.graph); slice = new PieSlice(); slice.setValue(item_1); pg.addSlice(slice); slice.setColor(Color.parseColor("#E5BB00")); slice = new PieSlice(); slice.setValue(item_2); slice.setColor(Color.parseColor("#AA66CC")); pg.addSlice(slice); pg.setInnerCircleRatio(200);
-
reporter Does that answer your question?
-
pg.invalidate();
-
reporter @sbaar I have been using pg.invalidate(); But it still updates the graph not lining up to the values.
-
reporter @danielnadeau I have solved the issue. I had to use .forceLayout();
-
reporter - changed status to resolved
I had to use .forceLayout();
- Log in to comment
Did you add a new slice to the graph or edit the slice values directly?
Daniel Nadeau https://plus.google.com/115851497099470446107/about daniel.nadeau01@gmail.com