本文整理匯總了Java中org.achartengine.ChartFactory.getScatterChartIntent方法的典型用法代碼示例。如果您正苦於以下問題:Java ChartFactory.getScatterChartIntent方法的具體用法?Java ChartFactory.getScatterChartIntent怎麽用?Java ChartFactory.getScatterChartIntent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.achartengine.ChartFactory
的用法示例。
在下文中一共展示了ChartFactory.getScatterChartIntent方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onListItemClick
import org.achartengine.ChartFactory; //導入方法依賴的package包/類
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
switch (position) {
case 0:
Intent intent = ChartFactory.getLineChartIntent(this, getDemoDataset(), getDemoRenderer());
startActivity(intent);
break;
case 1:
intent = ChartFactory.getScatterChartIntent(this, getDemoDataset(), getDemoRenderer());
startActivity(intent);
break;
case 2:
intent = ChartFactory.getTimeChartIntent(this, getDateDemoDataset(), getDemoRenderer(), null);
startActivity(intent);
break;
case 3:
XYMultipleSeriesRenderer renderer = getBarDemoRenderer();
setChartSettings(renderer);
intent = ChartFactory.getBarChartIntent(this, getBarDemoDataset(), renderer, Type.DEFAULT);
startActivity(intent);
break;
}
}
示例2: execute
import org.achartengine.ChartFactory; //導入方法依賴的package包/類
/**
* Executes the chart demo.
*
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
String[] titles = new String[] { "Series 1", "Series 2", "Series 3", "Series 4", "Series 5" };
List<double[]> x = new ArrayList<double[]>();
List<double[]> values = new ArrayList<double[]>();
int count = 20;
int length = titles.length;
Random r = new Random();
for (int i = 0; i < length; i++) {
double[] xValues = new double[count];
double[] yValues = new double[count];
for (int k = 0; k < count; k++) {
xValues[k] = k + r.nextInt() % 10;
yValues[k] = k * 2 + r.nextInt() % 10;
}
x.add(xValues);
values.add(yValues);
}
int[] colors = new int[] { Color.BLUE, Color.CYAN, Color.MAGENTA, Color.LTGRAY, Color.GREEN };
PointStyle[] styles = new PointStyle[] { PointStyle.X, PointStyle.DIAMOND, PointStyle.TRIANGLE,
PointStyle.SQUARE, PointStyle.CIRCLE };
XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
setChartSettings(renderer, "Scatter chart", "X", "Y", -10, 30, -10, 51, Color.GRAY,
Color.LTGRAY);
renderer.setXLabels(10);
renderer.setYLabels(10);
length = renderer.getSeriesRendererCount();
for (int i = 0; i < length; i++) {
((XYSeriesRenderer) renderer.getSeriesRendererAt(i)).setFillPoints(true);
}
return ChartFactory.getScatterChartIntent(context, buildDataset(titles, x, values), renderer);
}