Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一种方法来修复图形视图包的 y 轴。我正在显示实时频谱,但由于 y 轴调整到当前最大值,因此无法正确可视化数据。请指教。我将悬赏任何可以轻松解决我的问题的答案。
包:http ://android-graphview.org/#documentation
如果您知道 Y 轴的范围,则可以使用方法 setManualYAxisBounds(max,min)。例如,如果您使用的是 sin 函数,
graphView.setManualYAxisBounds(1,-1);
或者,如果您的图表是百分比图,
graphView.setManualYAxisBounds(100,0);
如果您有要在数组中绘制的值,则该方法可以再次与数组的最大值和最小值一起使用(格式看起来更整洁)。