iosswiftxcodechartsxcode14

Charts not compile on Xcode 14


I am facing following errors in library -


Solution

  • Append it to extension ChartDataSet: RangeReplaceableCollection

    public func replaceSubrange<C>(_ subrange: Swift.Range<Int>, with newElements: C) where C : Collection, ChartDataEntry == C.Element {
        entries.replaceSubrange(subrange, with: newElements)
        notifyDataSetChanged()
    }