I'm drawing a graph to show how many people completed our app and how many people failed going through all the steps. To do this my company has decided to use the library d3 to show the charts. However, on the pie chart they want a whole number to show instead of the default percentage and I can't seem to find any documentation on this.
My code for this looks like this
c3.generate({
bindto: '.pieChart',
data: {
columns: [
['Started', Started],
['Completed', Completed]
],
type: 'pie'
}
});
Any help would be appreciated!
The documentation is pretty clear.
var chart = c3.generate({
data: {
columns: [
['data1', 30],
['data2', 50]
],
type: 'pie'
},
pie: {
label: {
format: function(value, ratio, id) {
return value;
}
}
}
});
Example here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With