如何在MPAndroidChart中从右到左绘制数据? [英] How to plot data from right to left in MPAndroidChart?

查看:266
本文介绍了如何在MPAndroidChart中从右到左绘制数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将 MPAndroidChart 库从1.7.4更新到了2.0.9,我忘了我确实自定义了折线图,以使数据从右向左显示.有人知道吗?我想知道是否有调用该方法的方法.

I recently update the MPAndroidChart library from 1.7.4 to 2.0.9 and I forgot what I did to customize the linechart to make the data displaying from right to left. Does anyone know? I am wondering if there is a method to call to do that.

推荐答案

没有方法.但这仍然可以实现,因为它仅取决于您如何添加数据.

There is no method. But it can still be done because it only depends on how you add the data.

只需先在较高的x索引处添加值.

假设您有一幅图表,其中包含从一月到十二月的x轴标签,并且x轴的范围是0-11(12个值).

Say you got a chart with x-axis labels from January to December with an x-axis range from 0 - 11 (12 values).

现在将12月份的值添加到索引11,依此类推.

Now add the december value at index 11, and so on.

这篇关于如何在MPAndroidChart中从右到左绘制数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆