use of org.achartengine.model.XYValueSeries in project sensorreadout by onyxbits.
the class BubbleChart method drawSeries.
/**
* The graphical representation of a series.
*
* @param canvas the canvas to paint to
* @param paint the paint to be used for drawing
* @param points the array of points to be used for drawing the series
* @param seriesRenderer the series renderer
* @param yAxisValue the minimum value of the y axis
* @param seriesIndex the index of the series currently being drawn
* @param startIndex the start index of the rendering points
*/
@Override
public void drawSeries(Canvas canvas, Paint paint, List<Float> points, XYSeriesRenderer renderer, float yAxisValue, int seriesIndex, int startIndex) {
paint.setColor(renderer.getColor());
paint.setStyle(Style.FILL);
int length = points.size();
XYValueSeries series = (XYValueSeries) mDataset.getSeriesAt(seriesIndex);
double max = series.getMaxValue();
double coef = MAX_BUBBLE_SIZE / max;
for (int i = 0; i < length; i += 2) {
double size = series.getValue(startIndex + i / 2) * coef + MIN_BUBBLE_SIZE;
drawCircle(canvas, paint, points.get(i), points.get(i + 1), (float) size);
}
}
use of org.achartengine.model.XYValueSeries in project sensorreadout by onyxbits.
the class BubbleChart method clickableAreasForPoints.
@Override
protected ClickableArea[] clickableAreasForPoints(List<Float> points, List<Double> values, float yAxisValue, int seriesIndex, int startIndex) {
int length = points.size();
XYValueSeries series = (XYValueSeries) mDataset.getSeriesAt(seriesIndex);
double max = series.getMaxValue();
double coef = MAX_BUBBLE_SIZE / max;
ClickableArea[] ret = new ClickableArea[length / 2];
for (int i = 0; i < length; i += 2) {
double size = series.getValue(startIndex + i / 2) * coef + MIN_BUBBLE_SIZE;
ret[i / 2] = new ClickableArea(new RectF(points.get(i) - (float) size, points.get(i + 1) - (float) size, points.get(i) + (float) size, points.get(i + 1) + (float) size), values.get(i), values.get(i + 1));
}
return ret;
}
use of org.achartengine.model.XYValueSeries in project Anki-Android by Ramblurr.
the class BubbleChart method clickableAreasForPoints.
@Override
protected ClickableArea[] clickableAreasForPoints(float[] points, double[] values, float yAxisValue, int seriesIndex, int startIndex, int range) {
int length = points.length;
XYValueSeries series = (XYValueSeries) mDataset.getSeriesAt(seriesIndex);
double max = series.getMaxValue();
double coef = MAX_BUBBLE_SIZE / max;
ClickableArea[] ret = new ClickableArea[length / 2];
for (int i = 0; i < length; i += 2) {
double size = series.getValue(startIndex + i / 2) * coef + MIN_BUBBLE_SIZE;
ret[i / 2] = new ClickableArea(new RectF(points[i] - (float) size, points[i + 1] - (float) size, points[i] + (float) size, points[i + 1] + (float) size), values[i], values[i + 1]);
}
return ret;
}
use of org.achartengine.model.XYValueSeries in project Anki-Android by Ramblurr.
the class BubbleChart method drawSeries.
/**
* The graphical representation of a series.
*
* @param canvas the canvas to paint to
* @param paint the paint to be used for drawing
* @param points the array of points to be used for drawing the series
* @param seriesRenderer the series renderer
* @param yAxisValue the minimum value of the y axis
* @param seriesIndex the index of the series currently being drawn
* @param startIndex the start index of the rendering points
*/
public void drawSeries(Canvas canvas, Paint paint, float[] points, SimpleSeriesRenderer seriesRenderer, float yAxisValue, int seriesIndex, int startIndex, int range) {
XYSeriesRenderer renderer = (XYSeriesRenderer) seriesRenderer;
paint.setColor(renderer.getColor());
paint.setStyle(Style.FILL);
int length = points.length;
XYValueSeries series = (XYValueSeries) mDataset.getSeriesAt(seriesIndex);
double max = series.getMaxValue();
double coef = MAX_BUBBLE_SIZE / max;
for (int i = 0; i < length; i += 2) {
double size = series.getValue(startIndex + i / 2) * coef + MIN_BUBBLE_SIZE;
drawCircle(canvas, paint, points[i], points[i + 1], (float) size);
}
}
Aggregations