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.
Annotations are not correct when Exporting to jpg
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi -
Have a look at IAxis.CalcXXX and ISeries.CalcXXX (both in TeeChart Help file) for TeeChart methods that can help you to achieve this.
This is because canvas objects have to be placed relative to existing TeeChart objects, rather than as absolute pixel values, to print/export.Why are annotations in the wrong place on the exported jpg chart, yet look ok on the original chart ?
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/
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/
Same problem with printing, bu not print preview !
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
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
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);
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);