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


Java SimpleSeriesRenderer.setDisplayChartValues方法代码示例

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


在下文中一共展示了SimpleSeriesRenderer.setDisplayChartValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addSampleData

import org.achartengine.renderer.SimpleSeriesRenderer; //导入方法依赖的package包/类
private void addSampleData() {
for (int i = 0; i < mNutrient.getSources().size(); i++) {
	mDataset.add(mNutrient.getSources().get(i), 1);
}
  	int []colors = new int[]{Color.MAGENTA, Color.WHITE, Color.GREEN, Color.CYAN, Color.GRAY, Color.BLUE, Color.RED, Color.YELLOW};
  	for (int i = 0; i < mNutrient.getSources().size(); i++) {
  		SimpleSeriesRenderer r = new SimpleSeriesRenderer();
          r.setColor(colors[i]);
          r.setDisplayBoundingPoints(true);
          r.setDisplayChartValuesDistance(15);
          r.setDisplayChartValues(true);
          r.setChartValuesTextSize(30);
          mRenderer.addSeriesRenderer(r);
  	}
  }
 
开发者ID:alixander,项目名称:NutriHawk,代码行数:16,代码来源:FoodSourcesFragment.java

示例2: execute

import org.achartengine.renderer.SimpleSeriesRenderer; //导入方法依赖的package包/类
/**
 * Executes the chart demo.
 * 
 * @param context the context
 * @return the built intent
 */
public Intent execute(Context context) {
  String[] titles = new String[] { "2007", "2008" };
  List<double[]> values = new ArrayList<double[]>();
  values.add(new double[] { 5230, 7300, 9240, 10540, 7900, 9200, 12030, 11200, 9500, 10500,
      11600, 13500 });
  values.add(new double[] { 14230, 12300, 14240, 15244, 15900, 19200, 22030, 21200, 19500, 15500,
      12600, 14000 });
  int[] colors = new int[] { Color.CYAN, Color.BLUE };
  XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
  renderer.setOrientation(Orientation.VERTICAL);
  setChartSettings(renderer, "Monthly sales in the last 2 years", "Month", "Units sold", 0.5,
      12.5, 0, 24000, Color.GRAY, Color.LTGRAY);
  renderer.setXLabels(1);
  renderer.setYLabels(10);
  renderer.addXTextLabel(1, "Jan");
  renderer.addXTextLabel(3, "Mar");
  renderer.addXTextLabel(5, "May");
  renderer.addXTextLabel(7, "Jul");
  renderer.addXTextLabel(10, "Oct");
  renderer.addXTextLabel(12, "Dec");
  int length = renderer.getSeriesRendererCount();
  for (int i = 0; i < length; i++) {
    SimpleSeriesRenderer seriesRenderer = renderer.getSeriesRendererAt(i);
    seriesRenderer.setDisplayChartValues(true);
  }
  return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
      Type.DEFAULT);
}
 
开发者ID:SamKnows,项目名称:skandroid-core,代码行数:35,代码来源:SalesBarChart.java

示例3: execute

import org.achartengine.renderer.SimpleSeriesRenderer; //导入方法依赖的package包/类
/**
 * Executes the chart demo.
 * 
 * @param context the context
 * @return the built intent
 */
public Intent execute(Context context) {
  double[] minValues = new double[] { -24, -19, -10, -1, 7, 12, 15, 14, 9, 1, -11, -16 };
  double[] maxValues = new double[] { 7, 12, 24, 28, 33, 35, 37, 36, 28, 19, 11, 4 };

  XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
  RangeCategorySeries series = new RangeCategorySeries("Temperature");
  int length = minValues.length;
  for (int k = 0; k < length; k++) {
    series.add(minValues[k], maxValues[k]);
  }
  dataset.addSeries(series.toXYSeries());
  int[] colors = new int[] { Color.CYAN };
  XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
  setChartSettings(renderer, "Monthly temperature range", "Month", "Celsius degrees", 0.5, 12.5,
      -30, 45, Color.GRAY, Color.LTGRAY);
  renderer.setBarSpacing(0.5);
  renderer.setXLabels(0);
  renderer.setYLabels(10);
  renderer.addXTextLabel(1, "Jan");
  renderer.addXTextLabel(3, "Mar");
  renderer.addXTextLabel(5, "May");
  renderer.addXTextLabel(7, "Jul");
  renderer.addXTextLabel(10, "Oct");
  renderer.addXTextLabel(12, "Dec");
  renderer.addYTextLabel(-25, "Very cold");
  renderer.addYTextLabel(-10, "Cold");
  renderer.addYTextLabel(5, "OK");
  renderer.addYTextLabel(20, "Nice");
  renderer.setMargins(new int[] {30, 70, 10, 0});
  renderer.setYLabelsAlign(Align.RIGHT);
  SimpleSeriesRenderer r = renderer.getSeriesRendererAt(0);
  r.setDisplayChartValues(true);
  r.setChartValuesTextSize(12);
  r.setChartValuesSpacing(3);
  r.setGradientEnabled(true);
  r.setGradientStart(-20, Color.BLUE);
  r.setGradientStop(20, Color.GREEN);
  return ChartFactory.getRangeBarChartIntent(context, dataset, renderer, Type.DEFAULT,
      "Temperature range");
}
 
开发者ID:SamKnows,项目名称:skandroid-core,代码行数:47,代码来源:TemperatureChart.java

示例4: execute

import org.achartengine.renderer.SimpleSeriesRenderer; //导入方法依赖的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


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