Can I add IGRelativeStrengthIndexIndicator to a chart that has IGSplineSeries? I tried it already but it does not work. Only the IGRelativeStrengthIndexIndicator is displayed on the chart.
Finally figured this out.
-(NSString*)chartView:(IGChartView*)chartView labelForAxis:(IGAxis*)axis withItem:(NSObject*)item
was returning nil for the newly added axis on the right!
Thanks for all the help.
Okay i see the same in a test app. Now i need to go figure why it does not work on the production app.
This is what I get. Did you try the code snippet I posted or used the axis property setting in your app? Can you see what framework version and build number you're using?
-Max
Now I see a big empty space on the right. the y-axis labels are still not visible.
Send me the screenshot of the chart that the above code produces.
You just have to set the labelsLocation property on the y axis to OutsideRight and you'll see the labels on the right side.
NSArray *data = @[@5, @6, @3]; NSArray *openValues = @[@5, @16, @15,]; NSArray *closeValues = @[@15, @6, @23]; NSArray *highValues = @[@20, @20, @29]; NSArray *lowValues = @[@1, @0, @5];
_chart = [[IGChartView alloc]initWithFrame:self.view.frame]; _categoryHelper = [[IGCategorySeriesDataSourceHelper alloc]initWithValues:data]; _ohlcHelper = [[IGOHLCSeriesDataSourceHelper alloc]initWithOpenValues:openValues highValues:highValues lowValues:lowValues andCloseValues:closeValues];
[_chart addSeriesForType:[IGSplineSeries class] usingKey:@"series" withDataSource:_categoryHelper firstAxisKey:@"x" secondAxisKey:@"y"];
[_chart addSeriesForType:[IGRelativeStrengthIndexIndicator class] usingKey:@"rsi" withDataSource:_ohlcHelper firstAxisKey:@"x" secondAxisKey:@"y2"];
IGNumericYAxis *y = [_chart findAxisByKey:@"y"]; y.labelsLocation = IGAxisLabelsLocationOutsideRight;
[self.view addSubview:_chart];