django前端图表

dchartjs的Python项目详细描述


dchartjs公司

dchartjs是python包。它用于在前端使用Django绘制图表

安装

使用包管理器pip安装dchartjs。在

pip install dchartjs

Django的基本用法

在Django视图.py在

^{pr2}$

在图表.html在

<body>
{{ chart_as }}
</body>

无框架基本用法

如果您不使用任何框架,那么您也可以直接绘制到web中

fromdchartjs.basic_chartimportBchartChart=Bchart()Chart.chart_data(xdata=[0,2,5,10],ydata=[1,5,5,25])Chart.project_web()#it creat temp.html file then open chart in browser 

基本样式dchartjs

fromdchartjs.basic_chartimportBchartdefDjangoChart(request):Chart=Bchart()Chart.chart_style_conf(width=100,height=100)Chart.chart_data(xdata=[0,2,5,10],ydata=[1,5,5,25])data=Chart.project_djangoview()returnrender(request,'chart.html',data)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java Spring REST API JSON在postman中显示,但在测试中未“看到”   java如何以编程方式检查旋转设备?   java力穷举开关   amazon web services DynamoDB从Java更新列表失败   java Android studio IDE更改波斯注释字体   java如何将postgresql添加到OpenShift Spring应用程序?   java RecycleView分页是否在末尾添加新项?   如何通过java获取移动设备信息?   java为什么Apache Commons StringEscapeUtils escapeXML10不能在groovy中工作?   函数式编程java curry现有的静态函数   java与JList的合作