Skip to content

[color-chart] How should a chart look if the underlying <color-scale> has only one color? #128

@DmitrySharabin

Description

@DmitrySharabin

For now, it throws because the getAxis() function 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.

image

We can probably do something similar (for the range of X).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions