palerdot/react-d3-speedometer

How do i pass each slot different color

Closed this issue · 5 comments

Each slot i want to pass different color how to pass.
Example: 0 - 100 If it is the max and min values.
0-20 (red)
20-40 (lightred)
40-60(green)
60-80(yellow)
Can any one help me to solve this.

This behaviour is not currently supported. Right now, colors are automatically calculated from start and end color. Maybe, in future versions there may be an option to give custom color for each segment. But it will not be anytime soon.

Is there any update for this issue?

@vivekgusain3pg sorry ... this feature is currently not planned for near future. If there is a PR, then I can consider now. For now, this feature is not supported.

@shashical This feature is now available in 0.6.0 version with segmentColors option/prop. Here is a sample sandbox - https://codesandbox.io/embed/relaxed-silence-c3qkb

Is there any update for this issue?

@vivekgusain3pg This feature is now available in 0.6.0 version with segmentColors option/prop. Here is a sample sandbox - https://codesandbox.io/embed/relaxed-silence-c3qkb