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


Java XYMultipleSeriesRenderer.setZoomButtonsVisible方法代碼示例

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


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

示例1: 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

示例2: getChartRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private XYMultipleSeriesRenderer getChartRenderer() {
	XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

	// TODO better style
	float textSize = (float) TypedValue.applyDimension(
			TypedValue.COMPLEX_UNIT_SP, 12, getResources()
					.getDisplayMetrics());
	int marginSizeNormal = (int) TypedValue.applyDimension(
			TypedValue.COMPLEX_UNIT_SP, 20, getResources()
					.getDisplayMetrics());
	int marginSizeLarge = (int) TypedValue.applyDimension(
			TypedValue.COMPLEX_UNIT_SP, 50, getResources()
					.getDisplayMetrics());
	renderer.setLabelsTextSize(textSize);
	renderer.setYLabelsAngle(-30.0f);
	renderer.setXLabelsAngle(-30.0f);
	renderer.setXLabelsColor(Color.WHITE);
	renderer.setYLabelsColor(0, Color.WHITE);
	renderer.setXLabelsAlign(Align.RIGHT);
	renderer.setYLabelsAlign(Align.RIGHT);
	renderer.setLegendTextSize(textSize);
	renderer.setFitLegend(true);
	renderer.setMargins(new int[] { marginSizeNormal, marginSizeLarge,
			marginSizeLarge, marginSizeNormal });
	renderer.setPanEnabled(true, false);
	renderer.setZoomEnabled(true, false);
	renderer.setZoomButtonsVisible(false);
	renderer.setApplyBackgroundColor(true);
	renderer.setBackgroundColor(Color.DKGRAY);
	renderer.setMarginsColor(Color.BLACK);
	renderer.setGridColor(Color.WHITE);
	renderer.setPointSize(8);
	renderer.setShowGridY(true);
	renderer.setClickEnabled(false);
	renderer.setXLabels(6);

	return renderer;
}
 
開發者ID:Jei,項目名稱:WAIDRecognizer,代碼行數:39,代碼來源:HistoryFragment.java

示例3: 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

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

示例5: getRenderer

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
/**
	 * Create graph renderer
	 *
	 * @return renderer object
	 */
	public XYMultipleSeriesRenderer getRenderer() {
		XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

		// set minimum for y axis to 0
		renderer.setYAxisMin(-20);
		renderer.setYAxisMax(+100);

		// scrolling enabled
//		renderer.setPanEnabled(true, false);
		renderer.setPanEnabled(true, true);
		// limits for scrolling (minx, maxx, miny, maxy)
		// zoom buttons (in, out, 1:1)
		renderer.setZoomButtonsVisible(true);
		// enable zoom
//		renderer.setZoomEnabled(true, false);
		renderer.setZoomEnabled(true, true);

		// set labels text size
		renderer.setLabelsTextSize(30f);

		renderer.setYLabelsAlign(Paint.Align.RIGHT);
		renderer.setAxisTitleTextSize(30f);
		renderer.setYTitle("Temperature [°C]");

		// hide legend
//		renderer.setShowLegend(false);
		renderer.setShowLegend(true);
		renderer.setLegendTextSize(30f);
		renderer.setLegendHeight(130);

		// set margins
//		renderer.setMargins(new int[] {20, 30, 15, 0});
		renderer.setMargins(new int[] {30, 70, 50, 0});

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

		renderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
		// todo: need to get background colour of activity, transparent is not good enough
//		renderer.setMarginsColor(((ColorDrawable) _layGraph.getBackground()).getColor());

		renderer.setXAxisMin(new Date().getTime() - 30 * 60 * 1000);

		renderer.setZoomButtonsVisible(false);
		renderer.setExternalZoomEnabled(true);

//		XYSeriesRenderer r = new XYSeriesRenderer();

		// set color
//		r.setColor(Color.GREEN);

		// set fill below line
//		r.setFillBelowLine(true);

//		renderer.addSeriesRenderer(r);
		return renderer;
	}
 
開發者ID:crownstone,項目名稱:fridge-file-app,代碼行數:64,代碼來源:StatisticsActivity.java

示例6: 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

示例7: draw

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void draw() {
	ArrayList<String> dates;
	ArrayList<Double> readings;

	// assign the data passed to the intent
	dates = getIntent().getStringArrayListExtra("dates");
	readings = (ArrayList<Double>) getIntent().getSerializableExtra(
			"readings");
	title = getIntent().getStringExtra("test");

	// create a new time series for the graph
	TimeSeries series = new TimeSeries(title + " Results");

	// populate the series with data retrieved from the database
	for (int i = dates.size() - 1; i >= 0; i--) {
		// parse the date object to calendar date time
		try {
			c.setTime(sdf.parse(dates.get(i)));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// add the current point to the time series
		series.add(c.getTime(), readings.get(i));

	}

	XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
	dataset.addSeries(series); // initialize the set of data to be drawn

	// Now create the renderer to control how the chart looks like
	XYSeriesRenderer renderer = new XYSeriesRenderer();
	renderer.setLineWidth(4);
	renderer.setColor(Color.WHITE);

	// add point markers
	renderer.setPointStyle(PointStyle.CIRCLE);
	renderer.setPointStrokeWidth(3);
	renderer.setDisplayChartValues(true);

	XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
	mRenderer.addSeriesRenderer(renderer);

	// avoid black border
	mRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); // transparent
																	// margins
	// Enable Pan on two axis
	mRenderer.setPanEnabled(true, true);
	mRenderer.setShowGrid(true); // show the grid
	mRenderer.setXTitle("Day");
	if (title.equals("HBA1C"))
		mRenderer.setYTitle("%");
	else
		mRenderer.setYTitle("mg/dl");
	mRenderer.setZoomButtonsVisible(true);

	GraphicalView chartView = ChartFactory.getTimeChartView(DrawGraph.this,
			dataset, mRenderer, "yyyy/MM/dd hh:mm aa");// combines the dataset with
												// the renderer and returns
												// a view
	
	
	LinearLayout chart_container = (LinearLayout) findViewById(R.id.Chart_layout);

	//set the created chart view to the linear layout of the layout created for the graph
	chart_container.addView(chartView, 0);

}
 
開發者ID:Falimbert,項目名稱:BgLogger,代碼行數:71,代碼來源:DrawGraph.java

示例8: lineChartView

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void lineChartView() {
	TypedValue outValue1 = new TypedValue();
	TypedValue outValue2 = new TypedValue();
	TypedValue outValue3 = new TypedValue();
	TypedValue outValue4 = new TypedValue();
	mContext.getResources().getValue(R.dimen.line_axis_title_text_size_value, outValue1, true);
	mContext.getResources().getValue(R.dimen.line_chart_title_text_size_value, outValue2, true);
	mContext.getResources().getValue(R.dimen.line_labels_text_size_value, outValue3, true);
	mContext.getResources().getValue(R.dimen.line_legend_text_size_value, outValue4, true);
	float lineAxisTitleTextSizeValue = outValue1.getFloat();
	float lineCharTitleTextSizeValue = outValue2.getFloat();
	float lineLabelsTextSizeValue = outValue3.getFloat();
	float lineLegendTextSizeValue = outValue4.getFloat();

	XYMultipleSeriesDataset mDataset = getDataset();

	XYMultipleSeriesRenderer mRenderer = getRenderer();
	mRenderer.setApplyBackgroundColor(true);
	mRenderer.setBackgroundColor(Color.TRANSPARENT);
	mRenderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
	mRenderer.setAxisTitleTextSize(lineAxisTitleTextSizeValue);
	mRenderer.setChartTitleTextSize(lineCharTitleTextSizeValue);
	mRenderer.setLabelsTextSize(lineLabelsTextSizeValue);
	mRenderer.setLegendTextSize(lineLegendTextSizeValue);
	mRenderer.setMargins(new int[] { 12, 25, 12, 12 });
	mRenderer.setZoomButtonsVisible(true);
	mRenderer.setPointSize(10);
	mRenderer.setClickEnabled(true);

	mChartView = ChartFactory.getLineChartView(getActivity(), mDataset, mRenderer);

	mChartView.setOnClickListener(new View.OnClickListener() {
		public void onClick(View v) {
			SeriesSelection seriesSelection = mChartView.getCurrentSeriesAndPoint();
			if (seriesSelection != null) {
				UIFunctionUtils.showMessage(mContext, true, (int) seriesSelection.getValue() + " "
						+ getString(R.string.beats_per_minute));
			}
		}
	});

	layout.addView(mChartView);
}
 
開發者ID:scintero,項目名稱:moveon,代碼行數:44,代碼來源:Summary4.java

示例9: lineChartView_type1

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void lineChartView_type1() {
	if (paintChartView) {
		check1.setVisibility(View.VISIBLE);
		check2.setVisibility(View.VISIBLE);
		txt1.setVisibility(View.GONE);

		TypedValue outValue1 = new TypedValue();
		TypedValue outValue2 = new TypedValue();
		TypedValue outValue3 = new TypedValue();
		TypedValue outValue4 = new TypedValue();
		mContext.getResources().getValue(R.dimen.line_axis_title_text_size_value, outValue1, true);
		mContext.getResources().getValue(R.dimen.line_chart_title_text_size_value, outValue2, true);
		mContext.getResources().getValue(R.dimen.line_labels_text_size_value, outValue3, true);
		mContext.getResources().getValue(R.dimen.line_legend_text_size_value, outValue4, true);
		float lineAxisTitleTextSizeValue = outValue1.getFloat();
		float lineCharTitleTextSizeValue = outValue2.getFloat();
		float lineLabelsTextSizeValue = outValue3.getFloat();
		float lineLegendTextSizeValue = outValue4.getFloat();

		XYMultipleSeriesDataset mDataset = getDataset_type1();
		XYMultipleSeriesRenderer mRenderer = getRenderer_type1();
		mRenderer.setApplyBackgroundColor(true);
		mRenderer.setBackgroundColor(Color.TRANSPARENT);
		mRenderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
		mRenderer.setAxisTitleTextSize(lineAxisTitleTextSizeValue);
		mRenderer.setChartTitleTextSize(lineCharTitleTextSizeValue);
		mRenderer.setLabelsTextSize(lineLabelsTextSizeValue);
		mRenderer.setLegendTextSize(lineLegendTextSizeValue);
		mRenderer.setMargins(new int[] { 12, 25, 12, 22 });
		mRenderer.setZoomButtonsVisible(true);
		mRenderer.setPointSize(10);
		mRenderer.setClickEnabled(true);
		mChartView = ChartFactory.getLineChartView(getActivity(), mDataset, mRenderer);

		mChartView.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				SeriesSelection seriesSelection = mChartView.getCurrentSeriesAndPoint();

				if (seriesSelection != null) {
					String units = "";
					switch (seriesSelection.getSeriesIndex()) {
					case 0:
						units = " "
								+ (isMetric ? getString(R.string.long_unit1_detail_4)
										: getString(R.string.long_unit2_detail_4));
						break;
					case 1:
						units = " "
								+ (isMetric ? getString(R.string.long_unit1_detail_2)
										: getString(R.string.long_unit2_detail_2));
						break;
					}
					UIFunctionUtils.showMessage(mContext, true, (int) seriesSelection.getValue() + units);
				}
			}
		});

		chartLayout.addView(mChartView);
	} else {
		setCorrectText();
	}
}
 
開發者ID:scintero,項目名稱:moveon,代碼行數:63,代碼來源:Summary3.java

示例10: lineChartView_type2

import org.achartengine.renderer.XYMultipleSeriesRenderer; //導入方法依賴的package包/類
private void lineChartView_type2(final int type) {
	if (paintChartView) {
		txt1.setVisibility(View.GONE);

		TypedValue outValue1 = new TypedValue();
		TypedValue outValue2 = new TypedValue();
		TypedValue outValue3 = new TypedValue();
		TypedValue outValue4 = new TypedValue();
		mContext.getResources().getValue(R.dimen.line2_axis_title_text_size_value, outValue1, true);
		mContext.getResources().getValue(R.dimen.line2_chart_title_text_size_value, outValue2, true);
		mContext.getResources().getValue(R.dimen.line2_labels_text_size_value, outValue3, true);
		mContext.getResources().getValue(R.dimen.line2_legend_text_size_value, outValue4, true);
		float line2AxisTitleTextSizeValue = outValue1.getFloat();
		float line2CharTitleTextSizeValue = outValue2.getFloat();
		float line2LabelsTextSizeValue = outValue3.getFloat();
		float line2LegendTextSizeValue = outValue4.getFloat();

		XYMultipleSeriesDataset mDataset = null;
		XYMultipleSeriesRenderer mRenderer = null;
		switch (type) {
		case 1:
			mDataset = getDataset_type2(1);
			break;
		case 2:
			mDataset = getDataset_type2(2);
			break;
		}
		mRenderer = getRenderer_type2(type);
		mRenderer.setApplyBackgroundColor(true);
		mRenderer.setBackgroundColor(Color.TRANSPARENT);
		mRenderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
		mRenderer.setAxisTitleTextSize(line2AxisTitleTextSizeValue);
		mRenderer.setChartTitleTextSize(line2CharTitleTextSizeValue);
		mRenderer.setLabelsTextSize(line2LabelsTextSizeValue);
		mRenderer.setLegendTextSize(line2LegendTextSizeValue);
		mRenderer.setMargins(new int[] { 12, 25, 12, 12 });
		mRenderer.setZoomButtonsVisible(true);
		mRenderer.setPointSize(10);
		mRenderer.setClickEnabled(true);
		mChartView = ChartFactory.getLineChartView(getActivity(), mDataset, mRenderer);

		mChartView.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				SeriesSelection seriesSelection = mChartView.getCurrentSeriesAndPoint();

				if (seriesSelection != null) {
					switch (type) {
					case 1:
						UIFunctionUtils.showMessage(mContext, true, (int) seriesSelection.getValue()
								+ " "
								+ (isMetric ? getString(R.string.long_unit1_detail_4)
										: getString(R.string.long_unit2_detail_4)));
						break;
					case 2:
						UIFunctionUtils.showMessage(mContext, true, (int) seriesSelection.getValue()
								+ " "
								+ (isMetric ? getString(R.string.long_unit1_detail_2)
										: getString(R.string.long_unit2_detail_2)));
						break;
					}
				}
			}
		});

		chartLayout.addView(mChartView);
	} else {
		setCorrectText();
	}
}
 
開發者ID:scintero,項目名稱:moveon,代碼行數:70,代碼來源:Summary3.java


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