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=465;db=1;dl=1;dr=1;dt=1;notify=1;transparent=1;z=1}
)
/*}}*/

import cchart;

cchart.CreateChart();
cchart.Attach1(winform.static.hwnd,2);//kTypeStem=2 柱图
cchart.ChooseCurChart1(winform.static.hwnd);
var data = { double arr[4]={0}; };

data.arr[1]=28;
data.arr[2]=22;
data.arr[3]=21;
data.arr[4]=39;


cchart.AddStems(data,4);
//显示图例
cchart.SetLegendShow(true,0)
cchart.SetDataTitle("使用率1",0,0)

cchart.SetStemLabel("VB",0);
cchart.SetStemLabel("C++",1);
cchart.SetStemLabel("无名氏",2);
cchart.SetStemLabel("aardio",3);

data.arr[1]=20;
data.arr[2]=38;
data.arr[3]=12;
data.arr[4]=30;

cchart.AddStems(data,4);
cchart.SetLegendShow(true,1)
cchart.SetDataTitle("使用率2",1,0)

cchart.ReDraw2();

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