Possible to draw lines on graph

TeeChart for ActiveX, COM and ASP
Post Reply
mjksrl
Newbie
Newbie
Posts: 3
Joined: Mon Oct 01, 2007 12:00 am

Possible to draw lines on graph

Post by mjksrl » Thu Mar 13, 2008 11:41 am

Hi
In our application we have a pane with a CTreeView and a pane with a CTChart. Following a right click on the CTreeView, it becomes possible to draw lines on the CTChart with the mouse.

We use ON_EVENT to catch a TeeChart event including Mouse Button Down. The event in the Graph (derived from CFormView) is caught in the Graph, then the same function in the parent class is called:

ON_EVENT(CSeqGraphView, IDC_TCHART, 19, OnMouseDownTChart, VTS_I4 VTS_I4 VTS_I4 VTS_I4)

We are unsure what class is responsible for putting down extra shapes and lines on a figure. We caught the Mouse Button Down event as you would expect, but don’t know where else to go from here. The graph is intended only to display data. Is there a way that we can ensure it is not possible to draw on it? Any advice gratefully received.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 17, 2008 9:18 am

Hi mjksrl,

We are not 100% sure about which is your exact problem but we think you may be interested on using DrawLine tool. You'll find examples at All Features\Welcome!\Tools\Draw Line in the features demo. Otherwise you should use custom canvas drawing as shown in Tutorial 15 - MS VC++ Applications. Tutorials and demo can be found at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

mjksrl
Newbie
Newbie
Posts: 3
Joined: Mon Oct 01, 2007 12:00 am

Drawing on graph in application - unwanted functionality

Post by mjksrl » Mon Mar 17, 2008 9:27 am

Thanks for the reply.

The problem we have is that it IS possible for users of our application to draw on the teechart graph in certain circumstances (as described in the original posting) but we do NOT want this to happen. Is it possible to block users from drawing on the graph in these circumstances?

Thanks again.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 17, 2008 10:56 am

Hi mjksrl,

By default it is not possible for users to draw on a chart. The only thing they may draw is the zooming rectangle and this can be disabled using this code:

Code: Select all

	m_Chart1.GetZoom().SetEnable(false);
If this doesn't help please give us more detailed information of the problem you are having and if possible please send us a simple example project we can run "as-is" to reproduce the problem here.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply