當前位置:
首頁 >
当当网图书项目
發布時間:2023/12/31
41
豆豆
一、準備工作
二、app.py
五、index.html
{% extends "base.html" %} {% block content %} <table class="table table-striped"><tr><th>編號</th><th>書名</th><th>價格</th><th>作者</th><th>出版社</th><th>出版日期</th><th>評論數</th></tr> {% for row in rows %}<tr><td>{{ row["BookId"] }}</td><td>{{ row["Title"]|filter }}</td><td>{{ row["Price"] }}</td><td>{{ row["Author"] |filter}}</td><td>{{ row["Press"] }}</td><td>{{ row["PubTime"] }}</td><td>{{ row["Comments"] }}</td></tr> {% endfor %}</table> {% endblock %}六、show.html
{% extends "base.html" %} {% block content %} <div id="box" style="width: 800px;height: 900px;margin: 0 auto"></div> <script src="static/js/echarts.min.js"></script><script>myecharts=echarts.init(document.getElementById("box"))option = {title : {text: '當當網圖書出版社統計',},tooltip : {trigger: 'axis'},legend: {data:['圖書出版社']},toolbox: {show : true,feature : {mark : {show: true},dataView : {show: true, readOnly: false},magicType : {show: true, type: ['line', 'bar']},restore : {show: true},saveAsImage : {show: true}}},calculable : true,xAxis : [{type : 'category',data : {{ x|safe }}}],yAxis : [{type : 'value'}],series : [{name:'圖書出版社',type:'bar',data:{{ y|safe }}},] };myecharts.setOption(option)</script> {% endblock %}```總結
- 上一篇: 软件工程大一至大四课程
- 下一篇: 营业执照数据生成