//chart的数据格式,xChart中所有的图表数据格式都是这样的二维数组, //第一行是表头。 var data = []; // Parametric curve for (var t = 0; t < 25; t += 1) { var x = (1 + 0.25 * Math.cos(75 * t)) * Math.cos(t); var y = (1 + 0.25 * Math.cos(75 * t)) * Math.sin(t); var z = t + 2.0 * Math.sin(75 * t); data.push({x, y, z}); } console.log(data.length); var options = { coord : { type : "box", xAxis : { field : "x", layoutType:"proportion", dataSection:[-1.5,-1,-0.5,0,0.5,1,1.5] }, yAxis:{ name : "z", layoutType : "proportion", dataSection : [-1.5,-1,-0.5,0,0.5,1,1.5] }, zAxis:{ field: "y", layoutType: "proportion", dataSection: [-1.5,-1,-0.5,0,0.5,1,1.5] } }, graphs : [ { type : "line", field : "z", yAxisName:"z", line:{ smooth:false }, area:{ enabled:false }, icon:{ enabled:false } } ] }; window.line = Chartx3d.create("canvasTest" , data , options)
折线图(bar chart)
联系人:@不决