Page 1 of 1

COM exception on call of putLogarithmic(TRUE)

Posted: Thu May 27, 2004 8:57 pm
by 9080623
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

Posted: Fri May 28, 2004 9:44 am
by Chris
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!

Posted: Mon May 31, 2004 5:30 pm
by 9080623
I'm sorry, it was my mistake.
One of my data was negative.
Thanks.