在Django中显示图形/图表 [英] Displaying graphs/charts in Django

查看:108
本文介绍了在Django中显示图形/图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Django中制作一个报表应用程序,其中涉及许多图形和图表。

I'm making a report app in Django that involves plenty of graphs and charts.

是否有一个简单的图形库/模块可以让我实现此工作流程:

Is there an easy graphing library/module that allows me to achieve this workflow:


  1. 执行我的SQL查询

  2. 将返回的数据解析到图形库/模块

  3. 图形库/模块将数据处理为图表/图,我可以轻松地将其输出到Django模板。

我花了最后几天来与Matplotlib和Django一起玩。似乎只有几种方法可以使图形在Django中呈现。

I've spent the last couple of days playing around with Matplotlib and Django. There are seemingly only a few ways to get the graphs to render in Django.


  1. 使用2个视图,一个视图呈现PNG,另一个视图一个输出img src指向第一个视图的HTML。 链接

  2. 数据URI

  3. 将图像写入文件,然后在视图中调用

无论如何,我可以更轻松地完成此操作?

Is there anyway I can do this more easily?

谢谢

推荐答案

您可能想看看

Django Graphos

它支持很多后端,并且与Django orm集成良好,但是也可以与其他数据源一起使用。

It supports lot of backends, and integrates well with Django orm, but can work with other data sources too.


  • 折线图

  • 条形图

  • 点图


  • 折线图

  • 柱形图

  • 条形图

  • 烛台图

  • 饼图

  • Line chart
  • Column chart
  • Bar chart
  • Candlestick charts
  • Pie chart

  • 折线图

  • 柱形图

  • 条形图

  • 饼图

  • Line chart
  • Column chart
  • Bar chart
  • Pie chart

  • 折线图

  • 柱形图

  • 甜甜圈图

[披露:我是作者之一]

[Disclosure: I am one of the authors]

这篇关于在Django中显示图形/图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆