I'm currently working on a evolution graph with the framework c3.js based on d3.js.
I want to format the values of the Y axis that are numbers. I currently have this format : XX.X What I want is to use the comma as separator of decimals : XX,X
I tried two methods :
y : {
tick : {
values : steps,
format : d3.format(",.1f")
},
min : steps[0],
max : steps[steps.length-1]
}
And to use the d3 formatter :
y : {
tick : {
values : steps,
format : function(d) {
var s = d3.formatSpecifier("f");
s.precision = precisionFixed(0.1);
s.comma = true;
var f = d3.format(s);
return f(d);
}
},
min : steps[0],
max : steps[steps.length-1]
}
See doc here: https://github.com/d3/d3-format
But I get an error (d3.formatSpecifier is not a function...). Does someone already resolved this issue?
Thank you