Page 1 of 1

How can I use Polar chart?

Posted: Thu Mar 12, 2015 1:18 am
by 16669902
How can I use Polar chart?

I’m trying to make for Polar chart in my project.
But I can’t success it.
I want a simple example like below my project's function "void CDlgTeeChart::SetPolarChart()".
It’s ordinary chart. It is working good.
And then similarly, I tried to make a function “void CDlgTeeChart::SetPolarChart()” for Polar chart using to “IPolarSeriesPtr”.
But ” ITChartPtr m_ctrlTChart”'s method “Series” doesn't take “IPolarSeriesPtr polarSeries” as input factor.
I already tried to find to replacement "Series" method or "ITChartPtr".
But I can't find good compatible replacement.
My project option is MFC, VS2012, TeeChart201464.ocx.

This is working good.

Code: Select all

void CDlgTeeChart::SetChart()   :D 
{
	long result;
	m_ctrlTChart->AddSeries(ESeriesClass::scLine, &result );
	ISeriesPtr series;
	BSTR label = (BSTR)L"hello";
	OLE_COLOR color = RGB( 100, 200, 100 );

	m_ctrlTChart->Series(m_index, &series);

	for(int x=0; x<100; x++)
	{
		for(int y=0; y<100; y++)
		{
			series->AddXY((double) x, (double) y, label, color, nullptr);
		}
	}
}
It's not working!!!
Please help.

Code: Select all

void CDlgTeeChart::SetPolarChart()   :cry: 
{
	long result;
	m_ctrlTChart->AddSeries(ESeriesClass::scLine, &result );
	// ISeriesPtr series;
	IPolarSeriesPtr polarSeries;
	BSTR label = (BSTR)L"hello";
	OLE_COLOR color = RGB( 100, 200, 100 );

        /////// //  :evil:  Error! I want to replace Series. ///////////////
	m_ctrlTChart->Series(m_index, &polarSeries); 

	for(int angle=0; angle<360; angle++)
	{
		for(int val=0; val<100; val++)
		{
			//series->AddXY((double) x, (double) y, label, color, nullptr);
			polarSeries->AddPolar((double) angle, (double) val, label, color, nullptr);
		}
	}
}

Re: How can I use Polar chart?

Posted: Thu Mar 12, 2015 9:56 am
by yeray
Hello,

There could be some cast missing. Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.