-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SparkLine with list of same values and zero line overlay not displayed. #16
Comments
Hi @martindufort ,
The You should really be using |
@martindufort for example, here is an example I just wrote class ViewController: NSViewController {
@IBOutlet weak var graph: DSFSparklineLineGraphView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let activityArray = [CGFloat](repeating: 20.0, count: 30)
let ds = DSFSparkline.DataSource(values: activityArray, range: 0 ... 30)
ds.zeroLineValue = 10
graph.dataSource = ds
graph.layer!.borderColor = .init(gray: 0.5, alpha: 0.5)
graph.layer!.borderWidth = 0.5
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
} |
Thanks for the explanation. Will change my code to use However comparing your screenshot and mine, seems my zero-line has no space underneath while yours as some buffer. |
In some cases, my sparkline will have a series of identical values.
Example:
I want to show them in a
DSFSparklineZeroLineGraphView
but for those cases, nothing is displayed.I even set the
zeroLineVisible
attribute totrue
.Anything specific I'm missing? All my values will be positive values but I cannot control if they are all identical or not.
Let me know where to investigate.
Thanks.
The text was updated successfully, but these errors were encountered: