Search in sources :

Example 16 with Animation

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);
}
Also used : Animation(com.db.chart.animation.Animation) LineSet(com.db.chart.model.LineSet)

Example 17 with Animation

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);
}
Also used : Animation(com.db.chart.animation.Animation) DashPathEffect(android.graphics.DashPathEffect) Point(com.db.chart.model.Point) Paint(android.graphics.Paint) LineSet(com.db.chart.model.LineSet) Point(com.db.chart.model.Point) Paint(android.graphics.Paint)

Example 18 with Animation

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));
}
Also used : Animation(com.db.chart.animation.Animation)

Example 19 with Animation

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;
}
Also used : Animation(com.db.chart.animation.Animation) DashPathEffect(android.graphics.DashPathEffect) Point(com.db.chart.model.Point) Paint(android.graphics.Paint) ChartView(com.db.chart.view.ChartView) View(android.view.View) LineChartView(com.db.chart.view.LineChartView) LineSet(com.db.chart.model.LineSet) Point(com.db.chart.model.Point) Paint(android.graphics.Paint)

Aggregations

Animation (com.db.chart.animation.Animation)19 BarSet (com.db.chart.model.BarSet)8 Paint (android.graphics.Paint)5 DashPathEffect (android.graphics.DashPathEffect)4 View (android.view.View)4 LineSet (com.db.chart.model.LineSet)4 BounceInterpolator (android.view.animation.BounceInterpolator)3 Tooltip (com.db.chart.tooltip.Tooltip)3 Rect (android.graphics.Rect)2 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)2 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 TextView (android.widget.TextView)2 OnEntryClickListener (com.db.chart.listener.OnEntryClickListener)2 Point (com.db.chart.model.Point)2 PropertyValuesHolder (android.animation.PropertyValuesHolder)1 CardView (android.support.v7.widget.CardView)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 Bar (com.db.chart.model.Bar)1 BarChartView (com.db.chart.view.BarChartView)1 ChartView (com.db.chart.view.ChartView)1