Annotations are not correct when Exporting to jpg

TeeChart for ActiveX, COM and ASP
Post Reply
hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Annotations are not correct when Exporting to jpg

Post by hansw » Tue Dec 30, 2003 1:49 pm

Why are annotations in the wrong place on the exported jpg chart, yet look ok on the original chart ?

I tried each of these calls before exporting the chart.

m_Chart1.Repaint();

m_Chart1.GetEnvironment().InternalRepaint();

Does not cure the problem.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Dec 30, 2003 2:10 pm

Hi -
Why are annotations in the wrong place on the exported jpg chart, yet look ok on the original chart ?
This is because canvas objects have to be placed relative to existing TeeChart objects, rather than as absolute pixel values, to print/export.

Have a look at IAxis.CalcXXX and ISeries.CalcXXX (both in TeeChart Help file) for TeeChart methods that can help you to achieve this.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

Same problem with printing, bu not print preview !

Post by hansw » Tue Dec 30, 2003 2:17 pm

Strnage how print preview displays the annotations in the correct locations, yet the printed copy is as bad as the jpg exported file.

Print preview is supposed to show waht will be printed... !

The fact that it does not should then be called a BUG ! arrrrrgh !

I'll try the IAxis.CalcXXX and ISeries.CalcXXX

hansw
Newbie
Newbie
Posts: 59
Joined: Fri Nov 15, 2002 12:00 am

I'm already doing what you recommended, still does not work

Post by hansw » Tue Dec 30, 2003 2:32 pm

int X = (int)m_Chart1.Series(0).CalcXPos( pt->xy.x);

m_Chart1.GetTools().GetItems( 0 .GetAsAnnotation().GetShape().SetLeft(X);

int Y = (int)m_Chart1.Series(0).CalcXPos(pt->xy.y);
m_Chart1.GetTools().GetItems( 0 .GetAsAnnotation().GetShape().SetTop(Y);

Post Reply