Skip to content

Instantly share code, notes, and snippets.

@pfeodrippe
Last active June 24, 2018 17:31
Show Gist options
  • Save pfeodrippe/c2f2bea9d97938d67adf72ac1f5d2b45 to your computer and use it in GitHub Desktop.
Save pfeodrippe/c2f2bea9d97938d67adf72ac1f5d2b45 to your computer and use it in GitHub Desktop.
fla charts
var chart = c3.generate({
data: {
x: 'x',
columns: [
['x', '0-4', '5-9', '10-14', '15-24', '25-49', '50+'],
['homens', 343, 300, 314, 555, 610, 295],
['mulheres', 318, 305, 315, 560, 591, 344]
],
type: 'bar'
},
axis: {
rotated: true,
x: {
type: 'category' // this needed to load string x value
}
}
,
size: {
height: 320,
width: 320
},
bar: {
width: {
ratio: 0.5 // this makes bar width 50% of length between ticks
}
// or
//width: 100 // this makes bar width 100px
}
});
chart.axis.max({
y: 900,
});
var chart = c3.generate({
data: {
x: 'x',
columns: [
['x', '0-4', '5-9', '10-14', '15-24', '25-49', '50+'],
['homens', 315, 301, 321, 564, 766, 411],
['mulheres', 301, 321, 323, 483, 809, 450]
],
type: 'bar'
},
axis: {
rotated: true,
x: {
type: 'category' // this needed to load string x value
}
}
,
size: {
height: 320,
width: 320
},
bar: {
width: {
ratio: 0.5 // this makes bar width 50% of length between ticks
}
// or
//width: 100 // this makes bar width 100px
}
});
chart.axis.max({
y: 900,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment