C3 bar chart - JSON input
See original GitHub issueDoes the C3 bar chart support JSON data? I am trying to get a simple example working but could not find any documentation or examples on how to achieve something like this:
var chart = c3.generate({
data: {
type: 'bar',
json: [
{ 'indicator': 'X', 'total': 100 },
{ 'indicator': 'Y', 'total': 200 },
{ 'indicator': 'Z', 'total': 300 }
],
keys: {
x: 'indicator',
value: ['total']
}
},
bar: {
width: {
ratio: 0.5
}
}
});
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
javascript - C3 bar chart - JSON input - Stack Overflow
Problem was the missing axis value. Here is a working JS fiddle. var chart = c3.generate({ data: { type: 'bar', json: [ {...
Read more >c3.js stacked bar chart json - CodePen
1. var chart = c3.generate({ ; 2. data: { ; 3. groups: [['upload', 'download']], ; 4. type: "bar", ; 5. json: [.
Read more >[Solved]-C3 - Timeseries chart with JSON and categories-d3.js
forEach (function (value) { obj[value.city] = value.event; cities.add(value.city); }) obj.date = entry.key; return obj; }); var chart = c3.generate({ data: ...
Read more >Line Chart - Google Developers
The series option specifies which axis to use for each ( 'Temps' and 'Daylight' ; they needn't have any relation to the column...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems that you are missing ‘axis’ section. Try this:
Thanks for the pointer! That was the problem.
Here’s a working fiddle if anyone else runs into this: http://jsfiddle.net/z2erLqgx/2/