我在我的swift xcodeproject中使用iOS Charts.framework(https://github.com/danielgindi/Charts)。 我的x值是作为字符串的日期,我的y值是0到1000之间的双倍数据。我的测试数据系列大小是392,它在20多个位置的值大于0.0,但其他日期值为0.0(如图所示)在下面的valueArray中)。 LineChart图仅显示5个>>的值。 0.0(如下图所示)。为什么? 是否可以让LineChart显示所有值?或者我应该使用不同的图表库吗?
以下是在下面的数组中显示数据的线图的图像
valueArray = [0.0,0.0,0.0,25.0,0.0,2.0.0,0.0,0.0,0.0,0.0,0.0,0.0,05.0,0.0,0.0,0.0,0.0,50.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,100.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.05,0.0,0.0.0,0.0,0.0,0.0,0.0,0.0 75.0,0.0,2.0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0.0,0.0,0.0,0.0,0.0.0,0.0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,50.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,175.0,0.0,0.0,0.0,0,0,0.0,0.0,0.0,0.0,0.0,0.0.0,0.0,0.0,0.0.0,0.0 0.0,0.0,50.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0.0,0.0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,50.0, 25.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0。 0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0.0,0.0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0.0,0.0,0.0,0.0 0.0,0.0,0.0,0.0,0.0,0.0,50.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0.0,0.0,0.0,0.0.0,0.0,0.0,0.0,0.0,0.0 50.0,25.0]
答案 0 :(得分:0)
您需要在项目中添加以下代码,以解决显示标签问题。
for (id<IChartDataSet> set in chartView.data.dataSets)
{
set.drawValuesEnabled = !set.isDrawValuesEnabled;
}
[chartView setNeedsDisplay];