About `isDrawingValuesAllowed` function in `ChartDataRendererBase`:
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
```
let arr1 = Array(1 ..< 100).map { x in return sin(Double(x) / 2.0 / 3.141 ) * 100.0 }
let ds1 = LineChartDataSet(values: arr1, label: PriceLineLabelKey)
ds1.drawValuesEnabled = false;
let arr2 = Array(1 ..< 100).map { x in return sin(Double(x) / 2.0 / 3.141 * 2) * 100.0 }
let ds2 = LineChartDataSet(values: arr2, label: PriceLineLabelKey)
ds1.drawValuesEnabled = false;
let arr3 = Array(1 ..< 10).map { x in return sin(Double(x) / 2.0 / 3.141 * 3) * 100.0 }
let ds3 = ScatterChartDataSet(values: arr3, label: PriceLineLabelKey)
ds1.drawValuesEnabled = true;
let lineData = LineChartData()
lineData.addDataSet(ds1)
lineData.addDataSet(ds2)
let scatterData = ScatterChartData()
scatterData.addDataSet(ds3)
let data = CombinedChartData()
data.lineData = lineData
data.scatterData = scatterData
chartView.data = data
chartView.notifyDataSetChanged()
```
when ds1、ds2 drawValuesEnabled == false, ds3 drawValuesEnabled == true, `data.entryCount` == 210。but `data.entryCount` should be 10。
```
open func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool
{
guard let data = dataProvider?.data
else { return false }
return data.entryCount < Int(CGFloat(dataProvider?.maxVisibleCount ?? 0) * (viewPortHandler?.scaleX ?? 1.0))
}
```
Contributor guide
Assessment
This issue has not been assessed yet.