TWRCharts icon indicating copy to clipboard operation
TWRCharts copied to clipboard

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

Open jsjdxysuper opened this issue 10 years ago • 3 comments

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 avatar Jul 22 '14 01:07 jsjdxysuper

@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];

jsjdxysuper avatar Jul 22 '14 02:07 jsjdxysuper

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 ?

brianfox201 avatar Feb 19 '16 05:02 brianfox201

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

VitaliiVasylyda avatar Jan 18 '18 07:01 VitaliiVasylyda