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


Java DefaultRenderer.setBackgroundColor方法代码示例

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


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

示例1: execute

import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的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");
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:24,代码来源:BudgetDoughnutChart.java

示例2: 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; 
}
 
开发者ID:leftdal,项目名称:youslow,代码行数:27,代码来源:PieChart.java

示例3: execute

import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的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");
}
 
开发者ID:InQBarna,项目名称:AChartEngine,代码行数:24,代码来源:BudgetDoughnutChart.java

示例4: 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;

	}
 
开发者ID:asimiqbalmalik,项目名称:DemoDoughnutChartWithTextInside,代码行数:33,代码来源:MainActivity.java

示例5: 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));
  }
 
开发者ID:jeffreyawest,项目名称:android-weblogic-monitor,代码行数:28,代码来源:DefaultPieChart.java

示例6: execute

import org.achartengine.renderer.DefaultRenderer; //导入方法依赖的package包/类
/**
    * This method will generate the correct Android Intent class for pie chart generation, which
    * which will then be used by the caller to call "startActivity()" in order to actually create
    * the pie chart (via the listening third-party library).
    * 
    * @param context     The context of the current application
    * @param screenTitle The title of the pie chart
    * @param statTitles  The respective name of each pie chart section 
    * @param statValues  The respective percentage of each pie chart section
    * @return The Intent that's used to actually create the pie chart.
    */
   public Intent execute(Context context, String screenTitle, String[] statTitles, double[] statValues) {
	
	String[] titles = null;
    double[] values = null;
    int[]    colors = null;
    
    if (statValues != null) {
        values = statValues;
        titles = statTitles;
    }
    else {
    	values = new double[] { 12, 14, 11, 10, 19 };
    	titles = new String[] { "Alpha", "Beta", "Charlie", "Delta", "Epsilon" };
    }
    
    if (values.length == 1)
    	colors = new int[] { Color.BLUE };
    else if (values.length == 2)
        colors = new int[] { Color.BLUE, Color.GREEN };
    else if (values.length == 3)
        colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA };
    else if (values.length == 4)
        colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, };
    else if (values.length == 5)
        colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN };
    else if (values.length == 6)
    	colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN
    		                 , Color.LTGRAY };
    else if (values.length == 7)
    	colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN
                                , Color.LTGRAY, Color.RED };
    else if (values.length == 8)
    	colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN
                                , Color.LTGRAY, Color.RED, Color.GRAY };
    else if (values.length == 9)
    	colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN
                                , Color.LTGRAY, Color.RED, Color.GRAY, Color.DKGRAY };
    else
    	colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN
                                , Color.LTGRAY, Color.RED, Color.GRAY, Color.DKGRAY, Color.rgb(128, 255, 0) };
    
    DefaultRenderer renderer = buildCategoryRenderer(colors);
    
    renderer.setZoomButtonsVisible(false);
    renderer.setZoomEnabled(true);
    
    renderer.setBackgroundColor( Color.BLACK );	    
    renderer.setApplyBackgroundColor(true);
    
    renderer.setChartTitle(screenTitle);
    renderer.setChartTitleTextSize(22);
    	    
    return ChartFactory.getPieChartIntent(context, 
    		                              buildCategoryDataset("Statistics Breakdown", values, titles),
                                          renderer, 
                                          screenTitle);
}
 
开发者ID:jaerith,项目名称:BibliophilePlus_Android,代码行数:69,代码来源:ChartStatsActivity.java


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