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

[Feature] Support drawing the horizontal bar chart #40

Merged
merged 34 commits into from
Sep 9, 2019

Conversation

hsunpei
Copy link
Contributor

@hsunpei hsunpei commented Jul 23, 2019

Purpose

Previously, we can only draw vertical bar charts. Since horizontal bar charts are particularly useful on mobile devices, it is desirable to have it supported.

This PR realize drawing the horizontal bar chart by analyzing the data types of the X and Y axis: if the data type of the x-axis is quantitative, it should draw a horizontal chart, and draw the bars from the y-axis instead (via passing down the prop drawFromXAxis={false}).

Transchart 2019-07-23 16-43-56

Additionally, to make the charts which have both positive and negative value on the quantitative axis more readable, it adds a gray auxiliary line at zero-value.

Changes

  • Support drawing the horizontal bar chart
  • Add a gray auxiliary line at zero-value
  • Disable tslint on the length of the comments
  • Disable the checkings of unused variables on development

Screenshots

Horizontal chart

Transchart 2019-07-23 16-56-33

Original vertical chart => Transposed horizontal chart

  • Original vertical chart
    Transchart 2019-07-23 16-42-10

  • Transposed horizontal chart
    Transchart 2019-07-23 16-43-56

Displaying tooltips

screencast 2019-07-23 17-30-00

@hsunpei hsunpei requested review from tz5514 and zhusee2 July 23, 2019 09:48
@hsunpei hsunpei self-assigned this Jul 23, 2019
Copy link
Contributor

@zhusee2 zhusee2 left a comment

Choose a reason for hiding this comment

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

Looks great to me! ✨

@zhusee2 zhusee2 merged commit 9eb7c32 into develop Sep 9, 2019
@zhusee2 zhusee2 deleted the feature/barchart-horizontal branch September 9, 2019 10:21
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.

2 participants