RGraph:svg:変動のヒストグラム

2081 ワード

もっと読む
wwww.rgraph.netダウンロードRGraph 4.67-stable.zip
解凍後、ディレクトリのlibriesを略して、libとする.
変動のヒストグラム例:RGraph/svg_bar_wavel.




  
  RGraph : SVG Bar charts wave 
  
  
  
  


    
var data = [[4,8,6],[1,6,8],[4,9,6],[4,6,3],[5,2,1],[8,6,3],[8,6,3]]; var labels = [' ',' ',' ',' ',' ',' ',' ']; var colors = ['#C0504D','#9BBB59','#4F81BD']; var bar3 = new RGraph.SVG.Bar({ id: 'chart-bar', data: data, options: { hmargin: 30, xaxisLabels: labels, colors: colors, yaxis: false, xaxisColor: '#aaa', backgroundGridVlines: false, backgroundGridBorder: false } }).wave(); // create table var table = document.createElement("table"); table.border = "1"; // table.width = "100%"; var tb = document.createElement("tbody"); table.appendChild(tb); //var tr = document.createElement("tr"); var tr,td; tr = tb.insertRow(0); // for(var j=0; j<labels.length; j++){ td = tr.insertCell(tr.cells.length); td.innerHTML = labels[j]; td.align = "center"; } tr = tb.insertRow(tb.rows.length); // for(var j=0; j<data.length; j++){ td = tr.insertCell(tr.cells.length); td.innerHTML = data[j]; td.align = "center"; } document.querySelector("#tab").appendChild(table);