MPAndroidChart:具有三次贝塞尔曲线的LineChart显示错误(尖峰和循环) [英] MPAndroidChart: LineChart with cubic bezier displays wrong (spikes and loops)
本文介绍了MPAndroidChart:具有三次贝塞尔曲线的LineChart显示错误(尖峰和循环)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试绘制具有三次方图的LineChart.结果类似于下面的屏幕快照:三次方贝塞尔曲线显示错误并带有尖峰".有人可以帮我使其正确显示吗?
I am trying to make a LineChart with a cubic plot. The result is like in the screenshot below: the cubic bezier displays wrong and has "spikes". Can someone help me make it appear correctly?
这是我的配置:
LineDataSet lineDataSet = new LineDataSet(entries,nameLabel);
lineDataSet.setColor(Constants.colors.get(i));
lineDataSet.setDrawValues(false);
lineDataSet.setDrawCircles(false);
lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
谢谢
推荐答案
这样的问题可能有多种原因:
Issues like this can have a number of causes:
- 不使用最新版本的MPAndroidChart .确保您使用的是最新版本,其中包括所有错误修复.
-
使用不适用于数据集的立方强度.尝试对以下项使用不同的值进行试验:
- Not using the latest version of MPAndroidChart. Make sure you are using the latest version which includes all of the bug fixes.
Using a cubic intensity that is not appropriate for the DataSet. Try experimenting with different values for:
lineDataSet.setCubicIntensity():
如果这两种方法均失败,则您的DataSet可能需要水平三次方,才能解决此问题:
If both of these approaches fail, your DataSet may require a horizontal cubic which will resolve the issue:
lineDataSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
这篇关于MPAndroidChart:具有三次贝塞尔曲线的LineChart显示错误(尖峰和循环)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文