PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.63k stars 9.02k forks source link

Vertical scrolling in horizontalbarchart #2860

Open rakeshkhoodeeram opened 7 years ago

rakeshkhoodeeram commented 7 years ago

Hello,

I have created a horizontalbarchart and loaded some values. What i am not able to do is: display all the values and add a scrolling. for the moment I an unable to scroll down to view other values of the chart.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.test.test1.MyFragment"
    android:orientation="vertical">

        <com.github.mikephil.charting.charts.HorizontalBarChart
            android:id="@+id/barChart"
            android:padding="0dp"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/colorWhite"
            android:clickable="false"/>
</RelativeLayout>
barChart.setFitBars(true);
barChart.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);

int height =((dataCount+2)*80);
barChart.getLayoutParams().height=height;
barChart.setPadding(0, 50, 0, 0);
barChart.setData(data);
barChart.setDescription(null);
barChart.animateXY(1000, 1000);
barChart.setVisibleYRangeMaximum(10, YAxis.AxisDependency.LEFT);
barChart.setClickable(true);
barChart.setMaxVisibleValueCount(20);
barChart.setDragEnabled(true);
barChart.setScaleEnabled(false);
barChart.invalidate();

`

sureshkona commented 6 years ago

I also require same thing. If its possible please share sample code.

bilalahmadj110 commented 4 years ago

me too