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

TeeChart for ActiveX, COM and ASP
Post Reply
yvb
Newbie
Newbie
Posts: 18
Joined: Mon Jul 13, 2009 12:00 am

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

Post by yvb » Sun Nov 15, 2009 3:55 pm

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

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Mon Nov 16, 2009 12:47 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply