-
Notifications
You must be signed in to change notification settings - Fork 68
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
Story Board Implementation #26
Comments
You can add a graph to a UIView() by creating an outlet for your view then adding your graph to the subview. @IBOutlet var LineGraphView: UIView!
lineChart = LineChart()
LineGraphView.addSubview(lineChart)
let horizontalConstraint = lineChart.centerXAnchor.constraintEqualToAnchor(LineGraphView.centerXAnchor)
let vertivalConstraint = lineChart.centerYAnchor.constraintEqualToAnchor(LineGraphView.centerYAnchor)
let widthConstraint = lineChart.widthAnchor.constraintEqualToAnchor(nil, constant: self.view.frame.size.width + 30)
let heightConstraint = lineChart.heightAnchor.constraintEqualToAnchor(nil, constant: 170)
NSLayoutConstraint.activateConstraints([horizontalConstraint, vertivalConstraint, widthConstraint, heightConstraint]) |
@mugsinc I was able to use this LineChart View with storyboards using the following workflow:
|
As @ccabanero said it is true, just avoid addsubview() and addcontranints() code in your view controller. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can this be implement onto a StoryBoard With a UIView, is there a version of the line chart which has a story board. Please help
The text was updated successfully, but these errors were encountered: