Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Problem when skipping X axis labels #255

Open
dbmrq opened this issue Feb 23, 2016 · 0 comments
Open

Problem when skipping X axis labels #255

dbmrq opened this issue Feb 23, 2016 · 0 comments
Labels

Comments

@dbmrq
Copy link

dbmrq commented Feb 23, 2016

I'm trying to get my labels to look like this (which I did with ios-charts):

simulator screen shot 23 de fev de 2016 03 50 53

I only show 1 in every 5 labels.

If I use modulo for that, this is what I get, though:

simulator screen shot 23 de fev de 2016 03 56 26

if index % 5 == 0 {
    return dataPoints[index]
} else {
    return ""
}

I assume the problem is that, even though some labels contain just an empty string, they still overlap with the labels that should be showing, and according to the wiki “the overlapping labels on the X-Axis will automatically be removed if they overlap”.

If I try numberOfGapsBetweenLabelsOnLineGraph, on the other hand, this is what I get:

simulator screen shot 23 de fev de 2016 03 59 12

func numberOfGapsBetweenLabelsOnLineGraph(graph: BEMSimpleLineGraphView) -> Int {
    return 4
}

Which is almost right, except I want to always show the first label.

If I understood it correctly and the problem with using modulo is that some labels are being hidden because they overlap, I think there should be an exception when labels only show an empty string.

@Boris-Em Boris-Em added the bug label Feb 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants