#include <math.h>

#include "Chart.h"
#if defined(_UNICODE) || defined(UNICODE)
#	pragma comment(lib,"CChartu.lib")
#else
#	pragma comment(lib,"CChart.lib")
#endif
using namespace NsCChart;

int main(int argc, char* argv[])
{
	const double Pi = 3.1415926536;
	const int len = 360;
	double pX[len], pY[len];
	int i;
	for(i=0; i<len; i++)
	{
		pX[i] = i;
		pY[i] = 5.0*sin(3.0*i*2.0*Pi/len);
	}
	HWND hWnd = CreatePopupChartWnd(NULL, kTypeXY, _T("Title"));
	GetChart(hWnd)->AddCurve(pX, pY, len);
	GetChart(hWnd)->SetTitle(_T("Console Application"));
	GetChart(hWnd)->OnDraw(hWnd);

	//需要建立消息循环，不然界面卡死
	SimpleMsgLoop();

	return 0;
}