Problem controlling which series is on top


Using charts version 2.5.5.

I’m having trouble getting my charts to display with the correct draw order.  Below is a code snip of how the series in a 3-series chart are initialized.  The chart has a column series and two lines  I want the column on the bottom so the lines will draw over it.  I can get most of the way there, but I cannot get both the lines to overlay the column. Fiddling with series indexes, I can get one line to completely cover the column, but not both. 

For example if I set the Blue Line to index=0, red line to index=1 and column series to index=2, I get this:

If I set Column series to index=0, red line to index=1, blue line to index=2, I get this :

The first is the closest to the desired outcome…the blue line is where I want it to be drawn after the column series.  But the red line is *behind* the column except for a single point–that’s not what I expected to happen.

Any idea what I’m doing wrong?

- (SChartSeries *)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index
    if ( index == 0 )
         // Setup a column series -- which I would EXPECT to be drawn first and underneath the next two, but it's actually on top
         SChartColumnSeries *columnSeries = [[SChartColumnSeriesalloc]init];
        columnSeries.title = @"FY '13 POS";
        = [UIColor colorWithRed:22/255.0 green:107/255.0 blue:144/255.0 alpha:1.0]; = [UIColor colorWithRed:22/255.0 green:107/255.0 blue:144/255.0 alpha:1.0]; = NO;
        return columnSeries;
    else if (index==1)
         // Setup a RED line series, which is under the column chart, but on top of the blue line created below
         SChartLineSeries *lineSeries = [[SChartLineSeriesalloc] init];
        lineSeries.title = @"FY '13 SHIP"; = [NSNumber numberWithInt:4]; = [UIColor colorWithRed:255/255.0 green:0/255.0 blue:0/255.0 alpha:1.0];
        return lineSeries;
    else if (index==2)
         // Set up the BLUE series, which ends up on the bottom, covered by the red line and the column chart
         SChartLineSeries *lineSeries = [[SChartLineSeriesalloc] init];
        lineSeries.title = @"FY '12 POS"; = [NSNumber numberWithInt:4]; = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:255/255.0 alpha:1.0];
        return lineSeries;


Cannot set which series is on top

Thanks for letting us know about this. This is a bug in our code, not yours, and we’re working to get it fixed.


Very much looking forward to a fix for this one too. I can’t get my desired design implemented without it. Thanks!


+1.  Looking for column chart underneath a line chart. Hoping for this to be fixed.


Any updates to this issue? I can’t get the desired layout like robkerr stated. I would think that the order of which the delegate provides the seriesAtIndex would determine the stacking, but it seems to be unpredictable.

I’m using the latest charts package 2.5.7.

Very much looking forward to a resolution or suggested path forward on this.




Any progress on this?  It’s still a problem with the version I’m using (2.5.7 I think?)

<frustration>Ran into again today</frustration>.  Have a chart with bar and line.  Works OK if the linewidth is 1.0, change it to anyting more than that, and the line appears behind the bars, except for a tiny dot in the middle of the bar.


I want to bump this, we’re seeing it and would like to have a fix for this draw order issue.

It looks like it’s related to drawing diagonal line charts atop bar charts as well. We get a single dot of the correct top color, otherwise the bar, sometimes, then other bars/lines are correctly layered


Hi all,

We’ve now released version 2.6.0 of ShinobiCharts, which fixes a z-order issue in our OpenGL code. That should fix this issue, so I would recommend downloading this from our portal.

Hope this helps, let us know how things go!




Hi Dan,

I have downloaded the 2.6.0 version but we are still facing the same issue.

I had to plot a linechart over a barchart but the barchart was always coming in the front.

Looking at Rob’s screenshots, I just initiallised a dummy lineseries at index 1, set the index of the linechart as 0 and the barchart as 2 and I was able to achieve the planned plot (linechart over barchart).

Please help me with this.




Hi auditya,

What happens if you don’t use the dummy line series and set the index of the linechart at 0, and the barchart at 1?

The drawing order is that series groups with a lower index are drawn in front. This means that for {0 = line, 1 = bars}, the lines are drawn first, however for {0 = bars, 1 = line, 2 = bars}, both the bars count as a series group, so are both drawn above the line.

This is an issue which we hope to fix in the near future, but for the simple example of one line, one bar, version 2.6.0 should address the issue.


I’m having similar issues as explained above however I have noticed that my problems are dependent on the architecture being used.  In 64-bit architectures I have noticed that my z-ordering is not working as expected (on an iPad Air), but using the iPad Mini I get the expected behavior on the line series shown in front of the column series.

My chart setup is 2 column series set to stackIndex 1, and a step line series set to stackIndex 0.  I also set the column series at index 0 & 1 and the line series at index 2 in the sChart: seriesAtIndex: method.

I tried all variations to get this to work but I believe it must be an issue related to the architecture which could be separate from the problems mentioned above.




I am seeing a similar issue with one Column series and one OHLC series.  I am trying to draw the OHLC “on top” to produce an error bar effect.   No matter the series index assigned, the Column is always drawn on top.  Furthermore I’m getting the following error: "ShinobiCharts: Stacking not available for this series type.

From: <SChartOHLCSeries: 0x16099310>" even though we’re not using stacking.


I have also tried this with Candlestick series.  The horizontal portion appears to be drawn correctly on top of the column, but the vertical portion is incorrectly drawn behind it.


Hello everyone,

We’ve had a few issues reported regarding our OpenGL rendering recently. Here’s the one’s we know about:

  1. When rendering a thick line series (with a width of >3), the line series may be rendered incorrectly behind column series, with small circles rendered on top of of a column series.
  2. When rendering a chart with various combinations of various series types & column series. The column series will render on top (at least some) of the other series. Furthermore, if you increase the border width of your columns, you’ll see that the border of the column series is rendered with the correct Z order, but the fill of the column is on top of series it should be below.

The first issue should be fixed by our 2.6.0 release - if anyone sees an issue similar to this we’d love to hear about how you’ve set up your chart to do so. 

In ShinobiCharts, when we render stacked series, we group them together, treating them more like a single series. We suspect that a most of our Z ordering issues are related to this some how, and we’ve had users report that setting unique ‘stackIndex’ values to each of their series forces them to draw correctly. Unfortunately this doesn’t work for the second issue I mentioned. We’re actively working on a fix issue 2) and we’ll let you know as soon as we’ve got one available.

In the meanwhile, if you find a Z ordering issue with your series, try setting unique ‘stackIndex’ values on your series. If this doesn’t work, and you think that you have found another OpenGL Z ordering issue that doesn’t fall under 2) then please get in contact with us at

Jan Akerman