Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should render no data with no defined series #884

Closed
nickofthyme opened this issue Oct 30, 2020 · 1 comment · Fixed by #936
Closed

Should render no data with no defined series #884

nickofthyme opened this issue Oct 30, 2020 · 1 comment · Fixed by #936
Assignees
Labels
:data Data/series/scales related issue enhancement New feature or request

Comments

@nickofthyme
Copy link
Collaborator

nickofthyme commented Oct 30, 2020

Is your feature request related to a problem? Please describe.
Some implementations might desire the ability to only add series to the chart when data exists. For example, in the snippet below, if data is an empty array a blank chart will be rendered. Instead of rendering a blank chart we should render the no data ui.

{data.map((d) => (
  <BarSeries
    id="bars"
    name="amount"
    xScaleType={ScaleType.Ordinal}
    xAccessor="x"
    yAccessors={["y"]}
    data={d}
  />
))}

Note: the empty chart only occurs when there is an Axis specified.

See https://codesandbox.io/s/wonderful-cannon-2yf9e?file=/src/App.tsx

Describe the solution you'd like
Show no data ui when there is are no series listed in the chart

Describe alternatives you've considered
Pass empty data to one of the series.

@nickofthyme nickofthyme added enhancement New feature or request :data Data/series/scales related issue labels Oct 30, 2020
@nickofthyme nickofthyme self-assigned this Nov 11, 2020
@nickofthyme
Copy link
Collaborator Author

Closed by #936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:data Data/series/scales related issue enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant