TChart CAN draw viewer-facing text with an OpenGL chart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
KevinKillion
Newbie
Newbie
Posts: 11
Joined: Wed Jul 07, 2010 12:00 am

TChart CAN draw viewer-facing text with an OpenGL chart

Post by KevinKillion » Sat Feb 19, 2011 5:54 pm

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 3099 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?

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Tue Feb 22, 2011 1:38 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply