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

Add example of difference bar chart #990

Merged
merged 2 commits into from Oct 5, 2018

Conversation

mcnuttandrew
Copy link
Contributor

This PR answers a question @alee8 asked me via email about how to make this type of chart.

screen shot 2018-10-04 at 9 59 57 am

Copy link
Contributor

@alee8 alee8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the example.

(Optional)
Type (VerticalBarSeries): `number`
Type (HorizontalBarSeries): `string|number`
The y0 position in coordinates of the box to be used, this is where the bottom of the bar is placed, defaults to zero. Use is not recommended with stacked bars. For VerticalBarSeries this value is considered a number, and is scaled against it's domain into pixels.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a very useful tidbit. I assume if one wanted to do DifferenceHorizontalBar, one sets x and x0 in a similar manner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that's just right!

buttonContent={content}
/>
<XYPlot
xType="time"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been several years since I had a look at the API. xType, colorType are something new and appear (in scan of the repo) in many various places. What does it mean to use it here in an XYPlot? By inference, xType, describes the type of the x values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that's exactly it, check out https://uber.github.io/react-vis/documentation/general-principles/scales-and-data for a fuller description

@mcnuttandrew mcnuttandrew merged commit 2f945c8 into uber:master Oct 5, 2018
ayarcohaila pushed a commit to ayarcohaila/react-vis that referenced this pull request Jun 30, 2021
* Add example of difference bar chart

* use non temporal data to fix test
ayarcohaila added a commit to ayarcohaila/react-vis that referenced this pull request May 30, 2023
* Add example of difference bar chart

* use non temporal data to fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants