当前位置: 首页>>代码示例>>Java>>正文


Java ChartFactory.getScatterChartIntent方法代码示例

本文整理汇总了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;
  }
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:25,代码来源:GeneratedChartDemo.java

示例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);
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:38,代码来源:ScatterChart.java


注:本文中的org.achartengine.ChartFactory.getScatterChartIntent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。