先来看看效果图
下面直接上源代码,html文件
<Meta charset="utf-8">
实时刷新折线图
Box="0 0 500.0 300.0" preserveAspectRatio="none meet">
Box="0 0 200.0 200.0" preserveAspectRatio="none meet">
<script src="http://d3js.org/d3.v3.js" charset="utf-8">
<script src="linechart.js" charset="utf-8">
<svg contentScriptType="text/ecmascript" width="2000" xmlns:xlink="http://www.w3.org/1999/xlink" zoomAndPan="magnify" style="background-color:#ffffff;" contentStyleType="text/css" viewBox="0 0 2000.0 2000.0" height="2000" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" version="1.0">