Questions tagged [swiftui-charts]

Questions related to the Charts framework added to SwiftUI 4 (iOS 16+, macOS 13+)

For more information see the documentation for Charts

51 questions
0
votes
1 answer

Starting and Ending Values for Swift Chart

I am trying to build a Line Chart View using Swift charts in SwiftUI. I have x values from 0 to 23, and random y values between 30 and 40, however the plot is covering the whole screen and I just need the portion from 30 to 40 on the y-axis. What…
Panda
  • 19
  • 5
0
votes
0 answers

Calculating averages by date from JSON in SwiftUI

I have JSON data that I decoded and stored in core data that I am using to populate a SwiftUi line chart. I need to calculate the average of the data by dates. So the average of polling data by months. JSON Data: "president": "Joe…
Antwon Key
  • 63
  • 8
0
votes
1 answer

Skip Axis Labels in SwiftCharts

I'm using the new Swift Charts (https://developer.apple.com/documentation/charts) framework to create a bar chart. Chart { BarMark( x: .value("Name", "Item 1"), y: .value("Count", 2) ) BarMark( x: .value("Name",…
EK412
  • 71
  • 6
-1
votes
2 answers

Charts - How to handle x-axis duplicate SwiftUI

I understood that I have to use the following line but I don't know how to use it in SwiftUI : chart.xAxis.forceLabelsEnabled = true Here is my charts : var sampleData: [Int] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] Chart { …
KaayZenn
  • 103
  • 7
-1
votes
1 answer

SwiftUI Charts weekend gaps

Ist there a proper way to remove weekend gaps from e.g. stock data? See picture. The data are Linemarks with x value : Date y value : Double Datapoint class: public class HistoricalDataPoint : ObservableObject, Hashable, Identifiable, Codable,…
stefple
  • 1,007
  • 17
  • 28
-1
votes
1 answer

How to customize the y-axis values in Swift Charts?

I have a simple graph (made using Swift Charts framework) where I am showing the percentage of something over time. The x-axis is the time here and y-axis is the percentage. Ergo, I think if the values in y-axis would be like 25%, 50%, etc., it…
Ram Patra
  • 16,266
  • 13
  • 66
  • 81
1 2 3
4