hellocharts-android-Hellocharts 怎么设置缩放比例,缩放级别

2025-05-11 09:24:40
推荐回答(1个)
回答1:

hellocharts-android-Hellocharts 设置缩放比例,缩放级别方法:

Viewport tempViewport = new Viewport(0, chart.getMaximumViewport().height(), 9, 0) ;
chart.setCurrentViewport(tempViewport);//setCurrentViewport(tempViewport1, false);
即:
new Viewport(float left, float top, float right, float bottom)
left:0//X轴为0
top: chart.getMaximumViewport()//Y轴的最大值
right: 9//X轴显示9列
bottom:0//Y轴为0

如图: