use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class LineCardThree method show.
@Override
public void show(Runnable action) {
super.show(action);
LineSet dataset = new LineSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#53c1bd")).setFill(Color.parseColor("#3d6c73")).setGradientFill(new int[] { Color.parseColor("#364d5a"), Color.parseColor("#3f7178") }, null);
mChart.addData(dataset);
mChart.setBorderSpacing(1).setXLabels(AxisRenderer.LabelPosition.NONE).setYLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false).setBorderSpacing(Tools.fromDpToPx(5));
Animation anim = new Animation().setEndAction(action);
mChart.show(anim);
}
use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class LineCardTwo method show.
@Override
public void show(Runnable action) {
super.show(action);
LineSet dataset = new LineSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#004f7f")).setThickness(Tools.fromDpToPx(3)).setSmooth(true).beginAt(4).endAt(36);
for (int i = 0; i < mLabels.length; i += 5) {
Point point = (Point) dataset.getEntry(i);
point.setColor(Color.parseColor("#ffffff"));
point.setStrokeColor(Color.parseColor("#0290c3"));
if (i == 30 || i == 10)
point.setRadius(Tools.fromDpToPx(6));
}
mChart.addData(dataset);
Paint thresPaint = new Paint();
thresPaint.setColor(Color.parseColor("#0079ae"));
thresPaint.setStyle(Paint.Style.STROKE);
thresPaint.setAntiAlias(true);
thresPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
thresPaint.setPathEffect(new DashPathEffect(new float[] { 10, 10 }, 0));
Paint gridPaint = new Paint();
gridPaint.setColor(Color.parseColor("#ffffff"));
gridPaint.setStyle(Paint.Style.STROKE);
gridPaint.setAntiAlias(true);
gridPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
mChart.setBorderSpacing(Tools.fromDpToPx(0)).setXLabels(AxisRenderer.LabelPosition.OUTSIDE).setLabelsColor(Color.parseColor("#304a00")).setYLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false).setGrid(0, 7, gridPaint).setValueThreshold(80f, 80f, thresPaint).setAxisBorderValues(0, 110);
Animation anim = new Animation().setStartPoint(0, .5f).setEndAction(action);
mChart.show(anim);
}
use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class StackedCardOne method dismiss.
@Override
public void dismiss(Runnable action) {
super.dismiss(action);
int[] order = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
mChart.dismiss(new Animation().setOverlap(.5f, order).setEndAction(action));
}
use of com.db.chart.animation.Animation in project WilliamChart by diogobernardino.
the class LineFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.fragment_line, container, false);
mChart = (LineChartView) layout.findViewById(R.id.chart);
mFirstStage = true;
layout.setOnClickListener(this);
mChart.setOnClickListener(this);
LineSet dataset = new LineSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#004f7f")).setThickness(Tools.fromDpToPx(3)).setSmooth(true).beginAt(4).endAt(36);
for (int i = 0; i < mLabels.length; i += 5) {
Point point = (Point) dataset.getEntry(i);
point.setColor(Color.parseColor("#ffffff"));
point.setStrokeColor(Color.parseColor("#0290c3"));
if (i == 30 || i == 10)
point.setRadius(Tools.fromDpToPx(6));
}
mChart.addData(dataset);
Paint thresPaint = new Paint();
thresPaint.setColor(Color.parseColor("#0079ae"));
thresPaint.setStyle(Paint.Style.STROKE);
thresPaint.setAntiAlias(true);
thresPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
thresPaint.setPathEffect(new DashPathEffect(new float[] { 10, 10 }, 0));
Paint gridPaint = new Paint();
gridPaint.setColor(Color.parseColor("#ffffff"));
gridPaint.setStyle(Paint.Style.STROKE);
gridPaint.setAntiAlias(true);
gridPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
mChart.setBorderSpacing(Tools.fromDpToPx(0)).setXLabels(AxisRenderer.LabelPosition.OUTSIDE).setLabelsColor(Color.parseColor("#304a00")).setYLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false).setGrid(ChartView.GridType.VERTICAL, 1, 7, gridPaint).setValueThreshold(80f, 80f, thresPaint).setAxisBorderValues(0, 110);
mChart.show(new Animation().setStartPoint(0, .5f));
return layout;
}
Aggregations