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


Java XYSeries类代码示例

本文整理汇总了Java中org.achartengine.model.XYSeries的典型用法代码示例。如果您正苦于以下问题:Java XYSeries类的具体用法?Java XYSeries怎么用?Java XYSeries使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: doInBackground

import org.achartengine.model.XYSeries; //导入依赖的package包/类
@Override
protected String doInBackground(XYMultipleSeriesDataset... params) {
	StringBuilder sb = new StringBuilder();
	XYSeries series[] = params[0].getSeries();
	int samples = series[0].getItemCount();
	for (int i = 0; i < samples; i++) {
		sb.append(i);
		sb.append(", ");
		sb.append(series[0].getY(i));
		if (series.length > 1) {
			sb.append(", ");
			sb.append(series[1].getY(i));
			if (series.length > 2) {
				sb.append(", ");
				sb.append(series[2].getY(i));
			}
		}
		sb.append("\n");
		publishProgress(10000 * i / samples);
	}
	return sb.toString();
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:23,代码来源:ExportTask.java

示例2: drawChartValuesText

import org.achartengine.model.XYSeries; //导入依赖的package包/类
/**
 * The graphical representation of the series values as text.
 * 
 * @param canvas the canvas to paint to
 * @param series the series to be painted
 * @param renderer the series renderer
 * @param paint the paint to be used for drawing
 * @param points the array of points to be used for drawing the series
 * @param seriesIndex the index of the series currently being drawn
 * @param startIndex the start index of the rendering points
 */
protected void drawChartValuesText(Canvas canvas, XYSeries series, XYSeriesRenderer renderer,
    Paint paint, List<Float> points, int seriesIndex, int startIndex) {
  int seriesNr = mDataset.getSeriesCount();
  int length = points.size();
  float halfDiffX = getHalfDiffX(points, length, seriesNr);
  for (int i = 0; i < length; i += 2) {
    int index = startIndex + i / 2;
    double value = series.getY(index);
    if (!isNullValue(value)) {
      float x = points.get(i);
      if (mType == Type.DEFAULT) {
        x += seriesIndex * 2 * halfDiffX - (seriesNr - 1.5f) * halfDiffX;
      }
      if (value >= 0) {
        drawText(canvas, getLabel(renderer.getChartValuesFormat(), value), x, points.get(i + 1)
            - renderer.getChartValuesSpacing(), paint, 0);
      } else {
        drawText(canvas, getLabel(renderer.getChartValuesFormat(), value), x, points.get(i + 1)
            + renderer.getChartValuesTextSize() + renderer.getChartValuesSpacing() - 3, paint, 0);
      }
    }
  }
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:35,代码来源:BarChart.java

示例3: renderGraph

import org.achartengine.model.XYSeries; //导入依赖的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

示例4: addRenderer

import org.achartengine.model.XYSeries; //导入依赖的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

示例5: getDataset_type1

import org.achartengine.model.XYSeries; //导入依赖的package包/类
private XYMultipleSeriesDataset getDataset_type1() {
	XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();

	XYSeries firstSeries = new XYSeries(getString(R.string.altitude_label), 1);
	XYSeries secondSeries = new XYSeries(getString(R.string.speed_label));

	for (int i = 0; i < timeList.size(); i++) {
		firstSeries.add(FunctionUtils.customizedRound(((float) timeList.get(i) / 60), 1),
				altitudeList.get(i));

		secondSeries.add(FunctionUtils.customizedRound(((float) timeList.get(i) / 60), 1),
				speedList.get(i));
	}

	dataset.addSeries(firstSeries);
	dataset.addSeries(secondSeries);

	return dataset;
}
 
开发者ID:scintero,项目名称:moveon,代码行数:20,代码来源:Summary3.java

示例6: pvChanged

import org.achartengine.model.XYSeries; //导入依赖的package包/类
@Override
public void pvChanged(PvChangeEvent event)
{
	if (allowDataUpdates)
	{
		IndexedProcessVar pv = (IndexedProcessVar) event.getSource();
		XYSeries series = (XYSeries) pv.get(FID_DATA_SERIES);
		if (series != null)
		{
			if(event.getValue() instanceof Number)
			{
				series.add(event.getTime(),
					((Number)event.getValue()).doubleValue());

			}
		}

		// send update to plugin handler
		if(PluginManager.pluginHandler != null)
		{
			PluginManager.pluginHandler.sendDataUpdate(
				pv.get(EcuDataPv.FID_MNEMONIC).toString(),
				event.getValue().toString());
		}
	}
}
 
开发者ID:fr3ts0n,项目名称:AndrOBD,代码行数:27,代码来源:ObdItemAdapter.java

示例7: addSeries

import org.achartengine.model.XYSeries; //导入依赖的package包/类
private void addSeries(float[] votesarr, int max, XYMultipleSeriesDataset dataSet,
		XYMultipleSeriesRenderer multiRenderer, int i, String text,
		XYSeriesRenderer renderer) {
	XYSeries series = new XYSeries(text);
	
	// Calculate the value in percent
	double votes = votesarr[i] * 100 / max;
       votes = MathUtils.roundToDecimals(votes, 2);
	
       series.add(i+1, votes);
	renderer.setDisplayChartValues(true);
	renderer.setChartValuesTextSize(22);
	dataSet.addSeries(series);
	multiRenderer.addSeriesRenderer(renderer);
	multiRenderer.addXTextLabel(i+1, text);
}
 
开发者ID:brunsen,项目名称:sturesy-android-client,代码行数:17,代码来源:BarChartFactory.java

示例8: updateGraph

import org.achartengine.model.XYSeries; //导入依赖的package包/类
void updateGraph(final Graph g) {
    if(g == null) return;
    final String eq = mLogic.getText();

    if(eq.isEmpty()) {
        XYSeries series = new XYSeries("");

        try {
            clearGraph(g);
            g.getDataset().addSeries(series);
        }
        catch(NullPointerException e) {
            e.printStackTrace();
        }

        if(mLogic.mGraphDisplay != null) mLogic.mGraphDisplay.repaint();
        return;
    }

    if(Logic.isOperator(eq.charAt(eq.length() - 1)) || mLogic.displayContainsMatrices() || eq.endsWith("(")) return;

    new GraphTask(g, mLogic).execute(eq);
}
 
开发者ID:numixproject,项目名称:com.numix.calculator,代码行数:24,代码来源:GraphModule.java

示例9: drawChartValuesText

import org.achartengine.model.XYSeries; //导入依赖的package包/类
/**
 * The graphical representation of the series values as text.
 * 
 * @param canvas the canvas to paint to
 * @param series the series to be painted
 * @param renderer the series renderer
 * @param paint the paint to be used for drawing
 * @param points the array of points to be used for drawing the series
 * @param seriesIndex the index of the series currently being drawn
 * @param startIndex the start index of the rendering points
 */
protected void drawChartValuesText(Canvas canvas, XYSeries series, SimpleSeriesRenderer renderer,
    Paint paint, List<Float> points, int seriesIndex, int startIndex) {
  int seriesNr = mDataset.getSeriesCount();
  int length = points.size();
  float halfDiffX = getHalfDiffX(points, length, seriesNr);
  for (int i = 0; i < length; i += 2) {
    int index = startIndex + i / 2;
    double value = series.getY(index);
    if (!isNullValue(value)) {
      float x = points.get(i);
      if (mType == Type.DEFAULT) {
        x += seriesIndex * 2 * halfDiffX - (seriesNr - 1.5f) * halfDiffX;
      }
      if (value >= 0) {
        drawText(canvas, getLabel(renderer.getChartValuesFormat(), value), x, points.get(i + 1)
            - renderer.getChartValuesSpacing(), paint, 0);
      } else {
        drawText(canvas, getLabel(renderer.getChartValuesFormat(), value), x, points.get(i + 1)
            + renderer.getChartValuesTextSize() + renderer.getChartValuesSpacing() - 3, paint, 0);
      }
    }
  }
}
 
开发者ID:InQBarna,项目名称:AChartEngine,代码行数:35,代码来源:BarChart.java

示例10: drawChartValuesText

import org.achartengine.model.XYSeries; //导入依赖的package包/类
/**
 * The graphical representation of the series values as text.
 * 
 * @param canvas the canvas to paint to
 * @param series the series to be painted
 * @param renderer the series renderer
 * @param paint the paint to be used for drawing
 * @param points the array of points to be used for drawing the series
 * @param seriesIndex the index of the series currently being drawn
 * @param startIndex the start index of the rendering points
 */
protected void drawChartValuesText(Canvas canvas, XYSeries series, XYSeriesRenderer renderer,
    Paint paint, List<Float> points, int seriesIndex, int startIndex) {
  int seriesNr = mDataset.getSeriesCount();
  float halfDiffX = getHalfDiffX(points, points.size(), seriesNr);
  int start = 0;
  if (startIndex > 0) {
    start = 2;
  }
  for (int i = start; i < points.size(); i += 4) {
    int index = startIndex + i / 2;
    float x = points.get(i);
    if (mType == Type.DEFAULT) {
      x += seriesIndex * 2 * halfDiffX - (seriesNr - 1.5f) * halfDiffX;
    }

    if (!isNullValue(series.getY(index + 1)) && points.size() > i + 3) {
      // draw the maximum value
      drawText(canvas, getLabel(renderer.getChartValuesFormat(), series.getY(index + 1)), x,
          points.get(i + 3) - renderer.getChartValuesSpacing(), paint, 0);
    }
    if (!isNullValue(series.getY(index)) && points.size() > i + 1) {
      // draw the minimum value
      drawText(
          canvas,
          getLabel(renderer.getChartValuesFormat(), series.getY(index)),
          x,
          points.get(i + 1) + renderer.getChartValuesTextSize()
              + renderer.getChartValuesSpacing() - 3, paint, 0);
    }
  }
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:43,代码来源:RangeBarChart.java

示例11: drawSeries

import org.achartengine.model.XYSeries; //导入依赖的package包/类
@Override
protected void drawSeries(XYSeries series, Canvas canvas, Paint paint, List<Float> pointsList,
    XYSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, Orientation or,
    int startIndex) {
  mCharts[seriesIndex].setScreenR(getScreenR());
  mCharts[seriesIndex].setCalcRange(getCalcRange(mDataset.getSeriesAt(seriesIndex)
      .getScaleNumber()), 0);
  mCharts[seriesIndex].drawSeries(series, canvas, paint, pointsList, seriesRenderer, yAxisValue,
      0, or, startIndex);
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:11,代码来源:CombinedXYChart.java

示例12: addXYSeries

import org.achartengine.model.XYSeries; //导入依赖的package包/类
private void addXYSeries(XYMultipleSeriesDataset dataset, String title, double[] xValues, double[] yValues, int scale) {
    mSeries = new XYSeries(title, scale);
    int seriesLength = xValues.length;
    for(int k = 0; k < seriesLength; k++) {
        mSeries.add(xValues[k], yValues[k]);
    }
    dataset.addSeries(mSeries);
}
 
开发者ID:gigabytedevelopers,项目名称:CalcMate,代码行数:9,代码来源:Graph.java

示例13: addValue

import org.achartengine.model.XYSeries; //导入依赖的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

示例14: init

import org.achartengine.model.XYSeries; //导入依赖的package包/类
/**
 * Initialize ECG chart.
 */
private void init() {
    this.mECGList = new ArrayList<>();
    this.mECGList.add(new XYSeries(TITLES[0]));
    XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
    dataset.addAllSeries(this.mECGList);

    this.mXYMultipleSeriesRenderer = buildRenderer();
    mLineChart = new LineChart(dataset, mXYMultipleSeriesRenderer);
    mGraphicalView = new GraphicalView(getActivity(), mLineChart);
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:14,代码来源:HitoeProfileECGFragment.java

示例15: init

import org.achartengine.model.XYSeries; //导入依赖的package包/类
/**
 * Initialilze chart.
 */
private void init() {
    mACCList = new ArrayList<>();
    mACCList.add(new XYSeries(TITLES[0]));
    mACCList.add(new XYSeries(TITLES[1]));
    mACCList.add(new XYSeries(TITLES[2]));
    XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
    dataset.addAllSeries(mACCList);

    this.mXYMultipleSeriesRenderer = buildRenderer();
    mLineChart = new LineChart(dataset, mXYMultipleSeriesRenderer);
    mGraphicalView = new GraphicalView(getActivity(), mLineChart);
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:16,代码来源:HitoeProfileDeviceOrientationFragment.java


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