本文整理汇总了Java中org.achartengine.renderer.DefaultRenderer.addSeriesRenderer方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultRenderer.addSeriesRenderer方法的具体用法?Java DefaultRenderer.addSeriesRenderer怎么用?Java DefaultRenderer.addSeriesRenderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.achartengine.renderer.DefaultRenderer
的用法示例。
在下文中一共展示了DefaultRenderer.addSeriesRenderer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildCategoryRenderer
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
protected DefaultRenderer buildCategoryRenderer(int[] colors){
DefaultRenderer renderer = new DefaultRenderer();
renderer.setBackgroundColor(Color.BLACK);
renderer.setApplyBackgroundColor(true);
renderer.setLabelsColor(Color.WHITE);
renderer.setDisplayValues(true);
renderer.setPanEnabled(false);
renderer.setZoomEnabled(false);
renderer.setInScroll(true);
renderer.setChartTitle(chartTitle);
// Changing font size
renderer.setLabelsTextSize(26);
renderer.setLegendTextSize(26);
renderer.setLegendHeight(50);
renderer.setChartTitleTextSize(28);
for (int color : colors) {
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
r.setChartValuesFormat(NumberFormat.getPercentInstance());
renderer.addSeriesRenderer(r);
}
return renderer;
}
示例2: addSeries
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
private void addSeries(CategorySeries series, DefaultRenderer renderer, String name, BigDecimal expense, long total, int color) {
long amount = expense.longValue();
if (amount != 0 && total != 0) {
long percentage = 100*Math.abs(amount)/total;
series.add((amount > 0 ? "+" : "-") + name + "(" + percentage + "%)", percentage);
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
renderer.addSeriesRenderer(r);
}
}
示例3: getDonutRenderer
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
public DefaultRenderer getDonutRenderer(int[] colors, int b) {
DefaultRenderer renderer = new DefaultRenderer();
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(15);
renderer.setMargins(new int[] { 20, 30, 15, 0 });
renderer.setApplyBackgroundColor(true);
renderer.setBackgroundColor(b);
Log.d("colors", "" + colors[0]);
for (int color : colors) {
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
renderer.addSeriesRenderer(r);
}
renderer.setLabelsColor(Color.GRAY);
renderer.setZoomEnabled(false);
renderer.setZoomButtonsVisible(false);
renderer.setShowLabels(false);
renderer.setPanEnabled(false);
renderer.setShowLegend(false);
renderer.setApplyBackgroundColor(false);
renderer.setMargins(new int[] { 0, 0, 0, 0 });
renderer.setInScroll(true);
return renderer;
}
示例4: buildCategoryRenderer
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
/**
* Builds a category renderer to use the provided colors.
*
* @param colors the colors
* @return the category renderer
*/
protected DefaultRenderer buildCategoryRenderer(int[] colors) {
DefaultRenderer renderer = new DefaultRenderer();
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(15);
renderer.setMargins(new int[] { 20, 30, 15, 0 });
for (int color : colors) {
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
renderer.addSeriesRenderer(r);
}
return renderer;
}
示例5: buildCategoryRenderer
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
/**
* Builds a category renderer to use the provided colors.
*
* @param colors
* the colors
* @return the category renderer
*/
protected DefaultRenderer buildCategoryRenderer(int[] colors) {
DefaultRenderer renderer = new DefaultRenderer();
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(15);
renderer.setMargins(new int[] { 20, 30, 15, 0 });
for (int color : colors) {
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
renderer.addSeriesRenderer(r);
}
return renderer;
}
示例6: updatePieChart
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
private void updatePieChart() {
DefaultRenderer pieRenderer = new DefaultRenderer();
SimpleSeriesRenderer correctRenderer = new SimpleSeriesRenderer();
SimpleSeriesRenderer wrongRenderer = new SimpleSeriesRenderer();
correctRenderer.setColor(correctColor);
wrongRenderer.setColor(wrongColor);
pieRenderer.addSeriesRenderer(correctRenderer);
pieRenderer.addSeriesRenderer(wrongRenderer);
if (!Themes.get(getContext()).isThemeDark()) {
pieRenderer.setLabelsColor(Color.DKGRAY);
} else {
pieRenderer.setLabelsColor(Color.WHITE);
}
pieRenderer.setLabelsTextSize(spToPixels(14));
pieRenderer.setShowLegend(false);
pieRenderer.setZoomEnabled(false);
pieRenderer.setPanEnabled(false);
pieRenderer.setChartTitleTextSize(spToPixels(20));
pieRenderer.setStartAngle(45);
pieRenderer.setScale(1.1f);
CategorySeries data = new CategorySeries("Overview");
data.add(playStats.getTotalCorrect() + " Correct", playStats.getTotalCorrect());
data.add(playStats.getTotalWrong() + " Wrong", playStats.getTotalWrong());
pieChartView = ChartFactory.getPieChartView(getContext(), data, pieRenderer);
pieLayout.removeAllViews();
pieLayout.addView(pieChartView);
}
示例7: buildCategoryRenderer
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
/**
* Builds a category renderer to use the provided colors.
* @param colors the colors
* @return the category renderer
*/
protected DefaultRenderer buildCategoryRenderer(int[] colors) {
DefaultRenderer renderer = new DefaultRenderer();
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(15);
renderer.setMargins(new int[] { 20, 30, 15, 0 });
for (int color : colors) {
SimpleSeriesRenderer r = new SimpleSeriesRenderer();
r.setColor(color);
renderer.addSeriesRenderer(r);
}
return renderer;
}