Only one point is displayed if the last two values have the same x
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I'm having troubles displaying points with same x values, but only if they are at the end of the list. It's also reproducible in the Charts Demo app:
If we have two points with the same x, everything is displayed correctly
`[values addObject:[[ChartDataEntry alloc] initWithX:20 y:50 icon: [UIImage imageNamed:@"icon"]]];
[values addObject:[[ChartDataEntry alloc] initWithX:20 y:10 icon: [UIImage imageNamed:@"icon"]]];`

If we have three points, last two of them have the same x, only one of those two is shown
`[values addObject:[[ChartDataEntry alloc] initWithX:10 y:30 icon: [UIImage imageNamed:@"icon"]]];
[values addObject:[[ChartDataEntry alloc] initWithX:20 y:50 icon: [UIImage imageNamed:@"icon"]]];
[values addObject:[[ChartDataEntry alloc] initWithX:20 y:10 icon: [UIImage imageNamed:@"icon"]]];`

If we have 4 points, 2nd and 3rd have the same x, everything is displayed correctly
`[values addObject:[[ChartDataEntry alloc] initWithX:10 y:30 icon: [UIImage imageNamed:@"icon"]]];
[values addObject:[[ChartDataEntry alloc] initWithX:20 y:50 icon: [UIImage imageNamed:@"icon"]]];
[values addObject:[[ChartDataEntry alloc] initWithX:20 y:10 icon: [UIImage imageNamed:@"icon"]]];
[values addObject:[[ChartDataEntry alloc] initWithX:40 y:60 icon: [UIImage imageNamed:@"icon"]]];`

Same issue if there's more than two points btw, only one is being displayed
Contributor guide
Research direction
Reproduce the issue in the Charts Demo app using the ChartDataEntry sequences shown in the report, especially duplicate x values at the end of the list. Trace the chart rendering path from those entries and verify the result by checking that every point with the same x value is displayed, including cases with more than two duplicates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100