chasseurmic / TWRCharts

An iOS wrapper for ChartJS. Easily build animated charts by leveraging the power of native Obj-C code.
MIT License
360 stars 51 forks source link

If I want to display two lineChart in two separate UIView in one scene, only one appears. #12

Open jsjdxysuper opened 10 years ago

jsjdxysuper commented 10 years ago

Hi, thank you for your share. If I want to display two lineChart in two separate UIView in one scene, only one appears. The another one would display when it comes back from another scene. why? Or the way that i use it is not correct? Thank you.

jsjdxysuper commented 10 years ago

@property (weak, nonatomic) IBOutlet UIView oneDayLineChartUIView; @property (weak, nonatomic) IBOutlet UIView oneMonthLineChartUIView;

@property(strong, nonatomic) TWRChartView oneDayChartView; @property(strong, nonatomic) TWRChartView oneMonthChartView; //- (void)viewDidLoad
_oneDayChartView = [[TWRChartView alloc] initWithFrame:CGRectMake(0, 64, 300, 200)];
_oneDayChartView.backgroundColor = [UIColor clearColor];
[_oneDayLineChartUIView addSubview:_oneDayChartView];

_oneMonthChartView = [[TWRChartView alloc] initWithFrame:CGRectMake(0, 64, 300, 200)];
_oneMonthChartView.backgroundColor = [UIColor clearColor];
[_oneMonthLineChartUIView addSubview:_oneMonthChartView];

//- (void)viewWillAppear:(BOOL)animated //......set the dataset [_oneDayChartView loadLineChart:line]; [_oneMonthChartView loadLineChart:line1];

brianfox201 commented 8 years ago

I am also facing the same issue. I have 2 pie charts and 1 bar chart in same view controller. But only one chart is displayed. I don't know how to get rid of this issue. Can someone post a solution ?

VitaliiVasylyda commented 6 years ago

Hi, try to create view controller with 2 containers. Maybe this solution help you.