Axis GetPOstion() returns 0 and more
Posted: Thu Feb 17, 2011 1:07 pm
Hi,
I am using TeeChart pro V8.0.0.6 Version v Active x, C++.
The following code draws the chart, axis and series as expected.
The values of leftPos, bottomPos and topPos which use the axis GetPosition() function get 0 values. Why?
chartCenter, ChartWidth and canvasLeft get 0 value as well. Why?
Drawing line on the canvas with MoveTo() LineTo() using several different values of argumnets don't draw any line. Why?
Is there anything mising?
Please help me.
Thanks,
YVB
I am using TeeChart pro V8.0.0.6 Version v Active x, C++.
The following code draws the chart, axis and series as expected.
The values of leftPos, bottomPos and topPos which use the axis GetPosition() function get 0 values. Why?
chartCenter, ChartWidth and canvasLeft get 0 value as well. Why?
Drawing line on the canvas with MoveTo() LineTo() using several different values of argumnets don't draw any line. Why?
Is there anything mising?
Please help me.
Thanks,
YVB
Code: Select all
m_Chart.GetAspect().SetView3D(false);
m_Chart.GetAxis().GetLeft().SetAutomatic(false);
m_Chart.GetAxis().GetLeft().SetVisible(true);
m_Chart.GetAxis().GetLeft().SetMaximum(100);
m_Chart.GetAxis().GetLeft().SetMinimum(0);
m_Chart.GetAxis().GetBottom().SetAutomatic(false);
m_Chart.GetAxis().GetBottom().SetVisible(true);
m_Chart.GetAxis().GetBottom().SetMaximum(200);
m_Chart.GetAxis().GetBottom().SetMinimum(0);
m_Chart.AddSeries(scFastLine);
m_Chart.Series(0).AddXY(0.0, 0.0, NULL,RGB(255, 0, 0));
m_Chart.Series(0).AddXY(30.0, 30.0,NULL,RGB(255, 0, 0));
long leftPos = m_Chart.GetAxis().GetLeft().GetPosition();
long bottomPos = m_Chart.GetAxis().GetBottom().GetPosition();
long topPos = m_Chart.GetAxis().GetTop().GetPosition();
long chartXCenter = m_Chart.GetCanvas().GetChartXCenter();
long ChartWidth = m_Chart.GetChartWidth();
long canvasLeft = m_Chart.GetCanvas().GetLeft();
m_Chart.Repaint();
m_Chart.GetCanvas().GetPen().SetColor(RGB(0,255,0));
m_Chart.GetCanvas().MoveTo( 100, 200);
m_Chart.GetCanvas().LineTo( 100, 200);
m_Chart.Repaint();