Gauge chart - color threshold can't be updated dynamically
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.4k
- Avg merge
- 6d 16h
- Merged PRs (30d)
- 1
Description
I've been trying to update the colors.threshold value dynamically on gauge chart as follows:
`chart.internal.config.color_threshold = [
Math.round(randomMaxValue/4),
Math.round(randomMaxValue/3),
Math.round(randomMaxValue/2),
randomMaxValue
];`
It doesn't seem to work. Is this a bug on c3?
Here's a codepen where you can see the issue:
[https://codepen.io/felipevega/pen/WBaQKP](url)
C3 version: v0.4.23
D3 version: N/A
Browser: Chrome - Version 69.0.3497.100 (Official Build) (64-bit)
OS: macOS Mojave - Version 10.14
Contributor guide
Research direction
Start by reproducing the behavior in the linked CodePen with C3 v0.4.23, focusing on the gauge chart's color_threshold configuration. Trace how that configuration is read when the chart is updated, then verify that changing the thresholds dynamically updates the gauge colors without recreating the chart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3, javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100