<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>D3.js サンプル</title> <link rel="stylesheet" href="css/main.css"> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> </head> <body> <h1>D3.jsサンプル</h1> <div id="result"></div> <script src="js/sample.js"></script> </body> </html>
var list = [10, 6, 8, 20, 89, 67, 5, 34, 41, 72, 53]; var n = d3.max(list); d3.select("#result").text("最大値は"+n);