Android Open Source - CMOV_Stock_Portfolio Pie Graph






From Project

Back to project page CMOV_Stock_Portfolio.

License

The source code is released under:

MIT License

If you think the Android project CMOV_Stock_Portfolio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package opengl;
//w  w  w .  j  a  v  a 2 s  .  c o m
import java.util.ArrayList;

import org.apache.http.NameValuePair;

import android.graphics.PixelFormat;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;

public class PieGraph extends Fragment {

  private GLSurfaceView mView; 
  private PieChart mRenderer;

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    mView = new GLSurfaceView(getActivity().getBaseContext());
    mView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
    mView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
    mView.setZOrderOnTop(true);
    
    mRenderer = new PieChart(null, getActivity().getBaseContext()); 
    //mRenderer = new LineChart(elems, getActivity().getBaseContext());
    mView.setRenderer(mRenderer);
    return mView;
  }
  
  public void drawPie(ArrayList<NameValuePair> elems)
  {
    if(elems!= null && elems.size()>0)
      mRenderer.restart(elems);
  }
  
  public boolean onTouchEvent(MotionEvent event) {
    return mRenderer.onTouchEvent(event); 
  }
}




Java Source Code List

cmov.stock_portfolio.MainActivity.java
cmov.stock_portfolio.Portfolio.java
cmov.stock_portfolio.TickEditActivity.java
cmov.stock_portfolio.TotalPortfolio.java
common.Common.java
common.Network.java
common.Series.java
common.Stock.java
opengl.LineChart.java
opengl.LineGraph.java
opengl.PieChart.java
opengl.PieGraph.java
opengl.text.GLText.java
opengl.text.SpriteBatch.java
opengl.text.TextureRegion.java
opengl.text.Vertices.java