estoy siguiendo an example in this link y creó una clase de la siguiente maneraachartengine Android gráfico circular sencilla
public class aChartExample {
public Intent execute(Context context) {
int[] colors = new int[] { Color.RED, Color.YELLOW, Color.BLUE };
DefaultRenderer renderer = buildCategoryRenderer(colors);
CategorySeries categorySeries = new CategorySeries("Vehicles Chart");
categorySeries.add("cars ", 30);
categorySeries.add("trucks", 20);
categorySeries.add("bikes ", 60);
return ChartFactory.getPieChartIntent(context, categorySeries, renderer, null);
}
protected DefaultRenderer buildCategoryRenderer(int[] colors) {
DefaultRenderer renderer = new DefaultRenderer();
for (int color : colors) {
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
renderer.addSeriesRenderer(r);
}
return renderer;
}
}
y lo estoy llamando cuando mi aplicación se inicia en mi actividad de partida en el onCreate.
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mainpage);
Intent achartIntent = new aChartExample().execute(this);
startActivity(achartIntent);
}
Luego incluí el achartengine-0.6.0.jar en mi proyecto.
Cuando ejecuto la aplicación, se bloquea en la línea startActivity.
No estoy seguro de dónde ir desde aquí.
Su ejemplo fue extremadamente simple y útil. Gracias. :) – Enrichman