Django-Fusion Charts可在一个饼图中显示所有值 [英] Django - Fusion Charts to display all values in one pie chart

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

问题描述

这是饼图的相关Fusion图表代码.我想显示数据库中所有条目的所有属性,但要根据名称"

This is the relevant Fusion charts code for a pie chart. I want to display all the attributes in my database of all entries but according to 'name'

  dataSource2['data'] = []
    # Iterate through the data in `Revenue` model and insert in to the 
 `dataSource['data']` list.
    for key in all_books:
        data = {}
        data['label'] = key.name
        data['value'] = key.price
        dataSource2['data'].append(data)

阐述:我想实现的概念是为每个条目显示所有单个参数

Elaboration: Following concept i want to achieve to display all single parameters for every entry

    data[value1]=key.printingcost
    data[value2]=key.papercost
    data[value3]=key.binding

(在饼图中)可以使用Fusion Charts库吗?

Is it possible(in pie charts) suing Fusion charts library??

随附图片以供参考

推荐答案

是的,要在FusionCharts中绘制pie3d图表旅馆,您需要创建一个数据数组,该数组将包含每个对象的标签和值,您可以在饼图,但是饼图并不是展示大数据的理想选择,但是FusionCharts会根据您的数据绘制饼图,以了解有关饼图的更多信息,请检查此链接-

Yes, for rendering pie3d chart inn FusionCharts you need to create a data array, which would contain label and value as each object, you can showcase many data in the pie chart, but pie charts are not ideal for showcasing large data, but FusionCharts will draw the pie slices accordingly with your data, to know more about pie charts check this link - https://www.fusioncharts.com/dev/chart-guide/standard-charts/pie-and-doughnut-charts#pie-d-chart-2

FusionCharts还提供了专用的Django包装器,您可以使用该包装器从数据库中获取数据并相应地呈现图表-

FusionCharts also provides a dedicated Django wrapper, using which you could fetch the data from the database and render the chart accordingly - https://www.fusioncharts.com/dev/getting-started/django/install-using-django

这篇关于Django-Fusion Charts可在一个饼图中显示所有值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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