jjoe64图形视图是一个用于Android平台的开源库,用于绘制图形和图表。要使jjoe64图形视图可滚动,可以按照以下步骤进行操作:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.jjoe64.graphview.GraphView
android:id="@+id/graphView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</ScrollView>
GraphView graphView = findViewById(R.id.graphView);
graphView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[] {
new DataPoint(0, 1),
new DataPoint(1, 5),
new DataPoint(2, 3),
new DataPoint(3, 2),
new DataPoint(4, 6)
});
graphView.addSeries(series);
这样,jjoe64图形视图就可以在可滚动的容器中显示,并且可以根据内容的大小进行滚动。
推荐的腾讯云相关产品:腾讯云移动推送服务(https://cloud.tencent.com/product/tpns)、腾讯云云服务器(https://cloud.tencent.com/product/cvm)、腾讯云云数据库 MySQL 版(https://cloud.tencent.com/product/cdb_mysql)、腾讯云对象存储(https://cloud.tencent.com/product/cos)等。
领取专属 10元无门槛券
手把手带您无忧上云