achartengine - can't figure how to use dates as x axis - the file I save is empty

前端 未结 2 1638
抹茶落季
抹茶落季 2020-11-29 14:11

I have an activity where I take the input from edit text and store it in an list.

I also store in list the current date.

Then , I press the save button which

2条回答
  •  天命终不由人
    2020-11-29 14:55

    for dynamic plots use GraphicalView rather then intent::

     public GraphicalView mChartView;
    

    creat a xml::

    
    
    
    
      
     
    

    then in ur code :

     LinearLayout layout = (LinearLayout) findViewById(R.id.graph);
     mChartView = ChartFactory.mChartView = ChartFactory.getLineChartView(getBaseContext(), dataset, renderer)
     layout.addView(mChartView); 
    
    • After entering values you read from edit text fields right:

    • then you are passing the new values to add in respective arraylists

    • then you should call the code for linegraph again after adding new values and remember to clear series before reading arraylists (ie. dataset.clear();) ie. when line code function starts at beginning add dataset.clear(); because if u dont clear data will overlap and may through exception or line may look thick at old data ...

    then call mChartView.repaint(); to refresh graph

    these links too ll help u link1 link2

提交回复
热议问题