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" occasionally #469

Closed
amycheong19 opened this issue Oct 13, 2015 · 4 comments
Closed

Y-Axis values "stick together" occasionally #469

amycheong19 opened this issue Oct 13, 2015 · 4 comments

Comments

@amycheong19
Copy link

Sorry for the bad titles. Please see the image for better understanding.
The YAxis values is off ("stick together") and it will only recover when user tap on the chart.
This happens on Android version as well.

Here is the settings I used for the chart. Hope it helps.

    combinedChartView.pinchZoomEnabled = true
    combinedChartView.drawGridBackgroundEnabled = false
    combinedChartView.doubleTapToZoomEnabled = false

    combinedChartView.rightAxis.enabled = true
    combinedChartView.leftAxis.enabled = false
    combinedChartView.legend.enabled = false
    combinedChartView.drawBarShadowEnabled = false

    combinedChartView.setViewPortOffsets(left: 0, top: 0, right: 0, bottom: 20)

    let yAxis: ChartYAxis = combinedChartView.rightAxis
    yAxis.startAtZeroEnabled = false
    yAxis.labelPosition = .InsideChart
    yAxis.drawAxisLineEnabled = false
    yAxis.labelTextColor = COLOR_GREY
    yAxis.axisLineColor = COLOR_GREY
    yAxis.gridColor = COLOR_GREY_AA

    let yAxisFormatter = NSNumberFormatter()
    yAxisFormatter.maximumFractionDigits = 3
    yAxis.valueFormatter = yAxisFormatter

screen shot 2015-10-13 at 8 28 44 pm

@danielgindi
Copy link
Collaborator

@PhilJay

@PhilJay
Copy link
Collaborator

PhilJay commented Oct 23, 2015

What happens if you out-comment this line: combinedChartView.setViewPortOffsets(left: 0, top: 0, right: 0, bottom: 20)?

@amycheong19
Copy link
Author

combinedChartView.setViewPortOffsets(left: 0, top: 0, right: 0, bottom: 20)
wont fixed the issue but
managed to solve it by setting it after the data is being drew and chart.notifyDataSetChanged().

@danielgindi
Copy link
Collaborator

I don't see this happening using your code. I'm assuming this is closed. Feel free to re-open with a fuller code-sample if you are still experiencing this.

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