简体   繁体   English

MPAndroidChart - 比例线图

[英]MPAndroidChart - scale linechart

So I'm using MPAndroidChart to draw a linechart using data from a Firebase Real-time Database.所以我使用 MPAndroidChart 使用 Firebase 实时数据库中的数据绘制折线图。

This is how it shows:它是这样显示的:

折线图

The first point is 2100 and the rest of the points are around 5-6, but because is not scaled, it shows them at 0. How can I scale the chart to show them correctly or can I plot the last 10 points?第一个点是 2100,点的 rest 大约是 5-6,但是由于没有缩放,它显示为 0。如何缩放图表以正确显示它们,或者我可以 plot 最后 10 个点?

From what you write, I understand that all the points are displayed correctly, but the chart is not very useful because of the outlier.从您写的内容来看,我了解到所有点都正确显示,但是由于异常值,图表并不是很有用。 You could zoom in to the lower part of the chart, eg:您可以放大到图表的下部,例如:

chart.zoom(1f, 10f, 0f, 0f)

This zooms in by a factor of 10 on the Y axis and leaves the X axis as is.这会将 Y 轴放大 10 倍,而 X 轴保持原样。

Another solution would be a logarithmic scale, but this seems not to be supported by MpAndroidChart.另一种解决方案是对数刻度,但这似乎不受 MpAndroidChart 支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM