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

HorizontalBarSeries does not render correctly #184

Closed
nbryant opened this issue Nov 22, 2016 · 3 comments
Closed

HorizontalBarSeries does not render correctly #184

nbryant opened this issue Nov 22, 2016 · 3 comments
Labels

Comments

@nbryant
Copy link

nbryant commented Nov 22, 2016

Given a typical horizontal bar chart setup:

<XYPlot
  height={height}
  width={width}
  yType="ordinal"
>
  <XAxis />
  <YAxis />
  <HorizontalBarSeries
    color="steelblue"
    data={[
      { x: 4, y: 'A' },
      { x: 5, y: 'B' },
      { x: 3, y: 'C' },
   ]}
  />
</XYPlot>

The chart and axes render, but the bars do not. This error is in the console: DOMPropertyOperations.js:142 Error: <rect> attribute height: A negative value is not valid. ("-99.16666666666669").

It appears that the <rect>'s y and height attributes are not being computed correctly.

FWIW, manually reversing the y-axis domain will solve this problem:

<XYPlot
  height={height}
  width={width}
  yType="ordinal"
  // manually reverse the y-axis range
  // subtract top and bottom margins
  yRange={[-10, height - 40]}
>
@danhipke
Copy link
Contributor

@nbryant I ran into this issue too and the fix is in the master branch.

@nbryant
Copy link
Author

nbryant commented Mar 21, 2017

nice! not sure when I'll have time to confirm, but the fix is much appreciated.

@mcnuttandrew
Copy link
Contributor

This should now be fixed in v1.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants