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

Y - Axis Values stick together #608

Closed
shakked opened this issue Dec 13, 2015 · 8 comments
Closed

Y - Axis Values stick together #608

shakked opened this issue Dec 13, 2015 · 8 comments

Comments

@shakked
Copy link

shakked commented Dec 13, 2015

I saw someone else had this same problem but I'm unable to solve it:

image

             cell.lineChartView.data = chartModel.loadData(datapoints, calendarUnit: calendarUnit) as! LineChartData
                if let lastValue =  chartModel.yVals.last?.value {
                    cell.topRightLabel.text = "\(lastValue)"
                } else {
                    cell.topRightLabel.text = "0"
                }

                cell.lineChartView.delegate = self
                cell.lineChartView.notifyDataSetChanged()
        gridBackgroundColor = UIColor.whiteColor()
        descriptionText = ""
        legend.enabled = false
        dragEnabled = false
        doubleTapToZoomEnabled = false
        pinchZoomEnabled = false
        autoScaleMinMaxEnabled = true
        rightAxis.enabled = false
        leftAxis.startAtZeroEnabled = false
        drawBordersEnabled = true
        borderColor = UIColor.lightGrayColor()
        xAxis.drawGridLinesEnabled = false
        xAxis.gridColor = UIColor.lightGrayColor()
        xAxis.labelPosition = .Bottom
@liuxuan30
Copy link
Member

Can you try reproduce with ChartsDemo code so we can use it?
To me, the y axis label and grid lines are weird, but I cannot reproduce it.

@shakked
Copy link
Author

shakked commented Dec 14, 2015

The problem gets fixed when I highlight a value on the chart. I've tried calling all sorts of setNeedsDisplay() notifyDataChanged() etc but still doesn't fix the issue

@liuxuan30
Copy link
Member

if this is a bug, please use ChartsDemo and try to reproduce it, so we can try it on our side to lock down the issue.

@danielgindi
Copy link
Collaborator

It is probably some weird issue with left and right axis conflicting in some manner.
Please give a code sample so that we can reproduce it - and hopefully fix it :-)

@danielgindi
Copy link
Collaborator

Any news on this?

@shakked
Copy link
Author

shakked commented Jan 4, 2016

Sorry I haven't gotten a chance to reproduce it in the demo, I am still having the same issue. If it is something with conflicting axises, what do you suggest? I have the right axis hidden.

@danielgindi
Copy link
Collaborator

Code sample?... We need to know when this happens

@danielgindi
Copy link
Collaborator

If right axis is disabled then it is not a conflict. You may have changed the data without calling notifyDataSetChanged() so the axis was not calculated properly.

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

3 participants