[color-chart] How should a chart look if the underlying `<color-scale>` has only one color?
- Dominant language
- JavaScript
- Stars
- 30
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
For now, it throws because [the `getAxis()` function](https://github.com/color-js/elements/blob/5cf02760b3a971173d29cc7989c74b41548c167d/src/color-chart/color-chart.js#L218-L241) returns `NaN` for `min`, `max`, and `steps` when calculating the corresponding props for the X-axis.
I checked what Excel does when it gets only one data point. It looks like Excel calculates the range based on an ”assumption“ that the chart should look nice. If I understand correctly, it uses 1 as the X coord (if not explicitly specified). I suggest that the one data point will never be outside the range.

We can probably do something similar (for the range of X).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.