Set anchor-point of annotation


#1

I’m trying to align my annotation with a data-point but it’s not going as planned…

chart annotation <== The middle of the dot should be aligned with the chart-point just left of the ‘1’ character’s middle.

At first I thought that the annotation .center property was aligned to the data-point, so I made my annotation only include the red-dot image and put the label outside of the annotation frame (with clip subviews off). However this didn’t work either, it’s as if Shinobi-Charts iterates through annotation sub-views to find a bounding box of all subviews and set the center of that as the anchor-point.

Is there a sensible way to set my desired anchor-point for annotations?


#2

I found a work-around for this. Adding the label as a subview of the image-view (such that the annotation only has one direct sub-view, the image-view) means that the annotation is positioned correctly. Not great, and probably fragile to changes, but does the job.