Last active
July 14, 2021 05:27
-
-
Save touyu/0e0df8e2b041c2b0dc41 to your computer and use it in GitHub Desktop.
[Swift] [iOS] チャート表示ライブラリ [ios-charts] 詳細な使い方 ref: http://qiita.com/touyu/items/9b77647cf7c97362da10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// タップでデータを選択できるか | |
.highlightPerTapEnabled = true | |
// 指を離してもスクロールが続くか | |
.dragDecelerationEnabled = true | |
// 指を離してからの自動スクロールの減速度合い(0~1) | |
.dragDecelerationFrictionCoef = 0.9 | |
// description textのフォント、フォントカラー | |
.descriptionFont = UIFont(name: "HelveticaNeue", size: 9.0) | |
.descriptionTextColor UIColor.blackColor() | |
// description textの整列 | |
.descriptionTextAlign = NSTextAlignment.Right | |
// description textの表示位置 | |
.descriptionTextPosition = nil | |
// information textのフォント、フォントカラー | |
.infoFont = UIFont(name: "HelveticaNeue", size: 12.0) | |
.infoTextColor = UIColor(red: 247.0/255.0, green: 189.0/255.0, blue: 51.0/255.0, alpha: 1.0) // orange | |
// description textの内容 | |
.descriptionText = "Description" | |
// データがない時に表示するテキスト | |
.noDataText = "No chart data available." | |
// なぜ、データが無いかを説明するテキスト | |
.noDataTextDescription = "" | |
// グラフの余白 | |
.extraTopOffset = 0.0 | |
.extraRightOffset = 0.0 | |
.extraBottomOffset = 0.0 | |
.extraLeftOffset = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ピンチでズームが可能か | |
.pinchZoomEnabled = false | |
// ダブルタップでズームが可能か | |
.doubleTapToZoomEnabled = true | |
// ドラッグ可能か | |
.dragEnabled = true | |
// X,Y方向にズーム可能か | |
.scaleYEnabled = true | |
.scaleYEnabled = true | |
// チャートエリアの背景色 | |
.gridBackgroundColor = UIColor(red: 240/255.0, green: 240/255.0, blue: 240/255.0, alpha: 1.0) | |
// ボーダーの色、太さ | |
borderColor = UIColor.blackColor() | |
borderLineWidth: CGFloat = 1.0 | |
// グリッド線の表示 | |
.drawGridBackgroundEnabled = false | |
// 境界線の表示 | |
.drawBordersEnabled = false | |
// 最小のオフセット | |
.minOffset = CGFloat(10.0) | |
// 左のY軸 | |
.leftAxis: ChartYAxis! | |
// 右のY軸 | |
.rightAxis: ChartYAxis! | |
// X軸 | |
.xAxis: ChartXAxis! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 選択されたバーの右上に三角形の印でハイライトするか | |
.drawHighlightArrowEnabled = false | |
// バー上にある値の表示(バー内か、バーより上か) | |
.drawValueAboveBarEnabled = true | |
// それぞれのバーにグレーのエリアが描画される | |
.drawHighlightArrowEnabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// グラフの余白 | |
func setExtraOffsets(left left: CGFloat, top: CGFloat, right: CGFloat, bottom: CGFloat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ? | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 選択されたバーの右上に三角形の印でハイライトするか | |
.drawHighlightArrowEnabled = false | |
// バー上にある値の表示(バー内か、バーより上か) | |
.drawValueAboveBarEnabled = true | |
// それぞれのバーにグレーのエリアが描画される | |
.drawHighlightArrowEnabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// グラフの余白 | |
func setExtraOffsets(left left: CGFloat, top: CGFloat, right: CGFloat, bottom: CGFloat) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment