如何在D3中使用嵌套和堆栈功能创建面积图

时间:2019-07-11 10:14:18

标签: javascript d3.js

我试图在我的ubuntu机器内存中绘制图形。

下面给出了如何使用JSON示例创建面积图作为预期输出

我能够使用stack中的nestversion 3函数创建d3 但是,无法在d3 version 4version 5

中做到这一点
   [
  {
    "memory": "reserved",
    "value": 3276823909,
    "timestamp": "Thu Jul 11 2019 11:40:00 GMT+0530 (India Standard Time)"
  },
  {
    "memory": "working",
    "value": 89273498,
    "timestamp": "Thu Jul 11 2019 11:40:00 GMT+0530 (India Standard Time)"
  },
  {
    "memory": "in_memory",
    "value": 234823947,
    "timestamp": "Thu Jul 11 2019 11:40:00 GMT+0530 (India Standard Time)"
  },
  {
    "memory": "reserved",
    "value": 94239898,
    "timestamp": "Thu Jul 11 2019 11:40:00 GMT+0530 (India Standard Time)"
  },
  {
    "memory": "buffer_manager",
    "value": 238492389,
    "timestamp": "Thu Jul 11 2019 11:40:00 GMT+0530 (India Standard Time)"
  }
]

例外的输出:

enter image description here

0 个答案:

没有答案