COM exception on call of putLogarithmic(TRUE)

TeeChart for ActiveX, COM and ASP
Post Reply
Mathieu
Newbie
Newbie
Posts: 8
Joined: Mon Jan 26, 2004 5:00 am
Contact:

COM exception on call of putLogarithmic(TRUE)

Post by Mathieu » Thu May 27, 2004 8:57 pm

Hi,
I created a curve viewer using TChart to vizualize data.
Everything works fine excepts that I wan't to be able to
change the logarithmic status dynamicly.

I first set the logarithmic status to true and then I set
the data in the chart. Until there everything is perfect and
the Y axis is logarithmic and the X axis linear, just as I want.

But once the data is set to the chart, I am able to modify the
X axis logarithmic status but the Y axis logarithmic throw an
exception if I set it to true.

Any idea why this happens?

Here is the code I use:
//m_p_chart is a TeeChart::ITChart interface.
//v_Data and v_time are SafeArrays put in Variants.

//That line works fine<<<<<<<<<<<<<<<<<<<<<<<<<<<
m_p_chart->GetAxis()->GetLeft()->Logarithmic = true;

m_p_chart->AddSeries(TeeChart::scLine);

m_p_chart->Series(m_n_curves)->GetasLine()->GetPointer()->PutStyle(TeeChart::psSmallDot);

m_p_chart->Series(m_n_curves)->GetasLine()->GetPointer()->GetBrush()->PutColor(RGB(red,green,blue));

m_p_chart->Series(m_n_curves)->AddArray(n_points.ulVal, v_Data, v_time);

//That line throws an exception<<<<<<<<<<<<<<<<<<<<<<
m_p_chart->GetAxis()->GetLeft()->Logarithmic = true;

I trace the code and the put_Logarithmic() function returns
E_UNEXEPECTED when parameter is VARIANT_BOOL = 1.
This cause the exeption.

Thank you very much.

---
Mathieu

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Fri May 28, 2004 9:44 am

Hi Mathieu,
//m_p_chart is a TeeChart::ITChart interface.
//v_Data and v_time are SafeArrays put in Variants.

//That line works fine<<<<<<<<<<<<<<<<<<<<<<<<<<<
m_p_chart->GetAxis()->GetLeft()->Logarithmic = true;

m_p_chart->AddSeries(TeeChart::scLine);

m_p_chart->Series(m_n_curves)->GetasLine()->GetPointer()->PutStyle(TeeChart::psSmallDot);

m_p_chart->Series(m_n_curves)->GetasLine()->GetPointer()->GetBrush()->PutColor(RGB(red,green,blue));

m_p_chart->Series(m_n_curves)->AddArray(n_points.ulVal, v_Data, v_time);

//That line throws an exception<<<<<<<<<<<<<<<<<<<<<<
m_p_chart->GetAxis()->GetLeft()->Logarithmic = true;
I'm afraid I can't get this code to throw an exception here. Could you please create a small project that I can run "as-is" to reproduce the problem here? Please post the project to:
news://www.berneda.com/steema.public.attachments

Thank you!
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/

Mathieu
Newbie
Newbie
Posts: 8
Joined: Mon Jan 26, 2004 5:00 am
Contact:

Post by Mathieu » Mon May 31, 2004 5:30 pm

I'm sorry, it was my mistake.
One of my data was negative.
Thanks.

Post Reply