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.
Problem with adding custom axis...
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 ?
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 ?
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
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.
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.
Hi,
checked. Yes the difference is the RemoveAllCustom() call.
checked. Yes the difference is the RemoveAllCustom() call.
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.long lCustomAxisCount = m_chart.GetAxis().GetCustomCount(); // It retuens 1. I do not add any custom axis. Why 1??
Pep Jorge
http://support.steema.com
http://support.steema.com