How to dynamically creating the Ticks values? #3675
-
Sample code
Here needle count is 33. Can I add '%' to the ticks value like 0%,1%,2% etc.? Kindly help me . |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You are almost there: where you have I'm sorry I'm not able to follow your reasoning with the needle count, so you might have to adapt the answer. |
Beta Was this translation helpful? Give feedback.
-
Ok, |
Beta Was this translation helpful? Give feedback.
You are almost there: where you have
labelFormat: d3.format('d'),
, change instead to a function that returns the string that you want to display, for exampled3.format('%')
. See the documentation at https://github.com/d3/d3-formatI'm sorry I'm not able to follow your reasoning with the needle count, so you might have to adapt the answer.