DrawText and DrawSymbol as ChartTool available?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

DrawText and DrawSymbol as ChartTool available?

Post by Wiebe » Fri Apr 30, 2004 12:08 pm

BCB6 + TeeChart V6Pro.

Is DrawText and/or DrawSymbol (like DrawLine) as ChartTool available?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon May 03, 2004 8:56 am

Hi,

there's the Annotation Tool available to Draw Text in the Chart.
You can see some examples in the Demo Features project, included in the TeeChart Pro installation.

Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

Post by Wiebe » Mon May 03, 2004 11:24 am

Thanks for your reply,

The Annotation Tool can certainly be used as a base for further development in this respect.
However I meant a Text/SymbolBox Tool, to be created on the fly by the user, and able to be dragged, shaped, deleted etc. like DrawLine.

Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

Post by Wiebe » Tue May 04, 2004 11:47 am

In addition, after some experimentation:
The Annotation Tool seems to be useless in this respect since it does not reposition while scrolling.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue May 04, 2004 8:23 pm

Hi, Wiebe.

Yes, but only if you "hard code" the annotation coordinate by using specific screen pixel coordinate. If you on the other hand, transform real (axis) value to screen coordinate before you position annotation (and do this in one of the chart's events), then the annotation will move as you scroll/zoom. The idea is to:
1) Get mouse position, expressed in real axis values
2) Store this position
3) Transform this position to screen pixels
4) Position annotation tool according to transformed value
5) Do #4 and #5 each time you zoom or scroll chart i.e. place the code in one of the chart events.
However I meant a Text/SymbolBox Tool, to be created on the fly by the user,
This is not problematic. You can add multuple annotation tools at runtime via code. The missing feature is the drag/drop functionality for annotation tools. But with some extra coding I think it can be done. You could use Tchart OnMouseDown, onMouseMove and OnMouseUp events together with annotation tool Clicked method to do the drag&drop.
Perhaps this is something we could include as built-in feature for next version. I'll log it to the wish list.
Marjan Slatinek,
http://www.steema.com

Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

Post by Wiebe » Wed May 05, 2004 8:12 am

Hi Marjan,

I'll follow up your "soft code" coordinate suggestion.

I allready succesfully applied Drag&drop and multiple "on the fly" creation.

Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

Post by Wiebe » Fri May 07, 2004 3:54 pm

Hi Marjan,

Thanks to your suggestion, repositioning while scrolling works fine now. However Zooming and Dragging do conflict. Primarily because switching Zoom on/off under program control does not seem to work. Manipulating Chart->Zoom->Allow does not affect the behaviour set at designtime.
Any additional suggestion?

Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

Post by Wiebe » Sat May 08, 2004 7:01 pm

Meanwhile - through other forum items on the subject - I noticed, that apart from Chart->Zoom->Allow, also Chart->CancelMouse seems to play a (mysterious) role in controlling Zoom actions. Just by brute trial and error I managed to "solve" 50% of the Drag/Zoom collision problems.
However I cannot see any logic as to how to control this Zoom business at run time.
Pls advice.

Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

Post by Wiebe » Sun May 16, 2004 7:59 pm

Hi Marjan,

Could you please provide any follow up?

Thanks,
Wiebe

Wiebe
Newbie
Newbie
Posts: 26
Joined: Fri Nov 15, 2002 12:00 am
Location: Middelburg
Contact:

How to control Zoom at runtime

Post by Wiebe » Sun Jun 13, 2004 12:37 pm

Any follow up, in particular as to how to control this Zoom business at run time, is still appreciated.

Post Reply