The x axis of my line graph represents money. Is there any way to append a € symbol to the beginning of each tick?
At the moment they are just values 2000000, 250000, 300000....
I would like them to display €2000000, €250000, €300000....
I tried adding the € to my .CSV file but it caused an error when I tried to call the data to make my axis.
Use the tickFormat
function:
https://github.com/mbostock/d3/wiki/Quantitative-Scales#wiki-linear_tickFormat
For example:
axis.tickFormat( function(d) { return "€" + d } );
Also consider using d3.format to group your numbers by with commas/periods, etc.
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