【问题标题】:how to display data in which format using dc.js如何使用 dc.js 以哪种格式显示数据
【发布时间】:2014-05-17 16:04:37
【问题描述】:

我正在使用基于 d3 和 crossfilter 的 Dimensional Charting javascript 库 dc.js 制作图表。我是 dc.js 库的新手。我正在尝试使用 django 框架为 python 显示图形。我正在使用 dataforamat csv。 csv 格式如下。我很困惑显示数据以饼图、行图、条形图、气泡图格式显示。

Name,Date,Word,Word_count
The Telegram,2014-04-02,Panag,1
The Telegram,2014-04-02,rule:,1
The Telegram,2014-04-02,Story,1
The Telegram,2014-04-02,U.P.,1
The Telegram,2014-04-02,leaders,1
The Telegram,2014-04-02,Mumbai,1
The Telegram,2014-04-02,Union,1
The Telegram,2014-04-02,Dimple,1
The Telegram,2014-04-02,Drivers,1
The Telegram,2014-04-02,Tennis,1
The Telegram,2014-04-02,son,1
The Telegram,2014-04-02,Style,1
The Telegram,2014-04-02,Anantnag,1
The Telegram,2014-04-02,Golf,1
The Telegram,2014-04-02,Chess,1
The Telegram,2014-04-02,cook,1
The Telegram,2014-04-02,u.p.,1
The Telegram,2014-04-02,best-seller,1
The Telegram,2014-04-02,Arts,1
The Telegram,2014-04-02,Interview,1
The Telegram,2014-04-02,Jaha,1
The Telegram,2014-04-02,Mehboob,1
The Telegram,2014-04-02,Other,1
The Telegram,2014-04-02,Hollywood,1
The Telegram,2014-04-02,Week,1
The Telegram,2014-04-02,Modis,1
The Telegram,2014-04-02,Life,1
The Telegram,2014-04-02,TV,1
The Telegram,2014-04-02,Delhi,2

【问题讨论】:

    标签: d3.js dc.js


    【解决方案1】:

    我不确定问题是什么,但是除了生成您提到的 csv 之外,您不需要 dc.js 上的 django。其余的纯粹在浏览器中。

    如果您想过滤数据(例如,将其用作折线图上的 X 轴),您需要预处理数据以将字符串日期转换为 javascript 日期

    至于dc提供的各种图表,可以查看那个文档:https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md

    【讨论】:

      猜你喜欢
      • 2013-06-23
      • 2017-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多