本文整理汇总了Java中org.achartengine.ChartFactory.getDoughnutChartIntent方法的典型用法代码示例。如果您正苦于以下问题:Java ChartFactory.getDoughnutChartIntent方法的具体用法?Java ChartFactory.getDoughnutChartIntent怎么用?Java ChartFactory.getDoughnutChartIntent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.achartengine.ChartFactory
的用法示例。
在下文中一共展示了ChartFactory.getDoughnutChartIntent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.achartengine.ChartFactory; //导入方法依赖的package包/类
/**
* Executes the chart demo.
*
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
List<double[]> values = new ArrayList<double[]>();
values.add(new double[] { 12, 14, 11, 10, 19 });
values.add(new double[] { 10, 9, 14, 20, 11 });
List<String[]> titles = new ArrayList<String[]>();
titles.add(new String[] { "P1", "P2", "P3", "P4", "P5" });
titles.add(new String[] { "Project1", "Project2", "Project3", "Project4", "Project5" });
int[] colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN };
DefaultRenderer renderer = buildCategoryRenderer(colors);
renderer.setApplyBackgroundColor(true);
renderer.setBackgroundColor(Color.rgb(222, 222, 200));
renderer.setLabelsColor(Color.GRAY);
return ChartFactory.getDoughnutChartIntent(context,
buildMultipleCategoryDataset("Project budget", titles, values), renderer,
"Doughnut chart demo");
}
示例2: execute
import org.achartengine.ChartFactory; //导入方法依赖的package包/类
/**
* Executes the chart demo.
*
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
List<double[]> values = new ArrayList<double[]>();
values.add(new double[] { 12, 14, 11, 10, 19 });
values.add(new double[] { 10, 9, 14, 20, 11 });
List<String[]> titles = new ArrayList<String[]>();
titles.add(new String[] { "P1", "P2", "P3", "P4", "P5" });
titles.add(new String[] { "Project1", "Project2", "Project3", "Project4", "Project5" });
int[] colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN };
DefaultRenderer renderer = buildCategoryRenderer(colors);
renderer.setApplyBackgroundColor(true);
renderer.setBackgroundColor(Color.rgb(222, 222, 200));
renderer.setLabelsColor(Color.GRAY);
return ChartFactory.getDoughnutChartIntent(context,
buildMultipleCategoryDataset("Project budget", titles, values), renderer,
"Doughnut chart demo");
}