在swift 3中,我做了雷达计划
但我没有找到如何启用它的缩放功能,我甚至没有发现这是否可行。
以下是生成它的代码:
func Radar() {
radarVw.xAxis.valueFormatter = self
var dataEntries: [RadarChartDataEntry] = []
for i in 0..<(useri?.skills!)!.count {
let dataEntry = RadarChartDataEntry(value: (useri?.skills!)![i]["level"].double!)
dataEntries.append(dataEntry)
skillsName.append((useri?.skills!)![i]["name"].string!)
}
let chartDataSet = RadarChartDataSet(values: dataEntries, label: "skills")
let chartData = RadarChartData(dataSet: chartDataSet)
radarVw.xAxis.labelHeight = 0.5
radarVw.xAxis.labelWidth = 0.5
radarVw.legend.enabled = false
radarVw.xAxis.wordWrapEnabled = true
radarVw.data = chartData
radarVw.chartDescription?.text = ""
}