There is a problem with TeeChart not drawing to a device context. This problem was introduced in v2012.
Below is a code snippet from our OnPaint call (where CChildView is a derived CWnd class).
Code: Select all
void CChildView::OnPaint()
{
[snip]
// Draw background
pDC->FillSolidRect(rclChart, RGB(0xff, 0xff, 0xff));
...
// Draw Chart
HDC hdc = pDC->m_hDC;
pChartData->Draw((long)hdc, rclChart.left, rclChart.top, rclChart.right, rclChart.bottom);
[snip]
}
I have attached a program and source code that demonstrates the problem.
To reproduce it:
Register TeeChart2011.ocx
Run SteemaChartBugDemo.exe
-- Resize the window, multiple times, as well as selecting "View->Refresh" from the main window. The page should draw itself as expected.
Now Register TeeChart2012.ocx or TeeChart2013.ocx
Run SteemaChartBugDemo.exe
-- When you resize or refresh the window, you will notice that the chart isn't drawn over the background image all the time. It might work up to 90% of the time, but eventually you will see that the chart isn't drawn on top of the background image.
Let me know if you need any more help in reproducing this bug. Thank you!