question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading nested JSON objects

See original GitHub issue

When I load JSON as chart data, I cannot load any nested objects or array values, but only objects in the first “level” of the JSON object.

This works fine:

c3.generate({
data: [{myVal:1}],
keys: {value: ['myVal']} // load property "myVal" 
});

But this does not work:

c3.generate({
data: [{myVal: {innerVal:1}}],
keys: {value: ['myVal.innerVal']} // cannot access nested data here
});

There would only be a small change needed to implement the access of nested values, and it would make loading of JSON objects much easier in some cases.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
aendra-rininslandcommented, Apr 30, 2016

This is a solid idea. Merging PR to dev now.

0reactions
akshaysGitcommented, Mar 16, 2017

Hello,

I am trying to use following JSON data input for stacked bar chart, however its not working for nested input. If I put everything on one level, it works fine. Its just that nested is causing issue. can you pls help?

JSON data - `[ { “Month”: “Sample 1”, “TotalAmount”: “$100”, "StartDate: "EndDate: “Detail”: [ { “Type”: “A”, “Unit”: “50”, “Amount”: “20”}, { “Type”: “B”, “Unit”: “20”, “Amount”: “70”}, { “Type”: “C”, “Unit”: “2”, “Amount”: “10”}, ] }, { “Month”: “Sample 2”, “TotalAmount”: “$150”, “Detail”: [ { “Type”: “A”, “Unit”: “50”, “Amount”: “20”}, { “Type”: “C”, “Unit”: “2”, “Amount”: “10”}, ] },

]`

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Accessing Nested JSON Data - Stack Overflow
Plop your JSON into the tool in this snippet, check 'brackets only', then click the node you want to copy its code path...
Read more >
Extract Nested Data From Complex JSON
Extract Nested Data From Complex JSON. Never manually walk through complex JSON objects again by using this function. Todd.
Read more >
Live Demo | How to load nested json Using ADF | Tutorial 13
How to Load Nestes JSON File Using ADF.Convert JSON format to Tabular format in ADFparsing json in ...
Read more >
Parsing Nested JSON Fields in Events - Hevo Data
To load JSON-formatted Source data to the Destination, you must select how Hevo must parse the nested fields, objects, and arrays so that...
Read more >
Storing and retrieving Nested JSON document
Follow the below steps to understand how nested JSON objects can be imported into Redis database: ... Verify if RedisJSON module is loaded​....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found