gpt4 book ai didi

ios - swift 中的 X 轴图表标签

转载 作者:行者123 更新时间:2023-11-30 12:48:39 34 4
gpt4 key购买 nike

How to show the last label of time in X-axis

我在我的 xcode 项目中使用了 danielgindi/Charts。这里 X 轴上的最后一个时间标签没有显示。如何在 x 轴标签中显示上次时间。下面附有图片。下面的代码是我使用的:-

   let lineChartDataSet = LineChartDataSet(yVals: dataEntriesline, label: nil)
lineChartDataSet.drawCirclesEnabled = false
lineChartDataSet.colors = [NSUIColor(red: CGFloat(228.0/255), green: CGFloat(204.0/255), blue: CGFloat(88.0/255), alpha: 1)]
lineChartDataSet.lineWidth = 2
lineChartDataSet.setDrawHighlightIndicators(false)

let lineChartData = LineChartData(xVals: dataPoints, dataSet: lineChartDataSet)
magneticChart.xAxis.labelPosition = .Bottom
magneticChart.data = lineChartData
magneticChart.animate(xAxisDuration: 3.0, yAxisDuration: 3.0)
magneticChart.legend.enabled = false
magneticChart.descriptionText = ""
magneticChart.data?.setDrawValues(false)
magneticChart.rightAxis.drawLabelsEnabled = false
magneticChart.xAxis.setLabelsToSkip(239)
magneticChart.xAxis.drawLabelsEnabled = true
magneticChart.drawBordersEnabled = true
magneticChart.borderColor = UIColor.blackColor()
dataEntrieslineIntialMarkerMagnetic = dataEntriesline
magneticChart.xAxis.avoidFirstLastClippingEnabled = false
magneticChart.xAxis.drawLabelsEnabled = true

最佳答案

magneticChart.xAxis.avoidFirstLastClippingEnabled = false

这就是原因。尝试将其设置为 true。

关于ios - swift 中的 X 轴图表标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41299859/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com