回答編集履歴

1

途中までで投稿されてしまった

2017/06/21 01:06

投稿

tantakan
tantakan

スコア34

test CHANGED
@@ -54,4 +54,72 @@
54
54
 
55
55
  ```
56
56
 
57
- このようになっており、
57
+ このようになっており、 `labelCount`に値を保持させています。
58
+
59
+ さて、`labelCount`ですが、
60
+
61
+ ```
62
+
63
+ /// the number of label entries the axis should have
64
+
65
+ /// max = 25,
66
+
67
+ /// min = 2,
68
+
69
+ /// default = 6,
70
+
71
+ /// be aware that this number is not fixed and can only be approximated
72
+
73
+ open var labelCount: Int
74
+
75
+ {
76
+
77
+ get
78
+
79
+ {
80
+
81
+ return _labelCount
82
+
83
+ }
84
+
85
+ set
86
+
87
+ {
88
+
89
+ _labelCount = newValue
90
+
91
+
92
+
93
+ if _labelCount > 25
94
+
95
+ {
96
+
97
+ _labelCount = 25
98
+
99
+ }
100
+
101
+ if _labelCount < 2
102
+
103
+ {
104
+
105
+ _labelCount = 2
106
+
107
+ }
108
+
109
+
110
+
111
+ forceLabelsEnabled = false
112
+
113
+ }
114
+
115
+ }
116
+
117
+ ```
118
+
119
+ このようになっており、実質`_labelCount`の値を返しています。
120
+
121
+ この値は書いてある通り、最小値2、最大値25を保持するようですね。
122
+
123
+
124
+
125
+ それらを元に、元のx軸の最小値と最大値から`labelCount`で割っていった値が来るみたいですね。