本文整理匯總了Java中org.achartengine.model.XYMultipleSeriesDataset.addSeries方法的典型用法代碼示例。如果您正苦於以下問題:Java XYMultipleSeriesDataset.addSeries方法的具體用法?Java XYMultipleSeriesDataset.addSeries怎麽用?Java XYMultipleSeriesDataset.addSeries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.achartengine.model.XYMultipleSeriesDataset
的用法示例。
在下文中一共展示了XYMultipleSeriesDataset.addSeries方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildDateDataset
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
/**
* Builds an XY multiple time dataset using the provided values.
*
* @param titles the series titles
* @param xValues the values for the X axis
* @param yValues the values for the Y axis
* @return the XY multiple time dataset
*/
protected XYMultipleSeriesDataset buildDateDataset(String[] titles, List<Date[]> xValues,
List<double[]> yValues) {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
int length = titles.length;
for (int i = 0; i < length; i++) {
TimeSeries series = new TimeSeries(titles[i]);
Date[] 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);
}
return dataset;
}
示例2: getGyroscopeData
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
private XYMultipleSeriesDataset getGyroscopeData() {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
TimeSeries avggSeries = new TimeSeries("Average");
TimeSeries mingSeries = new TimeSeries("Minimum");
TimeSeries maxgSeries = new TimeSeries("Maximum");
dataset.addSeries(avggSeries);
dataset.addSeries(mingSeries);
dataset.addSeries(maxgSeries);
for (int i = 0; i < mHistoryList.size(); i++) {
VehicleInstance item = mHistoryList.get(i);
Long timestamp = item.getTimestamp();
MagnitudeFeatures gyroFeatures = item.getGyroFeatures();
Double avgg = gyroFeatures.getAverage();
Double maxg = gyroFeatures.getMaximum();
Double ming = gyroFeatures.getMinimum();
avggSeries.add(timestamp.doubleValue(), avgg);
mingSeries.add(timestamp.doubleValue(), ming);
maxgSeries.add(timestamp.doubleValue(), maxg);
}
return dataset;
}
示例3: buildDateDataset
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
/**
* Builds an XY multiple time dataset using the provided values.
*
* @param titles the series titles
* @param xValues the values for the X axis
* @param yValues the values for the Y axis
* @return the XY multiple time dataset
*/
protected XYMultipleSeriesDataset buildDateDataset(String[] titles, List<Date[]> xValues,
List<double[]> yValues) {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
int length = titles.length;
for (int i = 0; i < length; i++) {
TimeSeries series = new TimeSeries(titles[i]);
Date[] 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);
}
return dataset;
}
示例4: getAccelerometerData
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
private XYMultipleSeriesDataset getAccelerometerData() {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
TimeSeries avgaSeries = new TimeSeries("Average");
TimeSeries minaSeries = new TimeSeries("Minimum");
TimeSeries maxaSeries = new TimeSeries("Maximum");
dataset.addSeries(avgaSeries);
dataset.addSeries(minaSeries);
dataset.addSeries(maxaSeries);
for (int i = 0; i < mHistoryList.size(); i++) {
VehicleInstance item = mHistoryList.get(i);
Long timestamp = item.getTimestamp();
MagnitudeFeatures accelFeatures = item.getAccelFeatures();
Double avga = accelFeatures.getAverage();
Double maxa = accelFeatures.getMaximum();
Double mina = accelFeatures.getMinimum();
avgaSeries.add(timestamp.doubleValue(), avga);
minaSeries.add(timestamp.doubleValue(), mina);
maxaSeries.add(timestamp.doubleValue(), maxa);
}
return dataset;
}
示例5: buildBarDataset
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
/**
* Builds a bar multiple series dataset using the provided values.
*
* @param titles
* the series titles
* @param values
* the values
* @return the XY multiple bar dataset
*/
protected XYMultipleSeriesDataset buildBarDataset(String[] titles,
List<double[]> values) {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
int length = titles.length;
for (int i = 0; i < length; i++) {
CategorySeries series = new CategorySeries(titles[i]);
double[] v = values.get(i);
int seriesLength = v.length;
for (int k = 0; k < seriesLength; k++) {
series.add(v[k]);
}
dataset.addSeries(series.toXYSeries());
}
return dataset;
}
示例6: getDataset_type1
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的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;
}
示例7: CombinedXYChart
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
/**
* Builds a new combined XY chart instance.
*
* @param dataset the multiple series dataset
* @param renderer the multiple series renderer
* @param types the XY chart types
*/
public CombinedXYChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer,
String[] types) {
super(dataset, renderer);
int length = types.length;
mCharts = new XYChart[length];
for (int i = 0; i < length; i++) {
try {
mCharts[i] = getXYChart(types[i]);
} catch (Exception e) {
// ignore
}
if (mCharts[i] == null) {
throw new IllegalArgumentException("Unknown chart type " + types[i]);
} else {
XYMultipleSeriesDataset newDataset = new XYMultipleSeriesDataset();
newDataset.addSeries(dataset.getSeriesAt(i));
XYMultipleSeriesRenderer newRenderer = new XYMultipleSeriesRenderer();
// TODO: copy other parameters here
newRenderer.setBarSpacing(renderer.getBarSpacing());
newRenderer.setPointSize(renderer.getPointSize());
int scale = dataset.getSeriesAt(i).getScaleNumber();
if (renderer.isMinXSet(scale)) {
newRenderer.setXAxisMin(renderer.getXAxisMin(scale));
}
if (renderer.isMaxXSet(scale)) {
newRenderer.setXAxisMax(renderer.getXAxisMax(scale));
}
if (renderer.isMinYSet(scale)) {
newRenderer.setYAxisMin(renderer.getYAxisMin(scale));
}
if (renderer.isMaxYSet(scale)) {
newRenderer.setYAxisMax(renderer.getYAxisMax(scale));
}
newRenderer.addSeriesRenderer(renderer.getSeriesRendererAt(i));
mCharts[i].setDatasetRenderer(newDataset, newRenderer);
}
}
}
示例8: addXYSeries
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的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);
}
示例9: addValue
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的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);
}
}
示例10: addXYSeries
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的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: buildBarDataset
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
/**
* Builds a bar multiple series dataset using the provided values.
*
* @param titles the series titles
* @param values the values
* @return the XY multiple bar dataset
*/
protected XYMultipleSeriesDataset buildBarDataset(String[] titles, List<double[]> values) {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
int length = titles.length;
for (int i = 0; i < length; i++) {
CategorySeries series = new CategorySeries(titles[i]);
double[] v = values.get(i);
int seriesLength = v.length;
for (int k = 0; k < seriesLength; k++) {
series.add(v[k]);
}
dataset.addSeries(series.toXYSeries());
}
return dataset;
}
示例12: execute
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
/**
* Executes the chart demo.
*
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
XYMultipleSeriesDataset series = new XYMultipleSeriesDataset();
XYValueSeries newTicketSeries = new XYValueSeries("New Tickets");
newTicketSeries.add(1f, 2, 14);
newTicketSeries.add(2f, 2, 12);
newTicketSeries.add(3f, 2, 18);
newTicketSeries.add(4f, 2, 5);
newTicketSeries.add(5f, 2, 1);
series.addSeries(newTicketSeries);
XYValueSeries fixedTicketSeries = new XYValueSeries("Fixed Tickets");
fixedTicketSeries.add(1f, 1, 7);
fixedTicketSeries.add(2f, 1, 4);
fixedTicketSeries.add(3f, 1, 18);
fixedTicketSeries.add(4f, 1, 3);
fixedTicketSeries.add(5f, 1, 1);
series.addSeries(fixedTicketSeries);
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
renderer.setAxisTitleTextSize(16);
renderer.setChartTitleTextSize(20);
renderer.setLabelsTextSize(15);
renderer.setLegendTextSize(15);
renderer.setMargins(new int[] { 20, 30, 15, 0 });
XYSeriesRenderer newTicketRenderer = new XYSeriesRenderer();
newTicketRenderer.setColor(Color.BLUE);
renderer.addSeriesRenderer(newTicketRenderer);
XYSeriesRenderer fixedTicketRenderer = new XYSeriesRenderer();
fixedTicketRenderer.setColor(Color.GREEN);
renderer.addSeriesRenderer(fixedTicketRenderer);
setChartSettings(renderer, "Project work status", "Priority", "", 0.5, 5.5, 0, 5, Color.GRAY,
Color.LTGRAY);
renderer.setXLabels(7);
renderer.setYLabels(0);
renderer.setShowGrid(false);
return ChartFactory.getBubbleChartIntent(context, series, renderer, "Project tickets");
}
示例13: getDemoDataset
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的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;
}
示例14: getDateDemoDataset
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
private XYMultipleSeriesDataset getDateDemoDataset() {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
final int nr = 10;
long value = new Date().getTime() - 3 * TimeChart.DAY;
Random r = new Random();
for (int i = 0; i < SERIES_NR; i++) {
TimeSeries series = new TimeSeries("Demo series " + (i + 1));
for (int k = 0; k < nr; k++) {
series.add(new Date(value + k * TimeChart.DAY / 4), 20 + r.nextInt() % 100);
}
dataset.addSeries(series);
}
return dataset;
}
示例15: getBarDemoDataset
import org.achartengine.model.XYMultipleSeriesDataset; //導入方法依賴的package包/類
private XYMultipleSeriesDataset getBarDemoDataset() {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
final int nr = 10;
Random r = new Random();
for (int i = 0; i < SERIES_NR; i++) {
CategorySeries series = new CategorySeries("Demo series " + (i + 1));
for (int k = 0; k < nr; k++) {
series.add(100 + r.nextInt() % 100);
}
dataset.addSeries(series.toXYSeries());
}
return dataset;
}