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

Ain't y axis values assignable? #29

Open
Tim77277 opened this issue Jan 26, 2016 · 1 comment
Open

Ain't y axis values assignable? #29

Tim77277 opened this issue Jan 26, 2016 · 1 comment

Comments

@Tim77277
Copy link

So, I am trying to draw a line chart on my app. And I found that somehow I could not assign the values to y axis. But x axis was totally fine. It assumed that the code might automatically generated the values from my data set.

my code is like this below

// simple arrays
let data: [CGFloat] = [3, 4, -2, 11, 13, 15]
let data2: [CGFloat] = [1, 3, 5, 13, 17, 20]

// simple line with custom x axis labels
let xLabels: [String] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
let yLabels: [String] = ["0.1k", "0.2k", "0.3k", "0.4k", "0.5k", "0.6k"]

lineChart = LineChart()
lineChart.animation.enabled = true
lineChart.area = false
lineChart.x.labels.visible = true
lineChart.y.labels.visible = true

lineChart.y.axis.inset = 30
lineChart.x.axis.inset = 30

lineChart.x.grid.count = 5
lineChart.y.grid.count = 6

lineChart.x.labels.values = xLabels
lineChart.y.labels.values = yLabels

lineChart.addLine(data)
lineChart.addLine(data2)

lineChart.translatesAutoresizingMaskIntoConstraints = false
lineChart.delegate = self
chartView.addSubview(lineChart)

@ghost
Copy link

ghost commented Jan 19, 2017

Same problem occurs, is there any solution for it?

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

1 participant