Page 1 of 1

TChart CAN draw viewer-facing text with an OpenGL chart

Posted: Sat Feb 19, 2011 5:54 pm
by 16556545
I'm still searching for a way to attach some form of labels that FACE THE VIEWER with an OpenGL TChart. But then I realized that TChart does something suitable all the time! Here is an example:
forwardfacingtext.JPG
forwardfacingtext.JPG (156.27 KiB) Viewed 3104 times
Note that the "normal" text labels for the boxes face what was originally the "front" before we changed rotation and elevation. This is also true for my attempt to draw some sample text with TextOut and TextOut3D.

BUT LOOK AT THE ***CHART TITLES*** ("U.S. MAP EXAMPLE")!!!!
YES, THEY ARE FACING THE VIEWER!!!!

So, ***HOW*** does TChart draw its titles????

(Caveats: it's clear that the title is drawn first, and the OpenGL TChart is drawn over it. It would be desirable to draw text AFTER the OpenGL TChart is drawn, so that these labels aren't obscured. That will lead to some layering problems, but that's a small concern compared to having unreadable text or text that vanishes altogether. And I still would need some way to determine the window X-Y coords of where to draw text for each plotted point.)

How does TChart draw its titles?

Re: TChart CAN draw viewer-facing text with an OpenGL chart

Posted: Tue Feb 22, 2011 1:38 pm
by yeray
Hi Kevin,

The Titles in TeeChart are TTeeCustomShape. As you can see in my reply here, an approach could be using TAnnotationTools, that inherit from TTeeCustomShape class. However, there still remains the problematic about how to calculate the correct coordinates, as also explained in that thread.