I am using th swift Charts library. I'm trying to show a candle chart but it does not correctly showing data. After running it will be show just one item but if i will zoom in it will be show all items,
how immediately showing every item after running without needed to zoom ?
func setupCandleChart() {
// candleChartView.autoScaleMinMaxEnabled = true // if enable this doesn't show anything
setCandleDataCount(5, range: 30)
}
func setCandleDataCount(_ count: Int, range: UInt32) {
let yVals1 = (0..<count).map { (i) -> CandleChartDataEntry in
let mult = range + 1
let val = Double(arc4random_uniform(40) + mult)
let high = Double(arc4random_uniform(9) + 8)
let low = Double(arc4random_uniform(9) + 8)
let open = Double(arc4random_uniform(6) + 1)
let close = Double(arc4random_uniform(6) + 1)
let even = i % 2 == 0
return CandleChartDataEntry(x: Double(i), shadowH: val + high, shadowL: val - low, open: even ? val + open : val - open, close: even ? val - close : val + close)
}
let set1 = CandleChartDataSet(entries: yVals1, label: "Data Set")
let data = CandleChartData(dataSet: set1)
candleChartView.data = data
}
if i will zoom:

