我在2個月後更新了ios-charts到最新的代碼。當我運行代碼時,我看到很多不同之處。用最新的ioscharts顯示條形圖的問題
這是更新庫之前:
更新後:
下面是生成圖表的代碼:
chart.infoTextColor = UIColor.blackColor()
chart.backgroundColor = UIColor.whiteColor()
chart.descriptionText = ""
chart.noDataText = "Loading..."
chart.rightAxis.enabled = false
chart.xAxis.wordWrapEnabled = true
chart.legend.position = .BelowChartCenter;
chart.legend.form = .Circle;
chart.legend.formSize = 10.0;
chart.legend.formToTextSpace = 10.0;
chart.legend.xEntrySpace = 4.0;
chart.legend.yEntrySpace = 2.0
chart.legend.stackSpace = 5.0
chart.legend.textColor = UIColor.blueColor()
chart.xAxis.gridColor = UIColor.blueColor()
// chart.xAxis.axisLineColor = UIColor.blueColor()
chart.gridBackgroundColor = UIColor.whiteColor()
chart.borderColor = UIColor.redColor()
// chart.xAxis.labelHeight = 18
// chart.xAxis.labelWidth = 18
chart.xAxis.labelPosition = .Bottom;
chart.xAxis.drawGridLinesEnabled = false;
chart.rightAxis.drawGridLinesEnabled = false;
//zooming..
chart.pinchZoomEnabled = false
chart.doubleTapToZoomEnabled = false
chart.scaleXEnabled = false
chart.scaleYEnabled = false
//new..
chart.leftAxis.labelPosition = .InsideChart
chartDataSet.barSpace = 0.38
看來你有你的代碼有問題。但是,除非我們有[可以重現問題的代碼或信息](http://stackoverflow.com/help/mcve),否則我們無法提供幫助。否則,我們只是盲目猜測。 – gunr2171
這個屏幕截圖只是舊的以及更新的代碼。我爲這兩個圖表傳遞了相同的信息。 – Ash
你能編輯你的文章以包含代碼嗎?你將需要發佈你的設置圖表功能以及數據輸入,數據集等。 – Shen