當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。