covalent-highlight-nightly icon indicating copy to clipboard operation
covalent-highlight-nightly copied to clipboard

ng2d3 chart data formatting

Open kyleledbetter opened this issue 8 years ago • 0 comments

It would be nice if we test & validate all the JSON formats for https://swimlane.github.io/ng2d3/ (seems like it will)

like

bar

[
  {
    "name": "Germany",
    "value": 46268
  },
  {
    "name": "USA",
    "value": 53041
  }
]

stacked vertical bar

[
  {
    "name": "Germany",
    "series": [
      {
        "name": "2010",
        "value": 46268
      },
      {
        "name": "2000",
        "value": 23685
      },
      {
        "name": "1990",
        "value": 22219
      }
    ]
  },
  {
    "name": "USA",
    "series": [
      {
        "name": "2010",
        "value": 48377
      },
      {
        "name": "2000",
        "value": 36449
      },
      {
        "name": "1990",
        "value": 23954
      }
    ]
  }
]

area (time)

[
  {
    "name": "Cook Islands",
    "series": [
      {
        "value": 4080,
        "name": "2016-09-24T05:43:56.736Z"
      },
      {
        "value": 4424,
        "name": "2016-09-13T00:08:01.493Z"
      },
      {
        "value": 3136,
        "name": "2016-09-13T17:39:59.969Z"
      },
      {
        "value": 4736,
        "name": "2016-09-18T07:10:52.207Z"
      },
      {
        "value": 4419,
        "name": "2016-09-14T03:17:03.045Z"
      }
    ]
  },
  {
    "name": "Canada",
    "series": [
      {
        "value": 2045,
        "name": "2016-09-24T05:43:56.736Z"
      },
      {
        "value": 2704,
        "name": "2016-09-13T00:08:01.493Z"
      },
      {
        "value": 6550,
        "name": "2016-09-13T17:39:59.969Z"
      },
      {
        "value": 4151,
        "name": "2016-09-18T07:10:52.207Z"
      },
      {
        "value": 3924,
        "name": "2016-09-14T03:17:03.045Z"
      }
    ]
  }
]

force directed (network)

[
  {
    "name": "Germany",
    "series": [
      {
        "name": "2010",
        "value": 46268
      },
      {
        "name": "2000",
        "value": 23685
      },
      {
        "name": "1990",
        "value": 22219
      }
    ]
  },
  {
    "name": "USA",
    "series": [
      {
        "name": "2010",
        "value": 48377
      },
      {
        "name": "2000",
        "value": 36449
      },
      {
        "name": "1990",
        "value": 23954
      }
    ]
  }
]

kyleledbetter avatar Dec 15 '16 22:12 kyleledbetter