本文整理汇总了Java中org.achartengine.renderer.DefaultRenderer.setMargins方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultRenderer.setMargins方法的具体用法?Java DefaultRenderer.setMargins怎么用?Java DefaultRenderer.setMargins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.achartengine.renderer.DefaultRenderer
的用法示例。
在下文中一共展示了DefaultRenderer.setMargins方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPieChart
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
private Intent createPieChart() {
DefaultRenderer renderer = new DefaultRenderer();
renderer.setLabelsTextSize(getResources().getDimension(R.dimen.report_labels_text_size));
renderer.setLegendTextSize(getResources().getDimension(R.dimen.report_legend_text_size));
renderer.setMargins(new int[] { 0, 0, 0, 0 });
ReportData report = currentReport.getReportForChart(db, WhereFilter.copyOf(filter));
CategorySeries series = new CategorySeries("AAA");
long total = Math.abs(report.total.amount)+Math.abs(report.total.balance);
int[] colors = generateColors(2*report.units.size());
int i = 0;
for (GraphUnit unit : report.units) {
addSeries(series, renderer, unit.name, unit.getIncomeExpense().income, total, colors[i++]);
addSeries(series, renderer, unit.name, unit.getIncomeExpense().expense, total, colors[i++]);
}
renderer.setZoomButtonsVisible(true);
renderer.setZoomEnabled(true);
renderer.setChartTitleTextSize(20);
return ChartFactory.getPieChartIntent(ReportActivity.this, series, renderer, getString(R.string.report));
}
示例2: 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;
}
示例3: 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;
}
示例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: DefaultPieChart
import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
public DefaultPieChart()
{
mRenderer = new DefaultRenderer();
mSeries = new CategorySeries("");
mRenderer.setBackgroundColor(Color.BLACK);
mRenderer.setApplyBackgroundColor(false);
mRenderer.setExternalZoomEnabled(false);
mRenderer.setZoomEnabled(false);
mRenderer.setInScroll(false);
mRenderer.setShowLabels(false);
mRenderer.setShowLegend(false);
mRenderer.setZoomButtonsVisible(false);
mRenderer.setPanEnabled(false);
mRenderer.setClickEnabled(false);
mRenderer.setScale(Charting.PIE_CHART_SCALE);
mRenderer.setLabelsColor(Color.BLACK);
mRenderer.setStartAngle(90);
mRenderer.setMargins(WebLogicMonitor.getInstance().getResources().getIntArray(R.array.chart_margins));
// mRenderer.setBackgroundColor(WebLogicMonitor.getInstance().getResources().getColor(R.color.chart_background));
// mRenderer.setChartTitleTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_title_size));
// mRenderer.setLabelsTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_label_size));
// mRenderer.setLegendHeight((int) WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_legend_height));
// mRenderer.setLegendTextSize(WebLogicMonitor.getInstance().getResources().getDimension(R.dimen.entity_chart_legend_text_size));
}