Page 1 of 1

Annotations are not correct when Exporting to jpg

Posted: Tue Dec 30, 2003 1:49 pm
by 9078641
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.

Posted: Tue Dec 30, 2003 2:10 pm
by Chris
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.

Same problem with printing, bu not print preview !

Posted: Tue Dec 30, 2003 2:17 pm
by 9078641
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

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

Posted: Tue Dec 30, 2003 2:32 pm
by 9078641
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);