`isDrawingValuesAllowed` assumes all datasets have `drawValuesEnabled = true`
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
If you look at the `isDrawingValuesAllowed` function in `ChartDataRendererBase`:
```swift
@objc open func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool
{
guard let data = dataProvider?.data
else { return false }
return data.entryCount < Int(CGFloat(dataProvider?.maxVisibleCount ?? 0) * (self.viewPortHandler?.scaleX ?? 1.0))
}
```
it doesn't actually check if the dataSets have `drawValuesEnabled = true` before counting them as a value to draw, this is especially bad in `CombinedChartView`'s when there are many entries.
Contributor guide
Research direction
Start in the isDrawingValuesAllowed function of ChartDataRendererBase and inspect how CombinedChartView supplies its datasets. Verify how drawValuesEnabled is represented on those datasets and determine how the count should exclude disabled value drawing. Done means the allowance decision no longer treats disabled datasets as values to draw, especially for large combined charts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- data-visualization, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100