Java Code Examples for org.achartengine.model.XYMultipleSeriesDataset

The following are top voted examples for showing how to use org.achartengine.model.XYMultipleSeriesDataset. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: buildAPKsApps   File: ExportTask.java   View source code 6 votes vote down vote up
@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();
}
 
Example 2
Project: buildAPKsApps   File: ChartFactory.java   View source code 6 votes vote down vote up
/**
 * Creates a combined XY chart intent that can be used to start the graphical
 * view activity.
 * 
 * @param context the context
 * @param dataset the multiple series dataset (cannot be null)
 * @param renderer the multiple series renderer (cannot be null)
 * @param types the chart types (cannot be null)
 * @param activityTitle the graphical chart activity title
 * @return a combined XY chart intent
 * @throws IllegalArgumentException if dataset is null or renderer is null or
 *           if a dataset number of items is different than the number of
 *           series renderers or number of chart types
 */
public static final Intent getCombinedXYChartIntent(Context context,
    XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, String[] types,
    String activityTitle) {
  if (dataset == null || renderer == null || types == null
      || dataset.getSeriesCount() != types.length) {
    throw new IllegalArgumentException(
        "Datasets, renderers and types should be not null and the datasets series count should be equal to the types length");
  }
  checkParameters(dataset, renderer);
  Intent intent = new Intent(context, GraphicalActivity.class);
  CombinedXYChart chart = new CombinedXYChart(dataset, renderer, types);
  intent.putExtra(CHART, chart);
  intent.putExtra(TITLE, activityTitle);
  return intent;
}
 
Example 3
Project: gps-measurement-tools   File: PlotFragment.java   View source code 6 votes vote down vote up
public DataSetManager(int numberOfTabs, int numberOfConstellations,
    Context context, ColorMap colorMap) {
  mDataSetList = new ArrayList[numberOfTabs];
  mRendererList = new ArrayList[numberOfTabs];
  mSatelliteIndex = new ArrayList[numberOfTabs];
  mSatelliteConstellationIndex = new ArrayList[numberOfTabs];
  mContext = context;
  mColorMap = colorMap;

  // Preparing data sets and renderer for all six constellations
  for (int i = 0; i < numberOfTabs; i++) {
    mDataSetList[i] = new ArrayList<>();
    mRendererList[i] = new ArrayList<>();
    mSatelliteIndex[i] = new ArrayList<>();
    mSatelliteConstellationIndex[i] = new ArrayList<>();
    for (int k = 0; k <= numberOfConstellations; k++) {
      mSatelliteIndex[i].add(new ArrayMap<Integer, Integer>());
      mSatelliteConstellationIndex[i].add(new ArrayMap<Integer, Integer>());
      XYMultipleSeriesRenderer tempRenderer = new XYMultipleSeriesRenderer();
      setUpRenderer(tempRenderer, i);
      mRendererList[i].add(tempRenderer);
      XYMultipleSeriesDataset tempDataSet = new XYMultipleSeriesDataset();
      mDataSetList[i].add(tempDataSet);
    }
  }
}
 
Example 4
Project: qamardeen-android   File: GraphWidget.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 5
Project: ioiometer   File: ChartFactory.java   View source code 6 votes vote down vote up
/**
 * Creates a combined XY chart intent that can be used to start the graphical
 * view activity.
 * 
 * @param context the context
 * @param dataset the multiple series dataset (cannot be null)
 * @param renderer the multiple series renderer (cannot be null)
 * @param types the chart types (cannot be null)
 * @param activityTitle the graphical chart activity title
 * @return a combined XY chart intent
 * @throws IllegalArgumentException if dataset is null or renderer is null or
 *           if a dataset number of items is different than the number of
 *           series renderers or number of chart types
 */
public static final Intent getCombinedXYChartIntent(Context context,
    XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, String[] types,
    String activityTitle) {
  if (dataset == null || renderer == null || types == null
      || dataset.getSeriesCount() != types.length) {
    throw new IllegalArgumentException(
        "Datasets, renderers and types should be not null and the datasets series count should be equal to the types length");
  }
  checkParameters(dataset, renderer);
  Intent intent = new Intent(context, GraphicalActivity.class);
  CombinedXYChart chart = new CombinedXYChart(dataset, renderer, types);
  intent.putExtra(CHART, chart);
  intent.putExtra(TITLE, activityTitle);
  return intent;
}
 
Example 6
Project: WAIDRecognizer   File: HistoryFragment.java   View source code 6 votes vote down vote up
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;
}
 
Example 7
Project: achartengine   File: AbstractDemoChart.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 8
Project: WAIDRecognizer   File: HistoryFragment.java   View source code 6 votes vote down vote up
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;
}
 
Example 9
Project: BibliophilePlus_Android   File: ChartActivityBase.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 10
Project: learnforandroidfragAS   File: AbstractDemoChart.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 11
Project: learnforandroidfragAS   File: AbstractDemoChart.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 12
Project: moveon   File: Summary3.java   View source code 6 votes vote down vote up
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;
}
 
Example 13
Project: buildAPKsApps   File: CombinedXYChart.java   View source code 5 votes vote down vote up
/**
 * 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);
    }
  }
}
 
Example 14
Project: CalcMate   File: Graph.java   View source code 5 votes vote down vote up
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);
}
 
Example 15
Project: gps-measurement-tools   File: PlotFragment.java   View source code 5 votes vote down vote up
/**
 * 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);
  }
}
 
Example 16
Project: gps-measurement-tools   File: PlotFragment.java   View source code 5 votes vote down vote up
/**
 * Creates a discontinuity of the satellites that has been seen but not reported in this batch
 * of measurements
 */
private void fillInDiscontinuity(int tab, double referenceTimeSeconds) {
  for (XYMultipleSeriesDataset dataSet : mDataSetList[tab]) {
    for (int i = 0; i < dataSet.getSeriesCount(); i++) {
      if (dataSet.getSeriesAt(i).getMaxX() < referenceTimeSeconds) {
        dataSet.getSeriesAt(i).add(referenceTimeSeconds, MathHelper.NULL_VALUE);
      }
    }
  }
}
 
Example 17
Project: DeviceConnect-Android   File: HitoeProfileECGFragment.java   View source code 5 votes vote down vote up
/**
 * 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);
}
 
Example 18
Project: DeviceConnect-Android   File: HitoeProfileDeviceOrientationFragment.java   View source code 5 votes vote down vote up
/**
 * 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);
}
 
Example 19
Project: MiBandDecompiled   File: ChartFactory.java   View source code 5 votes vote down vote up
public static final Intent getLineChartIntent(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, String s)
{
    a(xymultipleseriesdataset, xymultipleseriesrenderer);
    Intent intent = new Intent(context, org/achartengine/GraphicalActivity);
    intent.putExtra("chart", new LineChart(xymultipleseriesdataset, xymultipleseriesrenderer));
    intent.putExtra("title", s);
    return intent;
}
 
Example 20
Project: ioiometer   File: CombinedXYChart.java   View source code 5 votes vote down vote up
/**
 * 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);
    }
  }
}
 
Example 21
Project: MiBandDecompiled   File: ChartFactory.java   View source code 5 votes vote down vote up
public static final Intent getRangeBarChartIntent(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, org.achartengine.chart.BarChart.Type type, String s)
{
    a(xymultipleseriesdataset, xymultipleseriesrenderer);
    Intent intent = new Intent(context, org/achartengine/GraphicalActivity);
    intent.putExtra("chart", new RangeBarChart(xymultipleseriesdataset, xymultipleseriesrenderer, type));
    intent.putExtra("title", s);
    return intent;
}
 
Example 22
Project: achartengine   File: AbstractDemoChart.java   View source code 5 votes vote down vote up
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);
  }
}
 
Example 23
Project: achartengine   File: AbstractDemoChart.java   View source code 5 votes vote down vote up
/**
 * 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;
}
 
Example 24
Project: achartengine   File: ProjectStatusBubbleChart.java   View source code 5 votes vote down vote up
/**
 * 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");
}
 
Example 25
Project: achartengine   File: XYChartBuilder.java   View source code 5 votes vote down vote up
@Override
protected void onRestoreInstanceState(Bundle savedState) {
  super.onRestoreInstanceState(savedState);
  // restore the current data, for instance when changing the screen
  // orientation
  mDataset = (XYMultipleSeriesDataset) savedState.getSerializable("dataset");
  mRenderer = (XYMultipleSeriesRenderer) savedState.getSerializable("renderer");
  mCurrentSeries = (XYSeries) savedState.getSerializable("current_series");
  mCurrentRenderer = (XYSeriesRenderer) savedState.getSerializable("current_renderer");
}
 
Example 26
Project: achartengine   File: XYChartBuilderBackup.java   View source code 5 votes vote down vote up
@Override
protected void onRestoreInstanceState(Bundle savedState) {
  super.onRestoreInstanceState(savedState);
  // restore the current data, for instance when changing the screen
  // orientation
  mDataset = (XYMultipleSeriesDataset) savedState.getSerializable("dataset");
  mRenderer = (XYMultipleSeriesRenderer) savedState.getSerializable("renderer");
  mCurrentSeries = (XYSeries) savedState.getSerializable("current_series");
  mCurrentRenderer = (XYSeriesRenderer) savedState.getSerializable("current_renderer");
}
 
Example 27
Project: achartengine   File: GeneratedChartDemo.java   View source code 5 votes vote down vote up
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;
}
 
Example 28
Project: achartengine   File: GeneratedChartDemo.java   View source code 5 votes vote down vote up
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;
}
 
Example 29
Project: MiBandDecompiled   File: ChartFactory.java   View source code 5 votes vote down vote up
public static final Intent getBubbleChartIntent(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, String s)
{
    a(xymultipleseriesdataset, xymultipleseriesrenderer);
    Intent intent = new Intent(context, org/achartengine/GraphicalActivity);
    intent.putExtra("chart", new BubbleChart(xymultipleseriesdataset, xymultipleseriesrenderer));
    intent.putExtra("title", s);
    return intent;
}
 
Example 30
Project: MiBandDecompiled   File: ChartFactory.java   View source code 5 votes vote down vote up
public static final Intent getCombinedXYChartIntent(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, String as[], String s)
{
    if (xymultipleseriesdataset == null || xymultipleseriesrenderer == null || as == null || xymultipleseriesdataset.getSeriesCount() != as.length)
    {
        throw new IllegalArgumentException("Datasets, renderers and types should be not null and the datasets series count should be equal to the types length");
    } else
    {
        a(xymultipleseriesdataset, xymultipleseriesrenderer);
        Intent intent = new Intent(context, org/achartengine/GraphicalActivity);
        intent.putExtra("chart", new CombinedXYChart(xymultipleseriesdataset, xymultipleseriesrenderer, as));
        intent.putExtra("title", s);
        return intent;
    }
}
 
Example 31
Project: MiBandDecompiled   File: ChartFactory.java   View source code 5 votes vote down vote up
public static final Intent getTimeChartIntent(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, String s, String s1)
{
    a(xymultipleseriesdataset, xymultipleseriesrenderer);
    Intent intent = new Intent(context, org/achartengine/GraphicalActivity);
    TimeChart timechart = new TimeChart(xymultipleseriesdataset, xymultipleseriesrenderer);
    timechart.setDateFormat(s);
    intent.putExtra("chart", timechart);
    intent.putExtra("title", s1);
    return intent;
}
 
Example 32
Project: MiBandDecompiled   File: ChartFactory.java   View source code 5 votes vote down vote up
public static final Intent getBarChartIntent(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, org.achartengine.chart.BarChart.Type type, String s)
{
    a(xymultipleseriesdataset, xymultipleseriesrenderer);
    Intent intent = new Intent(context, org/achartengine/GraphicalActivity);
    intent.putExtra("chart", new BarChart(xymultipleseriesdataset, xymultipleseriesrenderer, type));
    intent.putExtra("title", s);
    return intent;
}
 
Example 33
Project: MiBandDecompiled   File: ChartFactory.java   View source code 5 votes vote down vote up
public static final GraphicalView getTimeChartView(Context context, XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, String s)
{
    a(xymultipleseriesdataset, xymultipleseriesrenderer);
    TimeChart timechart = new TimeChart(xymultipleseriesdataset, xymultipleseriesrenderer);
    timechart.setDateFormat(s);
    return new GraphicalView(context, timechart);
}
 
Example 34
Project: BibliophilePlus_Android   File: ChartActivityBase.java   View source code 5 votes vote down vote up
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);
  }
}
 
Example 35
Project: BibliophilePlus_Android   File: ChartActivityBase.java   View source code 5 votes vote down vote up
/**
 * 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;
}
 
Example 36
Project: MiBandDecompiled   File: CubicLineChart.java   View source code 5 votes vote down vote up
public CubicLineChart(XYMultipleSeriesDataset xymultipleseriesdataset, XYMultipleSeriesRenderer xymultipleseriesrenderer, float f)
{
    super(xymultipleseriesdataset, xymultipleseriesrenderer);
    c = new Point();
    d = new Point();
    e = new Point();
    a = f;
    b = 1.0F - a;
}
 
Example 37
Project: buildAPKsApps   File: XYChart.java   View source code 4 votes vote down vote up
protected void setDatasetRenderer(XYMultipleSeriesDataset dataset,
    XYMultipleSeriesRenderer renderer) {
  mDataset = dataset;
  mRenderer = renderer;
}
 
Example 38
Project: buildAPKsApps   File: XYChart.java   View source code 4 votes vote down vote up
public XYMultipleSeriesDataset getDataset() {
  return mDataset;
}
 
Example 39
Project: buildAPKsApps   File: ScatterChart.java   View source code 4 votes vote down vote up
protected void setDatasetRenderer(XYMultipleSeriesDataset dataset,
    XYMultipleSeriesRenderer renderer) {
  super.setDatasetRenderer(dataset, renderer);
  size = renderer.getPointSize();
}
 
Example 40
Project: CalcMate   File: Graph.java   View source code 4 votes vote down vote up
public XYMultipleSeriesDataset getDataset() {
    return mDataset;
}