Annotation anchor to snap to corner nearest target point.

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
TRVRSE
Posts: 21
Joined: Fri May 30, 2014 1:27 pm

Annotation anchor to snap to corner nearest target point.

Post by TRVRSE » Fri Jun 27, 2014 4:02 pm

One commonality of the annotations we create is that the background is often transparent. This is a nice feature, but can be an issue when the anchor point is in the center. Since we draw the line from the anchor point to the text, the line passes through our text, and is not good to look at. Our old graphing library would draw the line from the corner nearest to the target point.

This isn't exactly complicated stuff, so I wouldn't mind implementing it, but I need to ask some questions first.

Does Arction have any desires to implement a feature like this? If so, I would not do the work, because there is no point duplicating effort.

My intuition tells me to convert the target point and anchor point to the same coordinate system. This way I could perfom some logic to determine which corner offers the shortest line.
Do you have any advice for getting these 2 points into the same coordinate system?

Thanks for your response.

TRVRSE
Posts: 21
Joined: Fri May 30, 2014 1:27 pm

Re: Annotation anchor to snap to corner nearest target point

Post by TRVRSE » Fri Jun 27, 2014 6:29 pm

Since the anchor is used for more than just drawing the line, is there a way I could unhook the the line from the anchor?

Or, if you guys end up doing it, maybe add a flag that sets the line to draw from the target point, to the nearest point on the text box?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Annotation anchor to snap to corner nearest target point

Post by ArctionPasi » Mon Jun 30, 2014 12:43 pm

The best way to achieve this is by doing it with a stencil test of Direct3D. Excluding the annotation rectangle when rendering the line.

It isn't very easy to implement, so I think it's best if we do it.
LightningChart Support Team, PT

Post Reply