LinearLayout achartengine Chart not displaying in ScrollView

淺唱寂寞╮ 提交于 2019-12-03 08:06:23

Under the scrollview you have to insert

android:fillViewport="true"

You will also have to do the following call, otherwise there will be display issues:

renderer.setInScroll(true);

Other solution is to give a size for your LinearLayout @+id/trendchart:

for example:

<LinearLayout
        android:id="@+id/trendchart"
        android:layout_width="fill_parent"
        android:layout_height="180dp"
        android:orientation="vertical" />
    </LinearLayout>

works fine for me.

I've tried the accepted answers but none of them work for me. I solved my problem by adding

chartView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 500));

But don't use
chartView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
because for some reason it still not displaying the chart. Hope that will help someone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!