Skip to content
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

Custom yAxis values #2254

Closed
ukmarn opened this issue Mar 17, 2017 · 1 comment
Closed

Custom yAxis values #2254

ukmarn opened this issue Mar 17, 2017 · 1 comment

Comments

@ukmarn
Copy link

ukmarn commented Mar 17, 2017

I was searching in issues but couldn't find anything similar to this.
So I have a chart, which has 2 yAxis - one on left and one on right. Left axis can show values from 0 - 360. Right axis can show values from 0 to 100.
Here is a screenshot of what am I trying to achieve - right axis is on the half of the left one.

screenshot 2017-03-17 11 33 34

Current code:

    let temperatureAxis = lineChartView.leftAxis
    temperatureAxis.axisMaximum = 360
    temperatureAxis.axisMinimum = 0
    temperatureAxis.labelTextColor = UIColor.red
    temperatureAxis.axisLineColor = UIColor.darkGray
    
    let sliderAxis = lineChartView.rightAxis
    sliderAxis.labelCount = 5
    sliderAxis.drawAxisLineEnabled = true
    sliderAxis.labelTextColor = UIColor.blue
    sliderAxis.axisLineColor = UIColor.darkGray
    sliderAxis.granularityEnabled = true
    sliderAxis.axisRange = 100

Also is there a way I could only show few labels I want inside axis? I can limit and set few, but what if lets say I want to show 83 too?

@liuxuan30
Copy link
Member

check axisDependency, and override computeAxisValues() maybe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants