Problem with adding custom axis...

TeeChart for ActiveX, COM and ASP
Post Reply
TurboK
Newbie
Newbie
Posts: 4
Joined: Mon Jan 10, 2005 5:00 am
Contact:

Problem with adding custom axis...

Post by TurboK » Wed Jan 12, 2005 12:22 am

Hello.

I need to draw a marix plot. Matrix plot must have many axes and I use the method, AddCustom() of CAxes class. When I add just one custom axis, TChart works. But, I add two or more custom axes and then custom axis index error occurs.

The codes that I use follows:

long lYAxis;

lYAxis = m_pChart->GetAxis().AddCustom(FALSE);
m_pChart->GetAxis().GetCustom(lYAxis).SetStartPosition(1);
m_pChart->GetAxis().GetCustom(lYAxis).SetEndPosition(60);
m_pChart->GetAxis().GetCustom(lYAxis).GetTitle().SetAngle(90);

lYAxis = m_pChart->GetAxis().AddCustom(FALSE); // Not error at this time
m_pChart->GetAxis().GetCustom(lYAxis).SetStartPosition(70);
m_pChart->GetAxis().GetCustom(lYAxis).SetEndPosition(99);
m_pChart->GetAxis().GetCustom(lYAxis).GetTitle().SetAngle(90);

.......

m_pChart->GetExport().SaveToFile(szFileName); -> Custom Axis Index Error occurs.


I use TeeChart ActiveX ver 7.0

Please tell me the solution.
thanks.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jan 12, 2005 6:17 pm

Hi,

I'm not able to reproduce the problem here using the latest v7.03. I've posted an example into the steema.public.attachments newsgroup (with the same subject). Could you please download it and test if it works fine for you ?

TurboK
Newbie
Newbie
Posts: 4
Joined: Mon Jan 10, 2005 5:00 am
Contact:

Post by TurboK » Wed Jan 12, 2005 11:58 pm

Hi,

I can not find the article in the news group.
Check it please.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 13, 2005 9:46 am

Hi TurboK,

The message is certainly in the newsgroups steema.public.attachments.

You can access our public newsgroups using a newsreader and configuring news:\\www.steema.net.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

TurboK
Newbie
Newbie
Posts: 4
Joined: Mon Jan 10, 2005 5:00 am
Contact:

Post by TurboK » Fri Jan 14, 2005 1:05 am

Hi Narcis )

I found the article.

Thanks for helping. :D

TurboK
Newbie
Newbie
Posts: 4
Joined: Mon Jan 10, 2005 5:00 am
Contact:

Post by TurboK » Fri Jan 14, 2005 2:31 am

Hi Pep,

I got the source that you post. I ran it and there was no errors.
I inspected my source for finding the differences between two sources and I found the difference, m_chart.GetAxis().RemoveAllCustom() !!

If there is the different code, " m_chart.GetExport().SaveToFile("c:\data.tee") " makes a error.


m_chart.RemoveAllSeries();

long lCustomAxisCount = m_chart.GetAxis().GetCustomCount(); // It retuens 1. I do not add any custom axis. Why 1??
m_chart.GetAxis().RemoveAllCustom(); // This code makes the error that I said.

m_chart.AddSeries(0);
m_chart.AddSeries(0);

m_chart.Series(0).FillSampleValues(10);
m_chart.Series(1).FillSampleValues(10);


long lYAxis;

lYAxis = m_chart.GetAxis().AddCustom(false);
m_chart.GetAxis().GetCustom(lYAxis).SetStartPosition(1);
m_chart.GetAxis().GetCustom(lYAxis).SetEndPosition(60);
m_chart.GetAxis().GetCustom(lYAxis).GetTitle().SetAngle(90);
m_chart.Series(0).SetVerticalAxisCustom(lYAxis);

lYAxis = m_chart.GetAxis().AddCustom(false); // Not error at this time
m_chart.GetAxis().GetCustom(lYAxis).SetStartPosition(70);
m_chart.GetAxis().GetCustom(lYAxis).SetEndPosition(99);
m_chart.GetAxis().GetCustom(lYAxis).GetTitle().SetAngle(90);
m_chart.Series(1).SetVerticalAxisCustom(lYAxis);

m_chart.GetExport().SaveToFile("c:\data.tee"); -> Error occurs.

Please Check it.

Thanks.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Jan 21, 2005 11:58 am

Hi,

checked. Yes the difference is the RemoveAllCustom() call.
long lCustomAxisCount = m_chart.GetAxis().GetCustomCount(); // It retuens 1. I do not add any custom axis. Why 1??
Yes, you're correct, it's a known problem already down our deffect list. We'll review and try to fix if for the next maintenance release. In meantime you can remove this line which will make it work fine , also if you need to refer to any of the CustomAxis using the index, remember to increment by 1 the index.

Post Reply