Core-Plot DataLabel Z-Ordering

I am trying to add data labels to a bar chart in Core-Plot (on iOS). The user selects individual plots and then displays the values.

The main problem is shown in the image, other graphs cross out the data labels.

Image showing the problem

Is it possible for labels to always be on top?

When the user sets the order of the bars, I cannot change the order of the rows. (Also, if I did that, the UI would be terrible, as the whole graph view changed when selected.)

Another possibility: can I change the order of the plots for the Z-order, but the positions remain the same?

Any other ideas? I have also tried CPTPlotSpaceAnnotations, but I cannot exactly align them in the panel (see label "1037" in year (x-axis) 1980).

+3


source to share


1 answer


I came up with a solution myself: I just remove the plot and add it back. Thus, the plot arises in the z-hierarchy.



[self.graph removePlot:plot];
[self.graph addPlot:plot];

      

+3


source







All Articles