9
I am working in simple bar chart application, Using Coreplot to develop this application, then i try to implement the bar chart but i get the issue found in
[__NSCFConstantString sizeWithTextStyle:]: unrecognized selector sent to instance 0x7fb4c'
First throw call stack:
How to fix this? please help me
Thanks in Advance
I tried this:
Viewcontroller.h
#import <UIKit/UIKit.h>
#import "CorePlot-CocoaTouch.h"
@interface GraphViewController : UIViewController <CPTPlotDataSource>
{
CPTXYGraph *barChart;
NSTimer *timer;
NSMutableArray *samples;
}
-(void) getGraphValues;
@end
Viewcontroller.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor=[UIColor whiteColor];
self.title = @"Sample";
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
[self.navigationController setNavigationBarHidden:NO];
[self getGraphValues];
double xAxisLength = [samples count];
barChart = [[CPTXYGraph alloc] initWithFrame:CGRectMake(0, 0, 320, 380)];
barChart.plotAreaFrame.borderLineStyle = nil;
barChart.plotAreaFrame.cornerRadius = 0.0f;
barChart.paddingLeft = 0.0f;
barChart.paddingRight = 0.0f;
barChart.paddingTop = 0.0f;
barChart.paddingBottom = 0.0f;
barChart.plotAreaFrame.paddingLeft = 60.0;
barChart.plotAreaFrame.paddingTop = 40.0;
barChart.plotAreaFrame.paddingRight = 10.0;
barChart.plotAreaFrame.paddingBottom = 40.0;
barChart.title = @"Sample Innovations";
CPTMutableTextStyle *textStyle = [CPTTextStyle textStyle];
textStyle.color = [CPTColor grayColor];
textStyle.fontSize = 16.0f;
textStyle.textAlignment = CPTTextAlignmentCenter;
barChart.titleTextSty