Hide axis tick labels after a certain value


#1

I did some searching on here but didn’t find any info about this topic. I have a chart that is using Column Series and Line Series, and I am using two YAxes. I am setting a high “rangePaddingHigh” value for my column series, as I want the columns to basically appear mostly underneath the line series on the graph.  However, by doing this I introduce many extraneous labels on my column series YAxis, past the upper bound of the data.  Basically what I’m trying to achieve is the following:

40 +---------------------------------------------------+ 400
    | |
35 | |
    | |
30 | | 300
    | |
25 | |
    | |
20 | | 200
    | |
15 | |
    | |
10 | | 100
    | |
5 | | 
    | |
0 +---------------------------------------------------+ 0

Say my highest column value is 24. I would like to still maintain the padding at the top of the left axis, but would prefer if the tick labels past 25 were hidden.

Is there a way to do this? Perhaps I’m just missing something. Thanks


#2

Hi. I trust you are using ShinobiCharts for Android rather than the iOS version of ShinobiCharts. Is this correct?

Thanks,

Kai.


#3

No, this is in iOS. Probably should’ve been more specific


#4

Hi,

If you’re using a Trial/Premium version of ShinobiCharts you should find what you’re after in our MultipleAxes sample.

The important bit is this delegate method:

- (void)sChart:(ShinobiChart *)chart alterTickMark:(SChartTickMark *)tickMark beforeAddingToAxis:(SChartAxis *)axis {
    //Hide any tickmarks over 100 on the right y-axis
    if (axis == [chart.allYAxes lastObject]) {
        if (tickMark.value > 100.f) {
            tickMark.tickLabel.text = @"";
            tickMark.tickMarkView.hidden = YES;
        }
    }
}

I hope that helps!

Thanks,

Sam


#5

I knew I must’ve glanced over it. Thanks!