LightweightChartsIOS icon indicating copy to clipboard operation
LightweightChartsIOS copied to clipboard

SingleValueData not supported any more in version 4.x.x?

Open pnzr00t opened this issue 1 year ago • 2 comments

Hello in my project i use SingleValueData in previous version all work correct, but currently it show me error

No exact matches in call to instance method 'setData'

        let data = [
            SingleValueData(time: .string("2019-05-28"), value: 46.01)
        ]
        series.setData(data: data)

May you give a hint at what of type i may replace SingleValueData?

PS

I make some research, and it's probably because you change here Sources/LightweightCharts/Implementations/API/Series/AreaSeries.swift in 4.0.0 version

From this code

public class AreaSeries: SeriesObject, SeriesApi {
    
    public typealias Options = AreaSeriesOptions
    public typealias TickValue = SingleValueData // <----- Here
    
}

to this

public class AreaSeries: SeriesObject, SeriesApi {
    
    public typealias Options = AreaSeriesOptions
    public typealias TickValue = AreaData // <----- Here
    
}

pnzr00t avatar Apr 16 '24 16:04 pnzr00t

I create new SingleValueAreaSeries and other data structure for back compatibility, maybe it be useful

https://github.com/tradingview/LightweightChartsIOS/pull/68

pnzr00t avatar Apr 17 '24 10:04 pnzr00t

As i understood, SingleValueData is not public data structure any more, but maybe we need delete them, or make it visibility as internal? As i see, now SingleValueData is useless

pnzr00t avatar Apr 19 '24 06:04 pnzr00t