use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class LineCardTwo method dismiss.
@Override
public void dismiss(Runnable action) {
super.dismiss(action);
mChart.dismiss(new Animation().setStartPoint(1, .5f).setEndAction(action));
}
use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class StackedCardOne method show.
@Override
public void show(Runnable action) {
super.show(action);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
mChart.setOnEntryClickListener(new OnEntryClickListener() {
@SuppressLint("NewApi")
@Override
public void onClick(int setIndex, int entryIndex, Rect rect) {
if (setIndex == 2)
mLegendOneRed.animate().scaleY(1.3f).scaleX(1.3f).setDuration(100).withEndAction(new Runnable() {
@Override
public void run() {
mLegendOneRed.animate().scaleY(1.0f).scaleX(1.0f).setDuration(100);
}
});
else if (setIndex == 1) {
mLegendOneYellow.animate().scaleY(1.3f).scaleX(1.3f).setDuration(100).withEndAction(new Runnable() {
@Override
public void run() {
mLegendOneYellow.animate().scaleY(1.0f).scaleX(1.0f).setDuration(100);
}
});
} else {
mLegendOneGreen.animate().scaleY(1.3f).scaleX(1.3f).setDuration(100).withEndAction(new Runnable() {
@Override
public void run() {
mLegendOneGreen.animate().scaleY(1.0f).scaleX(1.0f).setDuration(100);
}
});
}
}
});
Paint thresPaint = new Paint();
thresPaint.setColor(Color.parseColor("#dad8d6"));
thresPaint.setPathEffect(new DashPathEffect(new float[] { 10, 20 }, 0));
thresPaint.setStyle(Paint.Style.STROKE);
thresPaint.setAntiAlias(true);
thresPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
BarSet stackBarSet = new BarSet(mLabels, mValuesOne[0]);
stackBarSet.setColor(Color.parseColor("#a1d949"));
mChart.addData(stackBarSet);
stackBarSet = new BarSet(mLabels, mValuesOne[1]);
stackBarSet.setColor(Color.parseColor("#ffcc6a"));
mChart.addData(stackBarSet);
stackBarSet = new BarSet(mLabels, mValuesOne[2]);
stackBarSet.setColor(Color.parseColor("#ff7a57"));
mChart.addData(stackBarSet);
mChart.setBarSpacing(Tools.fromDpToPx(15));
mChart.setRoundCorners(Tools.fromDpToPx(1));
mChart.setXAxis(false).setXLabels(XRenderer.LabelPosition.OUTSIDE).setYAxis(false).setYLabels(YRenderer.LabelPosition.NONE).setValueThreshold(89.f, 89.f, thresPaint);
int[] order = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
mChart.show(new Animation().setOverlap(.5f, order).setEndAction(action));
}
use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class StackedCardThree method show.
@Override
public void show(Runnable action) {
super.show(action);
BarSet dataset = new BarSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#687E8E"));
mChart.addData(dataset);
dataset = new BarSet(mLabels, mValues[1]);
dataset.setColor(Color.parseColor("#FF5C8E67"));
mChart.addData(dataset);
mChart.setRoundCorners(Tools.fromDpToPx(5));
mChart.setBarSpacing(Tools.fromDpToPx(5));
mChart.setBorderSpacing(Tools.fromDpToPx(5)).setYLabels(AxisRenderer.LabelPosition.NONE).setXLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false).setAxisBorderValues(-80, 80, 10);
Animation anim = new Animation().setEasing(new DecelerateInterpolator()).setEndAction(action);
mChart.show(anim);
}
use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class StackedCardTwo method dismiss.
@Override
public void dismiss(Runnable action) {
super.dismiss(action);
mChart.dismiss(new Animation().setDuration(2500).setEasing(new AccelerateInterpolator()).setEndAction(action));
}
use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class StackedCardTwo method show.
@Override
public void show(Runnable action) {
super.show(action);
BarSet barSet = new BarSet(mLabels, mValues[0]);
barSet.setColor(Color.parseColor("#90ee7e"));
mChart.addData(barSet);
barSet = new BarSet(mLabels, mValues[1]);
barSet.setColor(Color.parseColor("#2b908f"));
mChart.addData(barSet);
Paint gridPaint = new Paint();
gridPaint.setColor(Color.parseColor("#e7e7e7"));
gridPaint.setStyle(Paint.Style.STROKE);
gridPaint.setAntiAlias(true);
gridPaint.setStrokeWidth(Tools.fromDpToPx(.7f));
mChart.setBarSpacing(Tools.fromDpToPx(10));
mChart.setBorderSpacing(0).setStep(1).setGrid(0, 10, gridPaint).setXAxis(false).setYAxis(false).setLabelsFormat(new DecimalFormat("##'M'")).show(new Animation().setDuration(2500).setEasing(new AccelerateInterpolator()).setEndAction(action));
}
Aggregations