Page 1 of 1

DrawText and DrawSymbol as ChartTool available?

Posted: Fri Apr 30, 2004 12:08 pm
by 8437945
BCB6 + TeeChart V6Pro.

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

Posted: Mon May 03, 2004 8:56 am
by Pep
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.

Posted: Mon May 03, 2004 11:24 am
by 8437945
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.

Posted: Tue May 04, 2004 11:47 am
by 8437945
In addition, after some experimentation:
The Annotation Tool seems to be useless in this respect since it does not reposition while scrolling.

Posted: Tue May 04, 2004 8:23 pm
by Marjan
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.

Posted: Wed May 05, 2004 8:12 am
by 8437945
Hi Marjan,

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

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

Posted: Fri May 07, 2004 3:54 pm
by 8437945
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?

Posted: Sat May 08, 2004 7:01 pm
by 8437945
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.

Posted: Sun May 16, 2004 7:59 pm
by 8437945
Hi Marjan,

Could you please provide any follow up?

Thanks,
Wiebe

How to control Zoom at runtime

Posted: Sun Jun 13, 2004 12:37 pm
by 8437945
Any follow up, in particular as to how to control this Zoom business at run time, is still appreciated.