Page 1 of 1

CAxis::GetLabels().Count() returns 0

Posted: Sun Nov 15, 2009 3:55 pm
by 15053905
Hi,
I am using TeeChart under Windows XP, VS 2008.
For some reason after definig charts, axes, axes limits, the code:
"m_Chart.GetAxis().GetLeft().GetLabels().Count();"
retruns 0.
m_Chart is an object of CTChart class
If before this call the code:
pView->Invalidate();
pView->UpdateWindow();
is executed, where pView point to an object of a class derived from CFormView, that containes the CTChart object, I get
the correct count and not 0.
Why do I get 0 without the calls to pView? Do I miss any call to a TeeChart object?

Thanks,
Yaacov

Re: CAxis::GetLabels().Count() returns 0

Posted: Mon Nov 16, 2009 12:47 pm
by yeray
Hi Yaacov,

Many internal variables in the component are empty until the chart is drawn for first time. In the same way, these variables aren't updated since the chart is redrawn.
That's why we usually recommend to force the chart to be drawn before checking any of its internal variables.