Charts icon indicating copy to clipboard operation
Charts copied to clipboard

ChartViewDelegate & IChartValueFormatter

Open JorgenAndreasson opened this issue 2 years ago • 10 comments

When updating to Chart 4.1.0 Xcode can't find protocol definition for; ChartViewDelegate IChartValueFormatter

This is in old OBJ-C code

Charts Environment

Charts version/Branch/Commit Number: **Xcode version: 14.0 ** **Swift version: 5.7 ** **Platform(s) running Charts: iOS ** **macOS version running Xcode: 12.5.1 **

JorgenAndreasson avatar Sep 14 '22 10:09 JorgenAndreasson

Same to me Cannot find type (IAxisValueFormatter, IValueFormatter) in scope.

aungyelin avatar Sep 14 '22 13:09 aungyelin

Same to me Cannot find type (IAxisValueFormatter, IValueFormatter) in scope. Screenshot 2022-09-15 at 5 16 21 AM

ravkooashishraval avatar Sep 14 '22 23:09 ravkooashishraval

Exactly same to me. Cannot find type (IAxisValueFormatter, IValueFormatter) in scope.

KoichiroKAMADA avatar Sep 15 '22 00:09 KoichiroKAMADA

  • I guess if you want to solve the problem it's about removing #import bridging header of files contained in you're pods libraries..and there's another solution ( Go to build settings and build after setting Precompile Bridging Header YES -> NO. You can show no errors. But codes defined by objec aren't recognized. It is not able to jump to definition.)

ElCaliph1255 avatar Sep 15 '22 02:09 ElCaliph1255

Hey guys, I was confused too before I noticed that they have been renamed to (AxisValueFormatter, ValueFormatter) https://github.com/danielgindi/Charts/issues/4775#issuecomment-1026495171

nailaobaba avatar Sep 15 '22 02:09 nailaobaba

@nailaobaba you are right, it works by replacing the name. Thank you.

aungyelin avatar Sep 15 '22 08:09 aungyelin

@nailaobaba Any update to the ChartViewDelegate name?

JorgenAndreasson avatar Sep 15 '22 10:09 JorgenAndreasson

@JorgenAndreasson Sorry, no idea about that

nailaobaba avatar Sep 15 '22 12:09 nailaobaba

I found one solution please follow:

  1. pod 'Charts', '3.6.0'
  2. Find below code and add code after that
extension ChartDataSet: RangeReplaceableCollection {
// add this method
        public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element {
            entries.replaceSubrange(subrange, with: newElements)
            notifyDataSetChanged()
        }

This solution works for me

ravkooashishraval avatar Sep 16 '22 08:09 ravkooashishraval

@JorgenAndreasson if that solves your issue, please close the ticket. Thanks.

odanu avatar Oct 04 '22 09:10 odanu

Seems resolved closing

pmairoldi avatar Mar 11 '23 19:03 pmairoldi