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


Java XYSeries.add方法代码示例

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


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

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

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

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

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

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

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

示例7: addDummySeries

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

示例8: addXYSeries

import org.achartengine.model.XYSeries; //导入方法依赖的package包/类
public void addXYSeries(XYMultipleSeriesDataset dataset, String[] titles, List<double[]> xValues,
    List<double[]> yValues, int scale) {
  int length = titles.length;
  for (int i = 0; i < length; i++) {
    XYSeries series = new XYSeries(titles[i], scale);
    double[] xV = xValues.get(i);
    double[] yV = yValues.get(i);
    int seriesLength = xV.length;
    for (int k = 0; k < seriesLength; k++) {
      series.add(xV[k], yV[k]);
    }
    dataset.addSeries(series);
  }
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:15,代码来源:AbstractDemoChart.java

示例9: getDemoDataset

import org.achartengine.model.XYSeries; //导入方法依赖的package包/类
private XYMultipleSeriesDataset getDemoDataset() {
  XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
  final int nr = 10;
  Random r = new Random();
  for (int i = 0; i < SERIES_NR; i++) {
    XYSeries series = new XYSeries("Demo series " + (i + 1));
    for (int k = 0; k < nr; k++) {
      series.add(k, 20 + r.nextInt() % 100);
    }
    dataset.addSeries(series);
  }
  return dataset;
}
 
开发者ID:ddanny,项目名称:achartengine,代码行数:14,代码来源:GeneratedChartDemo.java

示例10: addXYSeries

import org.achartengine.model.XYSeries; //导入方法依赖的package包/类
public void addXYSeries(XYMultipleSeriesDataset dataset, String[] titles,
		List<double[]> xValues, List<double[]> yValues, int scale) {
	int length = titles.length;
	for (int i = 0; i < length; i++) {
		XYSeries series = new XYSeries(titles[i], scale);
		double[] xV = xValues.get(i);
		double[] yV = yValues.get(i);
		int seriesLength = xV.length;
		for (int k = 0; k < seriesLength; k++) {
			series.add(xV[k], yV[k]);
		}
		dataset.addSeries(series);
	}
}
 
开发者ID:jhmgbl,项目名称:learnforandroidfragAS,代码行数:15,代码来源:AbstractDemoChart.java

示例11: getDataset

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

	XYSeries firstSeries = new XYSeries(getString(R.string.tab_summary4).toUpperCase(Locale.getDefault()));

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

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

示例12: fillSeries

import org.achartengine.model.XYSeries; //导入方法依赖的package包/类
private void fillSeries(XYSeries series) {
  List<LatensPoint> latencies = analysisData.getLatencies();
  series.add(0, 0);
  for (LatensPoint latensPoint : latencies) {
    series.add(latensPoint.getDateMs(), latensPoint.getLatensMs());
  }
}
 
开发者ID:Orange-OpenSource,项目名称:latens,代码行数:8,代码来源:LatensGraphActivity.java

示例13: createDatasetFromProfile

import org.achartengine.model.XYSeries; //导入方法依赖的package包/类
/**
 * Create a dataset based on supplied data that are supposed to be coordinates and elevations for a profile view.
 * 
 * <p>
 * Note that this also sets the min and max values 
 * of the chart data, so the dataset created should
 * really be used through setDataset, so that the bounds 
 * are properly zoomed.
 * </p>
 * 
 * @param lonArray the array of longitudes.
 * @param latArray the array of latitudes.
 * @param elevArray the array of elevations.
 * @param seriesName the name to label the serie with.
 * @return the {@link XYSeries dataset}.
 */
public XYSeries createDatasetFromProfile( DynamicDoubleArray lonArray, DynamicDoubleArray latArray,
        DynamicDoubleArray elevArray, String seriesName ) {
    XYSeries xyS = new XYSeries(seriesName);

    yMin = Double.POSITIVE_INFINITY;
    yMax = Double.NEGATIVE_INFINITY;

    double plat = 0;
    double plon = 0;
    double summedDistance = 0.0;
    for( int i = 0; i < lonArray.size(); i++ ) {
        double elev = elevArray.get(i);
        double lat = latArray.get(i);
        double lon = lonArray.get(i);

        double distance = 0.0;
        if (i > 0) {
            Location thisLoc = new Location("dummy1"); //$NON-NLS-1$
            thisLoc.setLongitude(lon);
            thisLoc.setLatitude(lat);
            Location thatLoc = new Location("dummy2"); //$NON-NLS-1$
            thatLoc.setLongitude(plon);
            thatLoc.setLatitude(plat);
            distance = thisLoc.distanceTo(thatLoc);
        }
        plat = lat;
        plon = lon;
        summedDistance = summedDistance + distance;

        yMin = Math.min(yMin, elev);
        yMax = Math.max(yMax, elev);

        xyS.add(summedDistance, (int) elev);
    }
    return xyS;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:53,代码来源:ProfileChartActivity.java

示例14: addXYSeries

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

示例15: getDataset

import org.achartengine.model.XYSeries; //导入方法依赖的package包/类
private XYMultipleSeriesDataset getDataset() {
   ds = new XYMultipleSeriesDataset();
   // 新建一个系列(线条)
   series = new XYSeries("高度走势");
   series.add(10,30);
   series.add(20,50);
   series.add(30,71);
   series.add(40,85);
   series.add(50,90);
     // 把添加了点的折线放入dataset
   ds.addSeries(series);
  
   return ds;
}
 
开发者ID:Tifosi-M,项目名称:Hi-Top,代码行数:15,代码来源:RecDetailsActivity.java


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