网上下载jquery-sparkline的js,下载地址 https://omnipotent.net/jquery.sparkline/#s-download
这个插件依赖Jquery,所以也要引入Jquery
官网有示例,以后开发有用得到,拿来即用。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery-sparkline.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
$('.inlinesparkline').sparkline();
var myvalues = [10,8,5,7,4,4,1];
$('.dynamicsparkline').sparkline(myvalues,{width:'400px',height:'200px',lineColor:'yellow',fillColor:'red'});
$('.dynamicbar').sparkline(myvalues, {type: 'bar', ba