Search in sources :

Example 1 with BarChartView

use of com.db.chart.view.BarChartView in project WilliamChart by diogobernardino.

the class BarFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.fragment_bar, container, false);
    mChart = (BarChartView) layout.findViewById(R.id.chart);
    mFirstStage = true;
    layout.setOnClickListener(this);
    mChart.setOnClickListener(this);
    BarSet dataset = new BarSet(mLabels, mValues[0]);
    dataset.setColor(Color.parseColor("#eb993b"));
    mChart.addData(dataset);
    mChart.setBarSpacing(Tools.fromDpToPx(3));
    mChart.setXLabels(AxisRenderer.LabelPosition.NONE).setYLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false);
    mChart.show(new Animation().setEasing(new BounceInterpolator()));
    return layout;
}
Also used : BarSet(com.db.chart.model.BarSet) BounceInterpolator(android.view.animation.BounceInterpolator) Animation(com.db.chart.animation.Animation) BarChartView(com.db.chart.view.BarChartView) View(android.view.View)

Aggregations

View (android.view.View)1 BounceInterpolator (android.view.animation.BounceInterpolator)1 Animation (com.db.chart.animation.Animation)1 BarSet (com.db.chart.model.BarSet)1 BarChartView (com.db.chart.view.BarChartView)1