Open ravrocks opened 5 years ago
Hi,
I don't know if this answer will be bashed. But it worked for me. I just figured it out.
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="horizontal">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical" >
<com.github.mikephil.charting.charts.CombinedChart
android:id="@+id/combinedChartBroodingGrowing"
android:layout_width="3000dp"
android:layout_height="1000dp"
/>
</LinearLayout>
</HorizontalScrollView>
Unfortunately you'll need to specify the layout_width and layout_height explicitly in order for this to work(You'll need to play around and decide what's best for you. Also, please note: I haven't checked for any side effects. Use with discretion. I'm so sorry!). Also make sure setVisibleXRangeMaximum is not set. And then call saveToGallery() as usual. You'll see the entire chart saved to gallery. :)
I have tried using chart.getBitmap() to get the drawable image and save it in gallery. But the bitmap im getting is only for current view of chart. Need help to save the complete chart(not the current view)!