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

Percentage width/height and horizontal/vertical alignment #19

Closed
YasserHassan opened this issue May 19, 2015 · 5 comments
Closed

Percentage width/height and horizontal/vertical alignment #19

YasserHassan opened this issue May 19, 2015 · 5 comments

Comments

@YasserHassan
Copy link

I am suggesting adding an option to specify the width and height as percentage (e.g. 50%) which would be good for responsive design. This could be achieved either via new options or using the current width and height by providing strings such as "50%".

A good feature to go with it is the ability to align the chart horizontally and vertically for both pixel and percentage-based dimension such as:

  • hAlign: right|center|left.
  • vAlign: top|center|bottom.
@jakezatecky
Copy link
Owner

jakezatecky commented May 20, 2015

While this would be a relatively useful option, it is also very possible to achieve these effects using just CSS and some markup (e.g. with a table or flex display). See this example where the funnel's container is aligned bottom, with a percentage width. Obviously, this is a bit more cumbersome than if it would be supported within the funnel chart itself.

@YasserHassan
Copy link
Author

By cumbersome, do you mean it would affect the performance or it would take a lot of work? I'm asking to know if it would be accepted if implemented by myself or another contributor in the future.

@jakezatecky
Copy link
Owner

I meant that the CSS/markup solution is a bit more cumbersome. Adding this feature in the chart will barely affect performance.

I would accept a pull request that would add these features.

@YasserHassan
Copy link
Author

That'd be good @jakezatecky. The more the component is independent and covering more situations out of the box the better.

@jakezatecky
Copy link
Owner

Support added for percentage-based widths/heights.

Since horizontal/vertical alignment is pretty easy with CSS and I rather not have any inline-CSS or stylesheets, I will leave it to the developer to horizontally/vertically align the chart's container.

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

No branches or pull requests

2 participants