diff --git a/Source/Charts/Renderers/LineChartRenderer.swift b/Source/Charts/Renderers/LineChartRenderer.swift index eedd92de91..9216395e2c 100644 --- a/Source/Charts/Renderers/LineChartRenderer.swift +++ b/Source/Charts/Renderers/LineChartRenderer.swift @@ -601,6 +601,14 @@ open class LineChartRenderer: LineRadarRenderer continue } + + // Skip Circles and Accessibility if not enabled, + // reduces CPU significantly if not needed + if !dataSet.isDrawCirclesEnabled + { + continue + } + // Accessibility element geometry let scaleFactor: CGFloat = 3 let accessibilityRect = CGRect(x: pt.x - (scaleFactor * circleRadius), @@ -621,11 +629,6 @@ open class LineChartRenderer: LineRadarRenderer accessibilityOrderedElements[i].append(element) } - if !dataSet.isDrawCirclesEnabled - { - continue - } - context.setFillColor(dataSet.getCircleColor(atIndex: j)!.cgColor) rect.origin.x = pt.x - circleRadius