Skip to content
New issue

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

Example for rangeColor in LineChart #449

Open
sureshcapternal opened this issue Oct 31, 2018 · 0 comments
Open

Example for rangeColor in LineChart #449

sureshcapternal opened this issue Oct 31, 2018 · 0 comments

Comments

@sureshcapternal
Copy link

sureshcapternal commented Oct 31, 2018

I have implemented line chart same as attachment.
I want to apply following things,
this is an pill data where,
Y axis label shows pill time. (may be 3 times per day)
X axis shows days of the week.

  1. There is one case where user don't take pill on Tuesday and Thursday. In this case I don't want to show line When user skipped pill.

I am trying to apply

NSArray * data01Array = @[@7.00, @7.00, @7.00, @7.00, @7.00,@7.00,@7.00];
PNLineChartData *data01 = [PNLineChartData new];
data01.rangeColors = @[ [[PNLineChartColorRange alloc] initWithRange:NSMakeRange(10, 30) color:[UIColor redColor]],
[[PNLineChartColorRange alloc] initWithRange:NSMakeRange(7, 7) color:[UIColor purpleColor]]];
data01.rangeColors = [[data01.rangeColors reverseObjectEnumerator] allObjects];

data01.color = ColorName.Walkthrough3;
data01.itemCount = self.lineChart.xLabels.count;
data01.inflexionPointColor = ColorName.Walkthrough3;
data01.inflexionPointStyle = PNLineChartPointStyleCircle;
data01.getData = ^(NSUInteger index) {
    CGFloat yValue = [data01Array[index] floatValue];
    return [PNLineChartDataItem dataItemWithY:yValue];
};

but not able to change color of line

Expected Result
screen shot 2018-10-31 at 9 53 16 pm

Actual Result
screen shot 2018-10-31 at 9 53 16 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant