Questions tagged [swiftcharts]

A charting library for iOS, written in swift.

A charting library for iOS, written in swift.

References

Github repository

98 questions
0
votes
0 answers

How to stop flickering of charts

I'm using charts library to show realtime linechart when i add new entry of data at that time graph flicker, please help me to stop flickering at new entry of data. let currentDataSet = self.graphView.data?.dataSets[0] let xIndex :…
0
votes
1 answer

How to properly adjust the X and Y axis in Swift Charts line chart

I am making a Mac app that displays data using a Swift Charts line chart. Once the data is displayed I want to be able to "zoom" the X and Y axis using a drag gesture. For example if fully displaying all of the data required a X axis that went from…
kka41
  • 69
  • 7
0
votes
1 answer

How do I stop Swift LineMark Chart from changing the date to my local timezone?

I'm trying to plot temperature data on a LineMark chart. My array of chartDATETIME values are formatted to the timezone at the coordinates that the user selects. I know those values are correct because I've printed them. For some reason, when I plot…
SkimoBen
  • 19
  • 3
0
votes
0 answers

How to visualize a live soundwave from a radio stream in Swift?

I am working on a SwiftUI iOS app that plays a live radio stream using AVPlayer. I would like to visualize the soundwave of the live radio stream and have it pulsate to the rhythm of music played in the stream. I have already implemented the audio…
TD540
  • 1,728
  • 3
  • 14
  • 26
0
votes
1 answer

SwiftUI Charts - How to put an annotation at the top of a chart and have a line coming out of going downward until it intersects the line?

I have a chart with a line: let ints = Array([0...10]) Chart { ForEach(ints) { int in let someRandomYValue = Int.random() LineMark(x: int, y: someRandomYValue) } } At the halfway point across the chart, I need an annotation…
swiftyboi
  • 2,965
  • 4
  • 25
  • 52
0
votes
2 answers

Swift Charts: How to shade a highlighted area in a line chart?

The code below draws a RuleMark at the top and bottom of the area I would like to highlight, however, instead of 2 lines I would like to shade this area grey to show the normal range. How can I do this? import SwiftUI import Charts struct…
GarySabo
  • 5,806
  • 5
  • 49
  • 124
0
votes
1 answer

SwiftUI: GaugeStyle as a view parameter

I would like to be able to pass the GaugeStyle for a Gauge as a parameter to my own SwiftUI view, however I can't seem to get this to work with the compiler. When I try the below code I get an error, Type 'any View' cannot conform to 'View'. import…
stanlemon
  • 399
  • 3
  • 10
0
votes
0 answers

How do i change the individual color of RectangleMark in my candle stick chart according to open and close price in Swift Charts

this is what i get when i try to change the color sorry can't post image here yet so i suggested to use link I used RectangleMark from apple Charts Api here is my chart, my chartData has low, high, open, and close prices I want to have it to look…
Jono Then
  • 3
  • 6
0
votes
1 answer

Swift/ContiguousArrayBuffer.swift:600: Fatal error: Index out of range, how do i solve this?

I am new to coding and SwiftUI in general, I am coding a crypto portfolio app I am doing the candle stick chart using apple chart API, get my API data fetched. sorry if my code is messy. JSON from market data rest API the "60" means the number of…
Jono Then
  • 3
  • 6
0
votes
0 answers

How to add Custom horizontal bar Charts(danielgindi) in swift iOS

I am new to charts, I have to implement horizontal bar charts,It always have two horizontal bar and 3 x-axis value and four y-axis value. I am able to draw horizontal bar, but not able to add labels for x-axis and y-axis. @IBOutlet weak var…
sham
  • 115
  • 9
0
votes
1 answer

Swift: Make Int Enum conform to Plottable protocol in order to show a legend using Swift Charts

I am trying to make my Int enum conform to Plottable in order to use a legend in my Swift Charts. I'm not sure if I've understood the way on how to implement it correctly. Here is how my enum: enum Type: Int, CaseIterable, Identifiable, Plottable { …
Daniel
  • 1,473
  • 3
  • 33
  • 63
0
votes
1 answer

How to create a chart without the legend when using Apple's Charts?

Apple's Swift Charts was recently introduced at WWDC. However, my practice chart has a redundancy. The legend is not needed. How do I create the chart with all the colors but no legend? Using “.foregroundStyle(by: .value("Shape", shape.type))”…
Marcy
  • 4,611
  • 2
  • 34
  • 52
0
votes
1 answer

Line Chart Data handle issue

what is the best way to handle Line Chart data to send in API? we have chart like this It has Hours, Days, Weeks, Months Data so how Will I manage with easy way? I tired normal X,Y values but there is bulk data in every category so it is hard to…
0
votes
1 answer

Bar chart xAxis grid lines are in centre instead besides

I spent more than half of my day on it and unable to figure out solution drawing bar chart using Charts pod facing two problems Wanna Corner radius bars as mentioned in required Image wanna bars besides the grid line as in below image Required My…
Ahmad Qasim
  • 452
  • 1
  • 8
  • 26
0
votes
1 answer

How to use date for x-Axis in SwiftChart?

I am trying to draw line chart in my project using SwiftChart pod. I am getting response from API as ["activity_count":0 , "date": "2020-10-31"] but graph works on double values so I don't know How I draw the chart. import UIKit import…
A J
  • 441
  • 4
  • 20