Hi,
This example is extract from a project where the zoom and allowPan properties depend on quantity of points received.
However, I have tested a similar code and the selection works ok in iPhones 6s & 6s+.
But, I found that don`t apply the color defined in …labelStyle.textColor.
What’s wrong?
Thank you.
01.
-(
void
)updateChart{
// Change this method in the previous sample code with this one
02.
03.
[_chart
removeAllData
];
04.
_selectedIndex = -
1
;
05.
06.
// x Axis
07.
_chart
.xAxis
.style
.labelStyle
.textColor
= [
UIColor
greenColor
];
08.
_chart
.xAxis
.style
.labelStyle
.font
= [
UIFont
fontWithName
:
@"HelveticaNeue-Light"
size
:
11
];
09.
_chart
.xAxis
.style
.lineHidden
=
NO
;
10.
_chart
.xAxis
.style
.lineStroke
= [TKStroke
strokeWithColor
:[
UIColor
lightGrayColor
]
width
:
0
.3
];
11.
_chart
.xAxis
.style
.majorTickStyle
.ticksHidden
=
YES
;
12.
_chart
.xAxis
.style
.labelStyle
.fitMode
= TKChartAxisLabelFitModeNone;
13.
_chart
.xAxis
.allowPan
=
YES
;
14.
15.
_yMax =
@50
;
16.
_yMin =
@
-
50
;
17.
18.
// y Axis
19.
_chart
.yAxis
.style
.lineHidden
=
YES
;
20.
_chart
.yAxis
.style
.majorTickStyle
.ticksHidden
=
YES
;
21.
_chart
.yAxis
.style
.labelStyle
.textColor
= [
UIColor
grayColor
];
22.
_chart
.yAxis
.style
.labelStyle
.font
= _chart
.xAxis
.style
.labelStyle
.font
;
23.
_chart
.yAxis
.style
.labelStyle
.fitMode
= TKChartAxisLabelFitModeNone;
24.
_chart
.yAxis
.allowPan
=
NO
;
25.
26.
// fill arrPnts Blue
27.
NSMutableArray
*arrPntsBlue = [[
NSMutableArray
alloc]
init
];
28.
for
(
int
i =
0
; i < _arrValuesX
.count
; i++) {
29.
[arrPntsBlue
addObject
:[TKChartDataPoint
dataPointWithX
:_arrValuesX[i]
30.
Y
:_arrValuesBlue[i]]];
31.
}
32.
33.
// Serie sB0 Columns
34.
TKChartColumnSeries
*sB0 = [[
TKChartColumnSeries
alloc]
initWithItems
:arrPntsBlue];
35.
TKChartPaletteItem
*palleteItemBlue = [[
TKChartPaletteItem
alloc]
initWithFill
:[TKSolidFill
solidFillWithColor
:[
UIColor
darkGrayColor
]]];
36.
sB0
.style
.palette
= [TKChartPalette
new
];
37.
[sB0
.style
.palette
addPaletteItem
:palleteItemBlue];
38.
sB0
.selectionMode
= TKChartSeriesSelectionModeDataPoint;
39.
[_chart
addSeries
:sB0];
40.
41.
[_chart
reloadData
];
42.
}