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


Java XYSeriesRenderer.setColor方法代碼示例

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


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

示例1: renderGraph

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
private void renderGraph() {
    mSeries = new XYSeries("Vols/FreqBin");
    div10 = new XYSeries("div10");
    mSeries.add(3,4);
    mRenderer = new XYSeriesRenderer();
    div10Renderer = new XYSeriesRenderer();
    div10Renderer.setColor(root.getResources().getColor(R.color.red));
    dataset.addSeries(mSeries);
    dataset.addSeries(div10);
    renderer.addSeriesRenderer(mRenderer);
    renderer.addSeriesRenderer(div10Renderer);
    renderer.setPanEnabled(false);
    renderer.setZoomEnabled(false);
    mChart = ChartFactory.getLineChartView(getActivity(), dataset, renderer);

    ((LinearLayout)root.findViewById(R.id.chart)).addView(mChart);
}
 
開發者ID:jasper-lu,項目名稱:Doppler-Android-Demo,代碼行數:18,代碼來源:GraphFragment.java

示例2: addAlertSeries

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
private void addAlertSeries() {
		TimeSeries alertSeries = new TimeSeries("Alerts");
		long alertTime = _maxTime - 5000 * 60;
		alertSeries.add(alertTime, Long.MAX_VALUE);
		alertSeries.add(alertTime, Long.MIN_VALUE);

		_dataSet.addSeries(alertSeries);

		// create new renderer for the new series
		XYSeriesRenderer renderer = new XYSeriesRenderer();
		_multipleSeriesRenderer.addSeriesRenderer(renderer);

		renderer.setPointStyle(PointStyle.POINT);
		renderer.setColor(Color.RED);
		renderer.setFillPoints(false);
		renderer.setDisplayChartValues(false);
//		renderer.setDisplayChartValuesDistance(1);
//		renderer.setChartValuesTextSize(30f);
		renderer.setShowLegendItem(false);

	}
 
開發者ID:crownstone,項目名稱:fridge-file-app,代碼行數:22,代碼來源:StatisticsActivity.java

示例3: addRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
@Override
public void addRenderer(int series, Activity activity, int color) {
    XYSeriesRenderer mCurrentRenderer = new XYSeriesRenderer();
    mCurrentRenderer.setLineWidth(getDPI(3));
    mCurrentRenderer.setColor(color);
    // Include low and max value
    mCurrentRenderer.setDisplayBoundingPoints(true);
    // we add point markers
    mCurrentRenderer.setPointStyle(PointStyle.CIRCLE);
    mCurrentRenderer.setPointStrokeWidth(getDPI(5));
    mCurrentRenderer.setShowLegendItem(false);

    XYSeries seriesData = new XYSeries("data" + series);
    mSeriesDataSet.add(series, seriesData);

    mRenderer.addSeriesRenderer(series, mCurrentRenderer);
}
 
開發者ID:blackcj,項目名稱:GoogleFitExample,代碼行數:18,代碼來源:MultipleLineGraphs.java

示例4: setRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
protected void setRenderer(XYMultipleSeriesRenderer renderer, int[] colors,
		PointStyle[] styles) {
	renderer.setAxisTitleTextSize(16);
	renderer.setChartTitleTextSize(20);
	renderer.setLabelsTextSize(15);
	renderer.setLegendTextSize(15);
	renderer.setPointSize(5f);
	renderer.setMargins(new int[] { 20, 30, 15, 20 });
	int length = colors.length;
	for (int i = 0; i < length; i++) {
		XYSeriesRenderer r = new XYSeriesRenderer();
		r.setColor(colors[i]);
		r.setPointStyle(styles[i]);
		renderer.addSeriesRenderer(r);
	}
}
 
開發者ID:jhmgbl,項目名稱:learnforandroidfragAS,代碼行數:17,代碼來源:AbstractDemoChart.java

示例5: getDemoRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
private XYMultipleSeriesRenderer getDemoRenderer() {
    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
    renderer.setAxisTitleTextSize(HeartRateMonitor.CHART_AXIS_TITLE_SIZE);
    renderer.setChartTitleTextSize(HeartRateMonitor.CHART_TITLE_SIZE);
    renderer.setLabelsTextSize(HeartRateMonitor.CHART_LABELS_TEXT_SIZE);
    renderer.setLegendTextSize(HeartRateMonitor.CHART_LEGEND_TEXT_SIZE);
    renderer.setPointSize(HeartRateMonitor.CHART_POINT_SIZE);
    renderer.setMarginsColor(Color.WHITE);
    renderer.setMargins(new int[]{20, 20, 15, 0});
    XYSeriesRenderer r = new XYSeriesRenderer();
    r.setColor(Color.RED);
    r.setPointStyle(PointStyle.SQUARE);
    r.setFillBelowLine(true);
    r.setFillBelowLineColor(Color.WHITE);
    r.setFillPoints(true);
    renderer.addSeriesRenderer(r);
    return renderer;
}
 
開發者ID:andrew749,項目名稱:HeartRateMonitor,代碼行數:19,代碼來源:DoneActivity.java

示例6: getDemoRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */

private XYMultipleSeriesRenderer getDemoRenderer() {
    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
    renderer.setAxisTitleTextSize(HeartRateMonitor.CHART_AXIS_TITLE_SIZE);
    renderer.setChartTitleTextSize(HeartRateMonitor.CHART_TITLE_SIZE);
    renderer.setLabelsTextSize(HeartRateMonitor.CHART_LABELS_TEXT_SIZE);
    renderer.setLegendTextSize(HeartRateMonitor.CHART_LEGEND_TEXT_SIZE);
    renderer.setPointSize(HeartRateMonitor.CHART_POINT_SIZE);
    renderer.setMarginsColor(Color.WHITE);
    renderer.setMargins(new int[]{20, 30, 15, 0});
    XYSeriesRenderer r = new XYSeriesRenderer();
    r.setColor(Color.BLUE);
    r.setPointStyle(PointStyle.SQUARE);
    r.setFillBelowLine(true);
    r.setFillBelowLineColor(Color.WHITE);
    r.setFillPoints(true);
    renderer.addSeriesRenderer(r);
    return renderer;
}
 
開發者ID:andrew749,項目名稱:HeartRateMonitor,代碼行數:23,代碼來源:HeartRateMonitor.java

示例7: getRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
public XYMultipleSeriesRenderer getRenderer() {
// 新建一個xymultipleseries
    render = new XYMultipleSeriesRenderer();
    render.setAxisTitleTextSize(16); // 設置坐標軸標題文本大小
    render.setChartTitleTextSize(20); // 設置圖表標題文本大小
    render.setLabelsTextSize(15); // 設置軸標簽文本大小
    render.setLegendTextSize(15); // 設置圖例文本大小
    render.setMargins(new int[] {20, 30, 15,0}); // 設置4邊留白
    render.setPanEnabled(false, false); // 設置x,y坐標軸不會因用戶劃動屏幕而移動
    // 設置4邊留白透明
    render.setMarginsColor(Color.argb(0,0xff, 0, 0)); 
    render.setBackgroundColor(Color.TRANSPARENT); // 設置背景色透明
    render.setApplyBackgroundColor(true); // 使背景色生效
    render.setXTitle("持續時間");
    render.setYTitle("海拔高度");
    // 設置一個係列的顏色為藍色
    xyRender = new XYSeriesRenderer();
    xyRender.setColor(Color.BLUE);
    // 往xymultiplerender中增加一個係列
    render.addSeriesRenderer(xyRender);
    return render;
  }
 
開發者ID:Tifosi-M,項目名稱:Hi-Top,代碼行數:23,代碼來源:RecDetailsActivity.java

示例8: buildRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的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

示例9: LineGraphView

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的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

示例10: getReportRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
private XYSeriesRenderer getReportRenderer(int color) {
    int displayChartValueDistance = 40;
    int lineWidth = 3;
    XYSeriesRenderer reportRenderer = new XYSeriesRenderer();
    reportRenderer.setPointStyle(PointStyle.CIRCLE);
    reportRenderer.setFillPoints(true);
    reportRenderer.setColor(color);
    reportRenderer.setLineWidth(lineWidth);
    reportRenderer.setDisplayChartValues(true);
    reportRenderer.setDisplayChartValuesDistance(displayChartValueDistance);
    return reportRenderer;
}
 
開發者ID:Welloculus,項目名稱:MobileAppForPatient,代碼行數:13,代碼來源:ReportsActivity.java

示例11: buildRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
protected XYMultipleSeriesRenderer buildRenderer(int color, PointStyle style, boolean fill) {
        XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

        //設置圖表中曲線本身的樣式,包括顏色、點的大小以及線的粗細等
        XYSeriesRenderer r = new XYSeriesRenderer();
        r.setColor(Color.RED);
//		r.setPointStyle(null);
//		r.setFillPoints(fill);
        r.setLineWidth(1);
        renderer.addSeriesRenderer(r);
        return renderer;
    }
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:13,代碼來源:HeartBeatFragment.java

示例12: addValue

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
/**
 * Adds a value into the both the data set containing all constellations and individual data set
 * of the constellation of the satellite
 */
private void addValue(int tab, int constellationType, int svID,
    double timeInSeconds, double value) {
  XYMultipleSeriesDataset dataSetAll = getDataSet(tab, DATA_SET_INDEX_ALL);
  XYMultipleSeriesRenderer rendererAll = getRenderer(tab, DATA_SET_INDEX_ALL);
  value = Double.parseDouble(sDataFormat.format(value));
  if (hasSeen(constellationType, svID, tab)) {
    // If the satellite has been seen before, we retrieve the dataseries it is add and add new
    // data
    dataSetAll
        .getSeriesAt(mSatelliteIndex[tab].get(constellationType).get(svID))
        .add(timeInSeconds, value);
    mDataSetList[tab]
        .get(constellationType)
        .getSeriesAt(mSatelliteConstellationIndex[tab].get(constellationType).get(svID))
        .add(timeInSeconds, value);
  } else {
    // If the satellite has not been seen before, we create new dataset and renderer before
    // adding data
    mSatelliteIndex[tab].get(constellationType).put(svID, dataSetAll.getSeriesCount());
    mSatelliteConstellationIndex[tab]
        .get(constellationType)
        .put(svID, mDataSetList[tab].get(constellationType).getSeriesCount());
    XYSeries tempSeries = new XYSeries(CONSTELLATION_PREFIX[constellationType - 1] + svID);
    tempSeries.add(timeInSeconds, value);
    dataSetAll.addSeries(tempSeries);
    mDataSetList[tab].get(constellationType).addSeries(tempSeries);
    XYSeriesRenderer tempRenderer = new XYSeriesRenderer();
    tempRenderer.setLineWidth(5);
    tempRenderer.setColor(mColorMap.getColor(svID, constellationType));
    rendererAll.addSeriesRenderer(tempRenderer);
    mRendererList[tab].get(constellationType).addSeriesRenderer(tempRenderer);
  }
}
 
開發者ID:google,項目名稱:gps-measurement-tools,代碼行數:38,代碼來源:PlotFragment.java

示例13: setRenderer

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
private void setRenderer(XYMultipleSeriesRenderer renderer, int[] colors, PointStyle[] styles) {
   renderer.setAxisTitleTextSize(16);
   renderer.setChartTitleTextSize(20);
   renderer.setLabelsTextSize(15);
   renderer.setLegendTextSize(15);
   renderer.setPointSize(5f);
   renderer.setMargins(new int[] { 20, 30, 15, 20 });
   int length = colors.length;
   for (int i = 0; i < length; i++) {
      XYSeriesRenderer r = new XYSeriesRenderer();
      r.setColor(colors[i]);
      r.setPointStyle(styles[i]);
      renderer.addSeriesRenderer(r);
   }
}
 
開發者ID:batoulapps,項目名稱:qamardeen-android,代碼行數:16,代碼來源:GraphWidget.java

示例14: addSeries

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
/**
 * Add a graph for the data in 'series' with 'color' to the plot.
 * @param series The x and y values to add
 * @param color Used for plotting
 */
public void addSeries(XYSeries series, int color) {
    dataset.addSeries(series);
    XYSeriesRenderer renderer = new XYSeriesRenderer();
    renderer.setColor(color);
    plotRenderer.addSeriesRenderer(renderer);
}
 
開發者ID:jrieke,項目名稱:ioiometer,代碼行數:12,代碼來源:MyLineChartView.java

示例15: addDummySeries

import org.achartengine.renderer.XYSeriesRenderer; //導入方法依賴的package包/類
/**
 * Add a dummy series with a single, transparent point in the origin to the plot.
 */
protected void addDummySeries() {
    XYSeries series = new XYSeries("dummy");
    series.add(0, 0);
    dataset.addSeries(series);
    XYSeriesRenderer renderer = new XYSeriesRenderer();
    renderer.setColor(Color.TRANSPARENT);
    plotRenderer.addSeriesRenderer(renderer);
}
 
開發者ID:jrieke,項目名稱:ioiometer,代碼行數:12,代碼來源:MyLineChartView.java


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