我的数据格式如下:
即mymy= UnitedStates,65|UnitedKingdom,58|Germany,30|India,60|Russia,65|China,75
代码 :
var myarr = mymy.split("|");
var i=0;
var myarr2 = [];
for (i=0;i<myarr.length;i++)
{
var mytemp=myarr[i].split(",");
myarr2[i]=mytemp[0]+','+mytemp[1];
};
var myChart = new JSChart('chartcontainer','bar');
var myData2 = new Array(myarr2);
/*
where mow
myarr2[0]={UnitedStates,65}
myarr2[1]={UnitedKingdom,58}
and so on
*/
myChart.setDataArray(myData2);
myChart.draw();