2012-12-19 2 views
0

현재 AChartEngine 라이브러리를 사용하고 있으며 스크롤 뷰 내에 3 개의 차트가 있습니다. 이것은 내 레이아웃 파일입니다스크롤 뷰 내의 여러 차트 위로 자동 스크롤

 <ScrollView 
     android:id="@+id/scrollViewChartLayout" 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:fillViewport="true" 
     android:background="@color/black" > 

    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:padding="15dp" > 

     <LinearLayout 
      android:id="@+id/temperatureChartLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="0dp" 
      android:orientation="vertical" 
      android:paddingBottom="30dp" /> 

     <LinearLayout 
      android:id="@+id/humidityChartLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="0dp" 
      android:orientation="vertical" 
      android:paddingBottom="30dp" /> 

     <LinearLayout 
      android:id="@+id/lightChartLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="0dp" 
      android:orientation="vertical" 
      android:paddingBottom="30dp" /> 
    </LinearLayout> 
</ScrollView> 

그리고 렌더러에 내가 사용

renderer.setInScroll(true); 
    renderer.setZoomEnabled(false, false); 
    renderer.setPanEnabled(false, false); 

차트는 correclty을 그립니다하지만 난 스크롤 아래로 스크롤 할 때 뷰가 자동으로 0.5secs 후 스크롤! 무슨 일이야?

답변

2

해결 : 새로운 데이터에 대한 모든 뷰를 다시 그렸습니다 (그리고 데이터가 지속적으로 도착했습니다). mChartView.repaint() 만 사용하면됩니다. 차트를 다시 그리는 방법.

+0

이 문제를 어떻게 해결합니까? – Gunaseelan

+0

@Alvins 스크롤 뷰의 내 차트가 android : fillViewport = "true"없이 표시되지 않습니다. 아이디어가 있습니까? –