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


Java ChartFactory.getTimeChartIntent方法代码示例

本文整理汇总了Java中org.achartengine.ChartFactory.getTimeChartIntent方法的典型用法代码示例。如果您正苦于以下问题:Java ChartFactory.getTimeChartIntent方法的具体用法?Java ChartFactory.getTimeChartIntent怎么用?Java ChartFactory.getTimeChartIntent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.achartengine.ChartFactory的用法示例。


在下文中一共展示了ChartFactory.getTimeChartIntent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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[] { "Sales growth January 1995 to December 2000" };
  List<Date[]> dates = new ArrayList<Date[]>();
  List<double[]> values = new ArrayList<double[]>();
  Date[] dateValues = new Date[] { new Date(95, 0, 1), new Date(95, 3, 1), new Date(95, 6, 1),
      new Date(95, 9, 1), new Date(96, 0, 1), new Date(96, 3, 1), new Date(96, 6, 1),
      new Date(96, 9, 1), new Date(97, 0, 1), new Date(97, 3, 1), new Date(97, 6, 1),
      new Date(97, 9, 1), new Date(98, 0, 1), new Date(98, 3, 1), new Date(98, 6, 1),
      new Date(98, 9, 1), new Date(99, 0, 1), new Date(99, 3, 1), new Date(99, 6, 1),
      new Date(99, 9, 1), new Date(100, 0, 1), new Date(100, 3, 1), new Date(100, 6, 1),
      new Date(100, 9, 1), new Date(100, 11, 1) };
  dates.add(dateValues);

  values.add(new double[] { 4.9, 5.3, 3.2, 4.5, 6.5, 4.7, 5.8, 4.3, 4, 2.3, -0.5, -2.9, 3.2, 5.5,
      4.6, 9.4, 4.3, 1.2, 0, 0.4, 4.5, 3.4, 4.5, 4.3, 4 });
  int[] colors = new int[] { Color.BLUE };
  PointStyle[] styles = new PointStyle[] { PointStyle.POINT };
  XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
  setChartSettings(renderer, "Sales growth", "Date", "%", dateValues[0].getTime(),
      dateValues[dateValues.length - 1].getTime(), -4, 11, Color.GRAY, Color.LTGRAY);
  renderer.setYLabels(10);
  renderer.setXRoundedLabels(false);
  XYSeriesRenderer xyRenderer = (XYSeriesRenderer) renderer.getSeriesRendererAt(0);
  FillOutsideLine fill = FillOutsideLine.BOUNDS_BELOW;
  fill.setColor(Color.MAGENTA);
  xyRenderer.addFillOutsideLine(fill);
  fill = FillOutsideLine.BOUNDS_ABOVE;
  fill.setColor(Color.GREEN);
  xyRenderer.addFillOutsideLine(fill);

  return ChartFactory.getTimeChartIntent(context, buildDateDataset(titles, dates, values),
      renderer, "MMM yyyy");
}
 
开发者ID:InQBarna,项目名称:AChartEngine,代码行数:40,代码来源:SalesGrowthChart.java

示例3: 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[] { "Sales growth January 1995 to December 2000" };
  List<Date[]> dates = new ArrayList<Date[]>();
  List<double[]> values = new ArrayList<double[]>();
  Date[] dateValues = new Date[] { new Date(95, 0, 1), new Date(95, 3, 1), new Date(95, 6, 1),
      new Date(95, 9, 1), new Date(96, 0, 1), new Date(96, 3, 1), new Date(96, 6, 1),
      new Date(96, 9, 1), new Date(97, 0, 1), new Date(97, 3, 1), new Date(97, 6, 1),
      new Date(97, 9, 1), new Date(98, 0, 1), new Date(98, 3, 1), new Date(98, 6, 1),
      new Date(98, 9, 1), new Date(99, 0, 1), new Date(99, 3, 1), new Date(99, 6, 1),
      new Date(99, 9, 1), new Date(100, 0, 1), new Date(100, 3, 1), new Date(100, 6, 1),
      new Date(100, 9, 1), new Date(100, 11, 1) };
  dates.add(dateValues);

  values.add(new double[] { 4.9, 5.3, 3.2, 4.5, 6.5, 4.7, 5.8, 4.3, 4, 2.3, -0.5, -2.9, 3.2, 5.5,
      4.6, 9.4, 4.3, 1.2, 0, 0.4, 4.5, 3.4, 4.5, 4.3, 4 });
  int[] colors = new int[] { Color.BLUE };
  PointStyle[] styles = new PointStyle[] { PointStyle.POINT };
  XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
  setChartSettings(renderer, "Sales growth", "Date", "%", dateValues[0].getTime(),
      dateValues[dateValues.length - 1].getTime(), -4, 11, Color.GRAY, Color.LTGRAY);
  renderer.setYLabels(10);
  renderer.setXLabelMinimumDistance(3. * 30. * 24. * 60. * 60. * 1000.);
  renderer.setYLabelMinimumDistance(0.01, 0);
  renderer.setXZoomMax(3. * 30. * 24. * 60. * 60. * 1000.);
  XYSeriesRenderer xyRenderer = (XYSeriesRenderer) renderer.getSeriesRendererAt(0);
  FillOutsideLine f = FillOutsideLine.BELOW;
  f.setGradient(true);
  f.setColor(0x80000000);
  f.setColor2(0xff0000ff);
  xyRenderer.addFillOutsideLine(f);
  xyRenderer.setPointStyle(PointStyle.CIRCLE);
  xyRenderer.setPointStrokeWidth(3);
  return ChartFactory.getTimeChartIntent(context, buildDateDataset(titles, dates, values),
      renderer, "MMM yyyy");
}
 
开发者ID:InQBarna,项目名称:AChartEngine,代码行数:42,代码来源:SalesGrowthStyledChart.java

示例4: 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[] { "New tickets", "Fixed tickets" };
  List<Date[]> dates = new ArrayList<Date[]>();
  List<double[]> values = new ArrayList<double[]>();
  int length = titles.length;
  for (int i = 0; i < length; i++) {
    dates.add(new Date[12]);
    dates.get(i)[0] = new Date(108, 9, 1);
    dates.get(i)[1] = new Date(108, 9, 8);
    dates.get(i)[2] = new Date(108, 9, 15);
    dates.get(i)[3] = new Date(108, 9, 22);
    dates.get(i)[4] = new Date(108, 9, 29);
    dates.get(i)[5] = new Date(108, 10, 5);
    dates.get(i)[6] = new Date(108, 10, 12);
    dates.get(i)[7] = new Date(108, 10, 19);
    dates.get(i)[8] = new Date(108, 10, 26);
    dates.get(i)[9] = new Date(108, 11, 3);
    dates.get(i)[10] = new Date(108, 11, 10);
    dates.get(i)[11] = new Date(108, 11, 17);
  }
  values.add(new double[] { 142, 123, 142, 152, 149, 122, 110, 120, 125, 155, 146, 150 });
  values.add(new double[] { 102, 90, 112, 105, 125, 112, 125, 112, 105, 115, 116, 135 });
  length = values.get(0).length;
  int[] colors = new int[] { Color.BLUE, Color.GREEN };
  PointStyle[] styles = new PointStyle[] { PointStyle.POINT, PointStyle.POINT };
  XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
  setChartSettings(renderer, "Project work status", "Date", "Tickets", dates.get(0)[0].getTime(),
      dates.get(0)[11].getTime(), 50, 190, Color.GRAY, Color.LTGRAY);
  renderer.setXLabels(0);
  renderer.setYLabels(10);
  renderer.addYTextLabel(100, "test");
  length = renderer.getSeriesRendererCount();
  for (int i = 0; i < length; i++) {
    XYSeriesRenderer seriesRenderer = (XYSeriesRenderer) renderer.getSeriesRendererAt(i);
    seriesRenderer.setDisplayChartValues(true);
  }
  renderer.setXRoundedLabels(false);
  return ChartFactory.getTimeChartIntent(context, buildDateDataset(titles, dates, values),
      renderer, "MM/dd/yyyy");
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:47,代码来源:ProjectStatusChart.java

示例5: 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[] { "New tickets", "Fixed tickets" };
  List<Date[]> dates = new ArrayList<Date[]>();
  List<double[]> values = new ArrayList<double[]>();
  int length = titles.length;
  for (int i = 0; i < length; i++) {
    dates.add(new Date[12]);
    dates.get(i)[0] = new Date(108, 9, 1);
    dates.get(i)[1] = new Date(108, 9, 8);
    dates.get(i)[2] = new Date(108, 9, 15);
    dates.get(i)[3] = new Date(108, 9, 22);
    dates.get(i)[4] = new Date(108, 9, 29);
    dates.get(i)[5] = new Date(108, 10, 5);
    dates.get(i)[6] = new Date(108, 10, 12);
    dates.get(i)[7] = new Date(108, 10, 19);
    dates.get(i)[8] = new Date(108, 10, 26);
    dates.get(i)[9] = new Date(108, 11, 3);
    dates.get(i)[10] = new Date(108, 11, 10);
    dates.get(i)[11] = new Date(108, 11, 17);
  }
  values.add(new double[] { 142, 123, 142, 152, 149, 122, 110, 120, 125, 155, 146, 150 });
  values.add(new double[] { 102, 90, 112, 105, 125, 112, 125, 112, 105, 115, 116, 135 });
  length = values.get(0).length;
  int[] colors = new int[] { Color.BLUE, Color.GREEN };
  PointStyle[] styles = new PointStyle[] { PointStyle.POINT, PointStyle.POINT };
  XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
  setChartSettings(renderer, "Project work status", "Date", "Tickets", dates.get(0)[0].getTime(),
      dates.get(0)[11].getTime(), 50, 190, Color.GRAY, Color.LTGRAY);
  renderer.setXLabels(0);
  renderer.setYLabels(10);
  renderer.addYTextLabel(100, "test");
  length = renderer.getSeriesRendererCount();
  for (int i = 0; i < length; i++) {
    SimpleSeriesRenderer seriesRenderer = renderer.getSeriesRendererAt(i);
    seriesRenderer.setDisplayChartValues(true);
  }
  renderer.setXRoundedLabels(false);
  return ChartFactory.getTimeChartIntent(context, buildDateDataset(titles, dates, values),
      renderer, "MM/dd/yyyy");
}
 
开发者ID:SamKnows,项目名称:skandroid-core,代码行数:47,代码来源:ProjectStatusChart.java

示例6: execute

import org.achartengine.ChartFactory; //导入方法依赖的package包/类
public Intent execute(Context context) {

		String[] titles = new String[] { title };
		List<Date[]> xd = new ArrayList<Date[]>();
		List<double[]> yd = new ArrayList<double[]>();

		int numOfValue = y.size();

		Date[] dates = new Date[numOfValue];
		double[] values = new double[numOfValue];
		
		for (int j = 0; j < numOfValue; j++) {
			dates[j] = new Date(x.get(j));
			values[j] = y.get(j);
		}
		xd.add(dates);
		yd.add(values);

		double minY = Collections.min(y);
		double maxY = Collections.max(y);

		int[] colors = new int[] { Color.GREEN };
		PointStyle[] styles = new PointStyle[] { PointStyle.CIRCLE };
		XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
		int length = renderer.getSeriesRendererCount();
		for (int i = 0; i < length; i++) {
			((XYSeriesRenderer) renderer.getSeriesRendererAt(i)).setFillPoints(true);
		}

		setChartSettings(renderer, title + " from " + vsName, "Time", title,
				x.get(0), x.get(numOfValue - 1), minY * 2
						- maxY, maxY * 2 - minY, Color.LTGRAY, Color.LTGRAY);

		renderer.setXLabels(10);
		renderer.setYLabels(10);
		renderer.setShowGrid(true);
		renderer.setXLabelsAlign(Align.CENTER);
		renderer.setYLabelsAlign(Align.RIGHT);
		Intent intent = ChartFactory.getTimeChartIntent(context,
				buildDateDataset(titles, xd, yd), renderer, "h:mm a");

		return intent;
	}
 
开发者ID:LSIR,项目名称:gsn,代码行数:44,代码来源:SensorValuesChart.java


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