js代码
<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script> <script src="js/jquery-pie-loader.js"></script> <script type="text/javascript"> $(document).ready(function() { var rand = function() { return Math.floor((Math.random() * 100) + 1) } $('*[data-behavior="pie-chart"]').each(function() { $(this).svgPie({ percentage: rand() }); }); }); </script>