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


Java SimpleSeriesRenderer.setGradientEnabled方法代码示例

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


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

示例1: 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[] values = new double[] { 12, 14, 11, 10, 19 };
  int[] colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN };
  DefaultRenderer renderer = buildCategoryRenderer(colors);
  renderer.setZoomButtonsVisible(true);
  renderer.setZoomEnabled(true);
  renderer.setChartTitleTextSize(20);
  renderer.setDisplayValues(true);
  renderer.setShowLabels(true);
  SimpleSeriesRenderer r = renderer.getSeriesRendererAt(0);
  r.setGradientEnabled(true);
  r.setGradientStart(0, Color.BLUE);
  r.setGradientStop(0, Color.GREEN);
  r.setHighlighted(true);
  Intent intent = ChartFactory.getPieChartIntent(context,
      buildCategoryDataset("Project budget", values), renderer, "Budget");
  return intent;
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:25,代码来源:BudgetPieChart.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) {
  double[] values = new double[] { 12, 14, 11, 10, 19 };
  int[] colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN };
  DefaultRenderer renderer = buildCategoryRenderer(colors);
  renderer.setZoomButtonsVisible(true);
  renderer.setZoomEnabled(true);
  renderer.setChartTitleTextSize(20);
  renderer.setDisplayValues(true);
  renderer.setShowLabels(false);
  SimpleSeriesRenderer r = renderer.getSeriesRendererAt(0);
  r.setGradientEnabled(true);
  r.setGradientStart(0, Color.BLUE);
  r.setGradientStop(0, Color.GREEN);
  r.setHighlighted(true);
  Intent intent = ChartFactory.getPieChartIntent(context,
      buildCategoryDataset("Project budget", values), renderer, "Budget");
  return intent;
}
 
开发者ID:SamKnows,项目名称:skandroid-core,代码行数:25,代码来源:BudgetPieChart.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


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