IOS-Charts set maximum visible x axis values
I finally got it!
The correct answer is:
chart.setVisibleXRangeMaximum(5)
This however needs to be set after the data has been set in the chart (not in a configure before)
This did the trick for me
How to set minimum and maximum of the x axis using iOS-Charts
I just tried below code, works for me.
lineChartView.xAxis.axisMinValue = 100;
lineChartView.xAxis.axisMaxValue = 200;
iOS Charts - set minimum y axis range
For Charts 3 (tried on Charts 3.0.2), this works:
chartView.leftAxis.axisMinimum = 0
By default there is a rightAxis as well (at least for bar charts) and the grid won't be aligned if you don't also set:
chartView.rightAxis.axisMinimum = 0
Note: I wrote this as a comment initially but I think it should be an answer to be easier to find for people who end up here from Google.
X Axis values being repeated rather than replaced iOS Charts
I fixed the issue myself by adding
chartContainer.xAxis.granularityEnabled = true
chartContainer.xAxis.granularity = 1.0
Set the maximum of the Y-Axis of a LineChartView | pod 'Charts'
Yes, you can set a maximum for y-axis as below by configuring leftAxis
and rightAxis
properties of the LineChartView
instance.
let chartView = LineChartView()
let maxYVal = 4.0 * 10000
chartView.leftAxis.axisMaximum = maxYVal
chartView.rightAxis.axisMaximum = maxYVal
X axis values are getting overlapped - iOS Charts
Try to use following and try, it will work 100 %
cell.chartViewOutlet.xAxis.labelRotationAngle = -45
Related Topics
Swift: How to Create a Predicate with an Int Value
Optional Type 'Bool' Cannot Be Used as a Boolean; Test for '!=Nil' Instead
Swift 5 Coredata Predicate Using Uuid
Coerced to Any' But Property Is of Type Uicolor
Crop/Mask Circular Image Node in Sprite Kit Gives Jagged Edges
How to Add a Left Bar Button Without Overriding the Natural Back Button
Overloads for '...' Exist with These Result Types: Closedrange<Bound>, Countableclosedrange<Bound>
Setting Nsunderlinestyle Causes Unrecogognized Selector Exception
Recursion Over a Swift Sliceable
Rotate a Sprite to Sprite Position Not Exact in Spritekit with Swift
Diffrence Between Function and Generic Function in Swift
Swift 5, How to Execute Code After Fetching All Childadded from Firebase
Swift: How to Fix Infinite Loop When Adding a Value to a Firebase Variable
Swift MAC App, Run Terminal Command Without Knowing the Path (So It Looks in Every Path in $Path)