palerdot / react-d3-speedometer

React Speedometer component using d3.js ⚛️
https://palerdot.in/react-d3-speedometer/
MIT License
230 stars 57 forks source link

how can i give a unit/prefix/suffix to the segment label value ? #151

Closed kennyma-eplus closed 1 year ago

kennyma-eplus commented 1 year ago

i can only format using d3-format but can i add some text into it ?

palerdot commented 1 year ago

Please use customSegmentLabels to have complete control over what data to render - https://github.com/palerdot/react-d3-speedometer#custom-segment-labels---live-example

palerdot commented 1 year ago

Please reopen this issue if your case is unique.

kennyma-eplus commented 1 year ago

Please use customSegmentLabels to have complete control over what data to render - https://github.com/palerdot/react-d3-speedometer#custom-segment-labels---live-example

@palerdot I think customSegmentLabels cannot apply because i want to add unit to thevalue`, but not labelling the segment Screenshot 2022-09-26 at 9 31 44 AM

For Example, i want to add a "%" after the value for the Current Value, i can use currentValueText , but can I add text to segment value ?