We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to use both PNChart and Yogakit, but the chart could not display correctly. Below is the code in my projct.
UIView *root = self.view; [root configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { layout.isEnabled = YES; layout.flexDirection = YGFlexDirectionColumn; }]; PNLineChart * lineChart = [[PNLineChart alloc] init]; lineChart.backgroundColor = UIColor.whiteColor; [lineChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]]; // Line Chart No.1 NSArray * data01Array = @[@60.1, @160.1, @126.4, @262.2, @186.2]; PNLineChartData *data01 = [PNLineChartData new]; data01.color = PNFreshGreen; data01.itemCount = lineChart.xLabels.count; data01.getData = ^(NSUInteger index) { CGFloat yValue = [data01Array[index] floatValue]; return [PNLineChartDataItem dataItemWithY:yValue]; }; // Line Chart No.2 NSArray * data02Array = @[@20.1, @180.1, @26.4, @202.2, @126.2]; PNLineChartData *data02 = [PNLineChartData new]; data02.color = PNTwitterColor; data02.itemCount = lineChart.xLabels.count; data02.getData = ^(NSUInteger index) { CGFloat yValue = [data02Array[index] floatValue]; return [PNLineChartDataItem dataItemWithY:yValue]; }; lineChart.chartData = @[data01, data02]; [lineChart strokeChart]; [lineChart configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { layout.isEnabled = YES; layout.flex = 7; }]; [root addSubview:lineChart];
Is it possible to set the layout with yoga in pnchart? I am fairly new in ios development, please forgive me if I made it unclear, thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to use both PNChart and Yogakit, but the chart could not display correctly. Below is the code in my projct.
Is it possible to set the layout with yoga in pnchart? I am fairly new in ios development, please forgive me if I made it unclear, thank you.
The text was updated successfully, but these errors were encountered: