本文整理汇总了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);
}
示例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;
}
示例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());
}
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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());
}
}
示例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;
}
示例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);
}
示例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;
}