0

Hi I am making a Crypto price tracking app and I am trying to show the price for Bitcoin for the day as a SwiftUI chart. The problem is the chart is zoomed out on the Y axis to show 0-40,000 (so the chart basically looks like a horizontal line because the price doesn't move around that much). I want the Y axis to be zoomed in enough to show the chart correctly. How?

Here is the chart code I have right now...

Chart {
       ForEach(vm.historyData, id: \.self) { stat in
               LineMark(
                       x: .value("Time", stat.time_open),
                       y: .value("Price", stat.price_open)
               )
               .foregroundStyle(.green)
               .lineStyle(StrokeStyle())//Maybe good way ease corners for joins?
               .interpolationMethod(.catmullRom)
       }
}
.padding()
.background{
        RoundedRectangle(cornerRadius: 10)
                .foregroundColor(.white)
}
.shadow(radius: 4)
.padding(.horizontal)
.frame(height: 200)

0 Answers0