How to Redraw chart with GraphView in Android -


I use this library: For a draw chart in my application. This library is work, but when I want to draw a new chart or not

I look at this link but I do not work:

My code for activity in the draw chart :

  graphviewdata [] newData = new graphviewtata [arraywait .size ()]; Int i = 0; String date_now = ""; For (weight w: arrayWeight) {i + = 1; Date_now = w.getdate (); Date_now = date_now.substring (8); New data [arrayWeight.indexOf (w)] = new graphview data (integer.parseInt (date_enu), w.getWeight ()); } GraphViewSeries Example Series = New GraphViewSeries (newData); ExampleSeries.resetData (newData); GraphView graphView = New LineGraphView (this, "weight"); GraphView.redrawAll (); GraphView.setVerticalLabels (new string [] {"100", "50", "1"}); GraphView.setShowLegend (true); GraphView.setBackgroundColor (Color.GRAY); GraphView.addSeries (exampleSeries); // Data liner layout layout = (linear layout) Find VVBID (RID layout); Layout.addView (graphView);  

If you want to fill the graph with new data, you will see a new graphical object and You do not have to create a new GraphiteView object, just make changes to the data objects of your articles with Resetcata. A closer look in the GraphView-Demos project, is a work example.


Comments