LoginSignup
23
25

More than 5 years have passed since last update.

[Swift] [iOS] チャート表示ライブラリ [ios-charts] 軸に関する設定

Posted at

目的

[Swift] [iOS] チャート表示ライブラリ [ios-charts]
[Swift] [iOS] チャート表示ライブラリ [ios-charts] 詳細な使い方
の軸に関する設定を紹介する。

プロパティ

ChartAxisBase (軸に関する設定)

ChartComponentBaseを継承

// 軸のラベル(目盛)のフォント、テキストカラー
.labelFont = UIFont.systemFontOfSize(10.0)
.labelTextColor = UIColor.blackColor()

// 軸の色、太さ
axisLineColor = UIColor.grayColor()
axisLineWidth = CGFloat(0.5)

// グリッド線の色、太さ
.gridColor = UIColor.grayColor().colorWithAlphaComponent(0.9)
.gridLineWidth = CGFloat(0.5)

// グリッド線の表示
.drawGridLinesEnabled = true

// 軸の表示
.drawAxisLineEnabled = true

// ラベル(目盛)の表示
.drawLabelsEnabled = true

// ?
.drawLimitLinesBehindDataEnabled = false

ChartYAxis (Y軸に関する設定)

ChartAxisBaseを継承

// Y軸のラベル(目盛)の個数
.labelCount = Int(6)

// Y軸の一番上のラベルの表示
.drawTopYLabelEntryEnabled = true

// Y軸の最小値、最大値だけ表示
.showOnlyMinMaxEnabled = false

// グラフの方向(false: 上向き, true: 下向き)
.inverted = false

// 0からスタートする
.startAtZeroEnabled = true

// ?
.forceLabelsEnabled = false

ChartXAxis (X軸に関する設定)

ChartAxisBaseを継承

// ?
labelWidth = CGFloat(1.0)

// ?  
labelHeight = CGFloat(1.0)

// ?   
labelRotatedWidth = CGFloat(1.0)

// ?  
labelRotatedHeight = CGFloat(1.0)

// X軸のラベルの傾き度合い 
labelRotationAngle = CGFloat(0.0)

// ?
.spaceBetweenLabels = Int(4)

// ?
.axisLabelModulus = Int(1)

メソッド

詳細は後日

23
25
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
25