import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add(
static={cls="static";left=0;top=0;right=760;bottom=428;db=1;dl=1;dr=1;dt=1;notify=1;transparent=1;z=1}
)
/*}}*/

import cchart;

cchart.CreateChart();
cchart.Attach1(winform.static.hwnd,0);//kTypeXY=0 折线图
cchart.ChooseCurChart1(winform.static.hwnd);

var x = { double arr[200] = {0} };
var y = { double arr[200] = {0} };
for(i=1;200;1){
	x.arr[i] = i ;
	y.arr[i] = 5.0*math.sin(i*2.0*3.14/360.0*3.0) ;
}

cchart.AddCurve1(x,y,200,0);
//显示图例
cchart.SetLegendShow(true,0)
//设置图例名称
cchart.SetDataTitle("aardio王菲",0,0)
//设置轴名,左坐标轴为0，下坐标轴为1，右坐标轴为2，上坐标轴为3
cchart.SetAxisTitle1("左边轴名",0,0);
cchart.SetAxisTitle1("下边轴名",1,0);
//设置显示网格
cchart.SetGridLine(true,true,true,true,0);
//设置背景色
cchart.SetBkgndColor(0xFFE6C2,0);
cchart.ReDraw2();

winform.onClose = function(hwnd,message,wParam,lParam){
    cchart.Detach(winform.static.hwnd);
    cchart.DestroyChart();
}


winform.show();
win.loopMessage();
return winform;
