IOS-charts 方法

IOS-charts 方法
var ViewForLine : [LineChartView] = []
var ViewForBar : [BarChartView] = []

//label: "Line Chart" 圖表示意
let lineChartDataSet = LineChartDataSet(yVals: dataEntries, label: "Line Chart")

let lineChartData = LineChartData(xVals: dataPoints, dataSet: lineChartDataSet)

            //資料來源
            ViewForLine.first!.data = lineChartData
            //圖表背景顏色
            ViewForLine.first!.backgroundColor = UIColor(red: 85/255, green: 85/255, blue: 85/255, alpha: 1)
            //X軸圖標位置
            ViewForLine.first!.xAxis.labelPosition = .Bottom
            //右軸是否開啟
            ViewForLine.first?.rightAxis.enabled = false
            //左軸圖標位置
            ViewForLine.first?.leftAxis.labelTextColor = UIColor.whiteColor()
            //X軸的X刻度標記顏色
            ViewForLine.first?.xAxis.labelTextColor = UIColor.whiteColor()
            //圖表描述文字色彩
            ViewForLine.first?.descriptionTextColor = UIColor.whiteColor()
            //圖表描述文字
            ViewForLine.first?.descriptionText = "descriptionText"
            //繪製右軸軸線
            ViewForLine.first?.rightAxis.drawGridLinesEnabled = false
            //繪製左軸軸線 ViewForLine.first?.leftAxis.drawGridLinesEnabled = false
            //繪製X軸軸線            
            ViewForLine.first?.xAxis.drawGridLinesEnabled = false
            //繪製圖例顏色
            ViewForLine.first?.legend.textColor = UIColor.whiteColor()
            //繪製圖例大小
            ViewForLine.first?.legend.formSize = 15
            //繪製圖例字體大小
            ViewForLine.first?.legend.font = UIFont(name: "TimesNewRomanPS-BoldMT", size:15)!
//繪製軸線顏色
lineChartDataSet.setColor(UIColor(red: 60/255, green: 169/255, blue: 232/255, alpha: 1))           

//繪製軸線標示數據顏色            lineChartData.setValueTextColor(UIColor.whiteColor())


Comments

Popular posts from this blog

MEGA 暫存檔案刪除

IOS GCD多執行緒

利用CMD指令強制刪除