-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
How to create y-axis for empty label ? #3735
Comments
the solution is same with #2608 |
Hi it will draw the line if there has data and the title is nil. the chartview like same with this stackoverflow Does it possible to show y-axis line? |
if you want extra axis labels, meaning you are not satisfied what the auto calculation gives, you can use @objc open func setLabelCount(_ count: Int, force: Bool)
{
self.labelCount = count
forceLabelsEnabled = force
} to set a proper label count. The formula of interval is (max - min) / count |
@liuxuan30 can you give any example how you are setting label count by interval as you have mentioned. I want to not use auto calculation & rather set label count based on min/max data |
Following is using “Charts” for swift 4.0 to show line chart. But the last label will not show normally , and i want to add empty label x-axis to fix this issue.
https://i.stack.imgur.com/hq9sh.jpg
I try to add " " to chartView.xAxis.valueFormatter, but it doesn't add an x-axis.
following is my code:
`x1 = [10.0, 10.0, 11.0, 11.0, 12.0, 12.0, 13.0, 13.0, 14.0, 14.0, 15.0, 15.0, 16.0, 16.0]
x2 = [20.0, 20.5, 21.0, 21.5, 22.0, 22.5, 23.0, 23.5, 24.0, 24.5, 25.0, 25.5, 26.0, 26.0]
times = ["8:00"," ","9:00"," ","10:00"," ","11:00"," ","12:00"," ","13:00"," ","14:00"," "]
setChart()
func setChart(){
}
private class LineChartFormatter: NSObject, IAxisValueFormatter {
}`
**Xcode version:10.0
**Swift version:4.0
The text was updated successfully, but these errors were encountered: