RGraph:svg:双線図
2862 ワード
もっと読む
wwww.rgraph.netダウンロードRGraph.minifed-2018-08-14.zip
解凍後、ディレクトリのlibriesを略して、libとする.
双線図の例:RGraph/svg/ライン2.
wwww.rgraph.netダウンロードRGraph.minifed-2018-08-14.zip
解凍後、ディレクトリのlibriesを略して、libとする.
双線図の例:RGraph/svg/ライン2.
RGraph : SVG Line charts API
var keys = ['Richard','Charlie'];
var data =[[0.05,0.06,0.01,0.06,0.09,0.02,0.07],
[0.07,0.02,0.06,0.08,0.05,0.05,0.02]];
var labels = [' ',' ',' ',' ',' ',' ',' '];
var line2 = new RGraph.SVG.Line({
id: 'chart-line',
data: data,
options: {
backgroundGridVlines: true,
backgroundGridBorder: false,
key: keys,
gutterTop: 55,
linewidth: 5,
hmargin: 0,
title: 'A basic linechart',
gutterLeft: 50,
gutterBottom: 50,
yaxisDecimals: 2,
tickmarksStyle: 'endcircle',
tickmarksFill: 'white',
tickmarksLinewidth: 3,
tickmarksSize: 10,
spline: true,
xaxis: false,
yaxis: false,
xaxisLabels: labels,
shadow: true
}
}).trace();
// create table
var table = document.createElement("table");
table.border = "1"; // table.width = "100%";
var tb = document.createElement("tbody");
table.appendChild(tb);
var tr,td;
tr = tb.insertRow(0); //
td = tr.insertCell(0); //
td.innerHTML = "Name"; //
for(var j=0; j<labels.length; j++){
td = tr.insertCell(tr.cells.length);
td.innerHTML = labels[j];
td.align = "center";
}
//
for(var i=0; i<keys.length; i++){
tr = tb.insertRow(tb.rows.length); //
td = tr.insertCell(0); //
td.innerHTML = keys[i]; //
for(var j=0; j< data[i].length; j++){
td = tr.insertCell(tr.cells.length);
td.innerHTML = data[i][j];
td.align = "center";
}
}
document.querySelector("#tab").appendChild(table);