當前位置: 首頁>>代碼示例>>Java>>正文


Java XYMultipleSeriesRenderer.setLabelsColor方法代碼示例

本文整理匯總了Java中org.achartengine.renderer.XYMultipleSeriesRenderer.setLabelsColor方法的典型用法代碼示例。如果您正苦於以下問題:Java XYMultipleSeriesRenderer.setLabelsColor方法的具體用法?Java XYMultipleSeriesRenderer.setLabelsColor怎麽用?Java XYMultipleSeriesRenderer.setLabelsColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.achartengine.renderer.XYMultipleSeriesRenderer的用法示例。


在下文中一共展示了XYMultipleSeriesRenderer.setLabelsColor方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setChartSettings

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
protected void setChartSettings(XYMultipleSeriesRenderer renderer, String xTitle, String yTitle,
                                double xMin, double xMax, double yMin, double yMax, int axesColor, int labelsColor) {
    //有關對圖表的渲染可參看api文檔
    renderer.setChartTitle(mTitle);
    renderer.setXTitle(xTitle);
    renderer.setYTitle(yTitle);
    renderer.setXAxisMin(xMin);
    renderer.setXAxisMax(xMax);
    renderer.setYAxisMin(yMin);
    renderer.setYAxisMax(yMax);
    renderer.setAxesColor(axesColor);
    renderer.setLabelsColor(labelsColor);
    renderer.setShowGrid(true);
    renderer.setGridColor(Color.GREEN);
    renderer.setXLabels(20);
    renderer.setYLabels(10);
    renderer.setXTitle("Time");
    renderer.setYTitle("  ");
    renderer.setYLabelsAlign(Paint.Align.RIGHT);
    renderer.setPointSize((float) 3);
    renderer.setShowLegend(false);
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:23,代碼來源:HeartBeatFragment.java

示例2: configureRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
 * Set some ChartView settings
 * 
 * @param XYRenderer
 */
private void configureRenderer(XYMultipleSeriesRenderer XYRenderer)
{
    XYRenderer.setAxesColor(Color.LTGRAY);
    XYRenderer.setLabelsColor(Color.LTGRAY);
    XYRenderer.setZoomEnabled(false, false);
    XYRenderer.setAxisTitleTextSize(16);
    XYRenderer.setChartTitleTextSize(20);
    XYRenderer.setLabelsTextSize(15);
    XYRenderer.setLegendTextSize(15);
    XYRenderer.setPointSize(5f);
    int margin = mContext.getResources().getDimensionPixelSize(R.dimen.chart_title_margin);
    XYRenderer.setMargins(new int[] {margin, margin, margin, margin});
    XYRenderer.setShowGrid(true);
    XYRenderer.setXLabelsAlign(Align.RIGHT);
    XYRenderer.setYLabels(20);
    // if in ScrollView, need set
    XYRenderer.setInScroll(true);
}
 
開發者ID:EspressifApp,項目名稱:IOT-Espressif-Android,代碼行數:24,代碼來源:EspChartFactory.java

示例3: setUpRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void setUpRenderer(Activity activity) {
    mRenderer = new XYMultipleSeriesRenderer();
    // We want to avoid black border
    mRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent margins
    // Disable Pan on two axis
    mRenderer.setPanEnabled(true, false);
    mRenderer.setZoomEnabled(true, false);
    mRenderer.setLabelsTextSize(getDPI(15));
    mRenderer.setXLabelsColor(ContextCompat.getColor(activity,R.color.colorWhite));
    mRenderer.setYLabelsColor(0, ContextCompat.getColor(activity,R.color.colorWhite));
    mRenderer.setLabelsColor(ContextCompat.getColor(activity,R.color.colorWhite));
    mRenderer.setAxesColor(ContextCompat.getColor(activity,R.color.colorWhite));

    mRenderer.setShowGrid(true); // we show the grid
    mRenderer.setXLabels(0);
}
 
開發者ID:blackcj,項目名稱:GoogleFitExample,代碼行數:17,代碼來源:MultipleLineGraphs.java

示例4: buildRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private XYMultipleSeriesRenderer buildRenderer(Context context) {
    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
    renderer.setAxisTitleTextSize(16);
    renderer.setChartTitleTextSize(0);
    renderer.setLabelsTextSize(15);
    renderer.setLegendTextSize(20);
    renderer.setLegendHeight(22);
    renderer.setPointSize(5f);
    renderer.setMargins(new int[] { 20, 30, 15, 20 });
    renderer.setChartTitle("");
    renderer.setXTitle(context.getResources().getString(R.string.X));
    renderer.setYTitle(context.getResources().getString(R.string.Y));
    renderer.setXAxisMin(Graph.MIN_HEIGHT_X);
    renderer.setXAxisMax(Graph.MAX_HEIGHT_X);
    renderer.setYAxisMin(Graph.MIN_HEIGHT_Y);
    renderer.setYAxisMax(Graph.MAX_HEIGHT_Y);
    renderer.setAxesColor(Color.GRAY);
    renderer.setLabelsColor(Color.LTGRAY);
    renderer.setYLabelsAlign(Align.RIGHT);
    renderer.setXLabels(20);
    renderer.setYLabels(20);
    renderer.setPanEnabled(true);
    renderer.setZoomEnabled(true);
    renderer.setShowGrid(true);
    renderer.setXAxisBold(true);
    renderer.setYAxisBold(true);
    renderer.setZoomButtonsVisible(false);
    renderer.setExternalZoomEnabled(true);
    XYSeriesRenderer r = new XYSeriesRenderer();
    r.setColor(context.getResources().getColor(R.color.graph_color));
    r.setPointStyle(PointStyle.POINT);
    r.setLineWidth(4f);
    renderer.addSeriesRenderer(r);
    return renderer;
}
 
開發者ID:gigabytedevelopers,項目名稱:CalcMate,代碼行數:36,代碼來源:Graph.java

示例5: LineGraphView

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
 * This constructor will set some properties of single chart and some properties of whole graph
 */
public LineGraphView() {
	//add single line chart mSeries
	mDataset.addSeries(mSeries);

	//XYSeriesRenderer is used to set the properties like chart color, style of each point, etc. of single chart
	final XYSeriesRenderer seriesRenderer = new XYSeriesRenderer();
	//set line chart color to Black
	seriesRenderer.setColor(Color.BLACK);
	//set line chart style to square points
	seriesRenderer.setPointStyle(PointStyle.SQUARE);
	seriesRenderer.setFillPoints(true);

	final XYMultipleSeriesRenderer renderer = mMultiRenderer;
	//set whole graph background color to transparent color
	renderer.setBackgroundColor(Color.TRANSPARENT);
	renderer.setMargins(new int[] { 50, 65, 40, 5 }); // top, left, bottom, right
	renderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
	renderer.setAxesColor(Color.BLACK);
	renderer.setAxisTitleTextSize(24);
	renderer.setShowGrid(true);
	renderer.setGridColor(Color.LTGRAY);
	renderer.setLabelsColor(Color.BLACK);
	renderer.setYLabelsColor(0, Color.DKGRAY);
	renderer.setYLabelsAlign(Align.RIGHT);
	renderer.setYLabelsPadding(4.0f);
	renderer.setXLabelsColor(Color.DKGRAY);
	renderer.setLabelsTextSize(20);
	renderer.setLegendTextSize(20);
	//Disable zoom
	renderer.setPanEnabled(false, false);
	renderer.setZoomEnabled(false, false);
	//set title to x-axis and y-axis
	renderer.setXTitle("    Time (seconds)");
	renderer.setYTitle("               BPM");
	renderer.addSeriesRenderer(seriesRenderer);
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:40,代碼來源:LineGraphView.java

示例6: buildRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
 * Build ECG Chart renderer.
 * @return ecg chart renderer
 */
private XYMultipleSeriesRenderer buildRenderer() {

    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

    for (int i = 0; i < DATA_COUNT; i++) {
        XYSeriesRenderer r = new XYSeriesRenderer();
        r.setColor(COLORS[i]);
        r.setLineWidth(4f);
        r.setPointStyle(PointStyle.CIRCLE);
        r.setFillPoints(true);
        r.setPointStrokeWidth(1f);
        renderer.addSeriesRenderer(r);
    }

    renderer.setPointSize(1f);
    renderer.setChartTitle("心電");
    renderer.setChartTitleTextSize(CHART_TITLE_SIZE);

    renderer.setXTitle("経過時間 [ms]");
    renderer.setYTitle("                [μv]");

    renderer.setLabelsTextSize(LABELS_SIZE);
    renderer.setLabelsColor(TITLE_COLOR);
    renderer.setXLabelsAlign(Paint.Align.LEFT);
    renderer.setYLabelsAlign(Paint.Align.RIGHT);

    renderer.setXLabelsColor(XLABEL_COLOR);
    renderer.setYLabelsColor(0, YLABEL_COLOR);

    renderer.setAxisTitleTextSize(AXIS_TITLE_SIZE);
    renderer.setAxesColor(AXIS_COLOR);
    renderer.setXAxisMin(mMinX);
    renderer.setXAxisMax(mMaxX);
    renderer.setYAxisMin(-3.0);
    renderer.setYAxisMax(3.0);

    renderer.setShowGridX(true);
    renderer.setShowGridY(true);
    renderer.setGridColor(GRID_COLOR);

    renderer.setApplyBackgroundColor(true);
    renderer.setBackgroundColor(Color.BLACK);

    renderer.setMargins(new int[] {16, 48, 16, 8 });
    renderer.setMarginsColor(Color.argb(0, 255, 255, 255));
    renderer.setPanEnabled(false, false);
    renderer.setShowLegend(true);
    renderer.setLegendTextSize(15);
    renderer.setFitLegend(false);

    renderer.setZoomButtonsVisible(false);
    renderer.setZoomEnabled(false, false);

    return renderer;
}
 
開發者ID:DeviceConnect,項目名稱:DeviceConnect-Android,代碼行數:60,代碼來源:HitoeProfileECGFragment.java

示例7: buildRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
 * Build chart's renderer.
 * @return chart renderer
 */
private XYMultipleSeriesRenderer buildRenderer() {

    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
    for (int i = 0; i < DATA_COUNT; i++) {
        XYSeriesRenderer r = new XYSeriesRenderer();
        r.setColor(COLORS[i]);
        r.setLineWidth(4f);
        r.setPointStyle(PointStyle.CIRCLE);
        r.setFillPoints(true);
        r.setPointStrokeWidth(1f);
        renderer.addSeriesRenderer(r);
    }

    renderer.setPointSize(1f);
    renderer.setChartTitle("加速度");
    renderer.setChartTitleTextSize(CHART_TITLE_SIZE);

    renderer.setXTitle("経過時間 [ms]");
    renderer.setYTitle("                [G]");

    renderer.setLabelsTextSize(LABELS_SIZE);
    renderer.setLabelsColor(TITLE_COLOR);
    renderer.setXLabelsAlign(Paint.Align.LEFT);
    renderer.setYLabelsAlign(Paint.Align.RIGHT);

    renderer.setXLabelsColor(XLABEL_COLOR);
    renderer.setYLabelsColor(0, YLABEL_COLOR);

    renderer.setAxisTitleTextSize(AXIS_TITLE_SIZE);
    renderer.setAxesColor(AXIS_COLOR);
    renderer.setXAxisMin(mMinX);
    renderer.setXAxisMax(mMaxX);
    renderer.setYAxisMin(-3.0);
    renderer.setYAxisMax(3.0);

    renderer.setShowGridX(true);
    renderer.setShowGridY(true);
    renderer.setGridColor(GRID_COLOR);

    renderer.setApplyBackgroundColor(true);
    renderer.setBackgroundColor(Color.WHITE);

    renderer.setMargins(new int[] {16, 48, 16, 8 });
    renderer.setMarginsColor(Color.argb(0, 255, 255, 255));

    renderer.setPanEnabled(false, false);

    renderer.setShowLegend(true);
    renderer.setLegendTextSize(15);
    renderer.setFitLegend(false);

    renderer.setZoomButtonsVisible(false);

    renderer.setZoomEnabled(false, false);

    return renderer;
}
 
開發者ID:DeviceConnect,項目名稱:DeviceConnect-Android,代碼行數:62,代碼來源:HitoeProfileDeviceOrientationFragment.java

示例8: execute

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
 * Executes the chart demo.
 * 
 * @param context the context
 * @return the built intent
 */
public Intent execute(Context context) {
  String[] titles = new String[] { "Air temperature" };
  List<double[]> x = new ArrayList<double[]>();
  x.add(new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 });
  List<double[]> values = new ArrayList<double[]>();
  values.add(new double[] { 12.3, 12.5, 13.8, 16.8, 20.4, 24.4, 26.4, 26.1, 23.6, 20.3, 17.2,
      13.9 });
  int[] colors = new int[] { Color.BLUE, Color.YELLOW };
  PointStyle[] styles = new PointStyle[] { PointStyle.POINT, PointStyle.POINT };
  XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(2);
  setRenderer(renderer, colors, styles);
  int length = renderer.getSeriesRendererCount();
  for (int i = 0; i < length; i++) {
    XYSeriesRenderer r = (XYSeriesRenderer) renderer.getSeriesRendererAt(i);
    r.setLineWidth(3f);
  }
  setChartSettings(renderer, "Average temperature", "Month", "Temperature", 0.5, 12.5, 0, 32,
      Color.LTGRAY, Color.LTGRAY);
  renderer.setXLabels(12);
  renderer.setYLabels(10);
  renderer.setShowGrid(true);
  renderer.setXLabelsAlign(Align.RIGHT);
  renderer.setYLabelsAlign(Align.RIGHT);
  renderer.setZoomButtonsVisible(true);
  renderer.setPanLimits(new double[] { -10, 20, -10, 40 });
  renderer.setZoomLimits(new double[] { -10, 20, -10, 40 });
  renderer.setZoomRate(1.05f);
  renderer.setLabelsColor(Color.WHITE);
  renderer.setXLabelsColor(Color.GREEN);
  renderer.setYLabelsColor(0, colors[0]);
  renderer.setYLabelsColor(1, colors[1]);

  renderer.setYTitle("Hours", 1);
  renderer.setYAxisAlign(Align.RIGHT, 1);
  renderer.setYLabelsAlign(Align.LEFT, 1);
  renderer.setGridColor(colors[0], 0);
  renderer.setGridColor(colors[1], 1);

  XYMultipleSeriesDataset dataset = buildDataset(titles, x, values);
  x.clear();
  x.add(new double[] { -1, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 });
  values.clear();
  values.add(new double[] { 4.3, 4.9, 5.9, 8.8, 10.8, 11.9, 13.6, 12.8, 11.4, 9.5, 7.5, 5.5 });
  addXYSeries(dataset, new String[] { "Sunshine hours" }, x, values, 1);

  Intent intent = ChartFactory.getCubicLineChartIntent(context, dataset, renderer, 0.3f,
      "Average temperature");
  return intent;
}
 
開發者ID:ddanny,項目名稱:achartengine,代碼行數:56,代碼來源:MultipleTemperatureChart.java

示例9: setUpRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void setUpRenderer(Activity activity) {
    // Now we create the renderer
    XYSeriesRenderer mCurrentRenderer = new XYSeriesRenderer();
    mCurrentRenderer.setLineWidth(getDPI(2));
    mCurrentRenderer.setColor(activity.getResources().getColor(R.color.colorBarGraph));
    // Include low and max value
    mCurrentRenderer.setDisplayBoundingPoints(true);
    // we add point markers
    mCurrentRenderer.setPointStyle(PointStyle.CIRCLE);
    mCurrentRenderer.setPointStrokeWidth(getDPI(5));
    mCurrentRenderer.setShowLegendItem(false);

    // Creating XYSeriesRenderer to customize expenseSeries
    XYSeriesRenderer expenseRenderer = new XYSeriesRenderer();
    expenseRenderer.setColor(activity.getResources().getColor(R.color.colorBarGraph2));
    expenseRenderer.setPointStyle(PointStyle.POINT);
    expenseRenderer.setFillPoints(true);
    expenseRenderer.setLineWidth(getDPI(3));
    expenseRenderer.setShowLegendItem(false);

    mRenderer = new XYMultipleSeriesRenderer();
    mRenderer.addSeriesRenderer(mCurrentRenderer);
    mRenderer.addSeriesRenderer(expenseRenderer);
    // We want to avoid black border
    mRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent margins
    // Disable Pan on two axis
    mRenderer.setPanEnabled(true, false);
    mRenderer.setZoomEnabled(true, false);
    mRenderer.setLabelsTextSize(getDPI(15));
    mRenderer.setXLabelsColor(activity.getResources().getColor(R.color.colorWhite));
    mRenderer.setYLabelsColor(0, activity.getResources().getColor(R.color.colorWhite));
    mRenderer.setLabelsColor(activity.getResources().getColor(R.color.colorWhite));
    mRenderer.setAxesColor(activity.getResources().getColor(R.color.colorWhite));
    mRenderer.setBarSpacing(0.2);

    mRenderer.setShowGrid(true); // we show the grid
    mRenderer.setXLabels(0);

    // enable the chart click events
    mRenderer.setClickEnabled(true);
    mRenderer.setSelectableBuffer(10);
}
 
開發者ID:blackcj,項目名稱:GoogleFitExample,代碼行數:43,代碼來源:SingleBarGraphWithGoal.java

示例10: setChartSettings

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
 * Sets a few of the series renderer settings.
 * 
 * @param renderer the renderer to set the properties to
 * @param title the chart title
 * @param xTitle the title for the X axis
 * @param yTitle the title for the Y axis
 * @param xMin the minimum value on the X axis
 * @param xMax the maximum value on the X axis
 * @param yMin the minimum value on the Y axis
 * @param yMax the maximum value on the Y axis
 * @param axesColor the axes color
 * @param labelsColor the labels color
 */
protected void setChartSettings(XYMultipleSeriesRenderer renderer, String title, String xTitle,
    String yTitle, double xMin, double xMax, double yMin, double yMax, int axesColor,
    int labelsColor) {
  renderer.setChartTitle(title);
  renderer.setXTitle(xTitle);
  renderer.setYTitle(yTitle);
  renderer.setXAxisMin(xMin);
  renderer.setXAxisMax(xMax);
  renderer.setYAxisMin(yMin);
  renderer.setYAxisMax(yMax);
  renderer.setAxesColor(axesColor);
  renderer.setLabelsColor(labelsColor);
}
 
開發者ID:ddanny,項目名稱:achartengine,代碼行數:28,代碼來源:AbstractDemoChart.java

示例11: setChartSettings

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
 * Sets a few of the series renderer settings.
 * 
 * @param renderer
 *            the renderer to set the properties to
 * @param title
 *            the chart title
 * @param xTitle
 *            the title for the X axis
 * @param yTitle
 *            the title for the Y axis
 * @param xMin
 *            the minimum value on the X axis
 * @param xMax
 *            the maximum value on the X axis
 * @param yMin
 *            the minimum value on the Y axis
 * @param yMax
 *            the maximum value on the Y axis
 * @param axesColor
 *            the axes color
 * @param labelsColor
 *            the labels color
 */
protected void setChartSettings(XYMultipleSeriesRenderer renderer,
		String title, String xTitle, String yTitle, double xMin,
		double xMax, double yMin, double yMax, int axesColor,
		int labelsColor) {
	renderer.setChartTitle(title);
	renderer.setXTitle(xTitle);
	renderer.setYTitle(yTitle);
	renderer.setXAxisMin(xMin);
	renderer.setXAxisMax(xMax);
	renderer.setYAxisMin(yMin);
	renderer.setYAxisMax(yMax);
	renderer.setAxesColor(axesColor);
	renderer.setLabelsColor(labelsColor);
}
 
開發者ID:jhmgbl,項目名稱:learnforandroidfragAS,代碼行數:39,代碼來源:AbstractDemoChart.java


注:本文中的org.achartengine.renderer.XYMultipleSeriesRenderer.setLabelsColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。