Dimple 业务分析 API 项目简介
Dimple 是一个面向对象的 API,它可以通过 d3.js 来创建灵活的轴线图。创建此项目的目的是让那些非 JavaScript 专家的程序员也能创建标准的(或者比较标准的)业务分析表格。示例更多示例开始添加以下代码到您的HTML中:<script src="http://d3js.org/d3.v3.min.js"></script>添加dimple如下:<script src="http://dimplejs.org/dist/dimple.v2.1.6.min.js"></script>就是这样!如果你不知道从哪里开始,那就一个空白的文本文档,按照以下步骤并将其保存为HTML。<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://dimplejs.org/dist/dimple.v2.1.6.min.js"></script>
</head>
<body>
<script type="text/javascript">
var svg = dimple.newSvg("body", 800, 600);
var data = [
{ "Word":"Hello", "Awesomeness":2000 },
{ "Word":"World", "Awesomeness":3000 }
];
var chart = new dimple.chart(svg, data);
chart.addCategoryAxis("x", "Word");
chart.addMeasureAxis("y", "Awesomeness");
chart.addSeries(null, dimple.plot.bar);
chart.draw();
</script>
</body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://dimplejs.org/dist/dimple.v2.1.6.min.js"></script>
</head>
<body>
<script type="text/javascript">
var svg = dimple.newSvg("body", 800, 600);
var data = [
{ "Word":"Hello", "Awesomeness":2000 },
{ "Word":"World", "Awesomeness":3000 }
];
var chart = new dimple.chart(svg, data);
chart.addCategoryAxis("x", "Word");
chart.addMeasureAxis("y", "Awesomeness");
chart.addSeries(null, dimple.plot.bar);
chart.draw();
</script>
</body>