How do I refresh the PieGraph values?

Issue #56 resolved
Eugene Horan created an issue

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)

  1. Eugene Horan 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);
    
  2. Eugene Horan reporter

    @sbaar I have been using pg.invalidate(); But it still updates the graph not lining up to the values.

  3. Log in to comment