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

Set width and height values in px? #56

Closed
alagarrk opened this issue Mar 15, 2017 · 4 comments
Closed

Set width and height values in px? #56

alagarrk opened this issue Mar 15, 2017 · 4 comments
Assignees

Comments

@alagarrk
Copy link

Currently i am trying to export the chart from our app to ppt using PptxGenJS. I am getting px values for all the elements, so how can i set the values (width and height) in px(units) to draw any shapes in PptxGenJS?

If we can't set px in PptxGenJS, do you have any idea that how to convert px to inch/percentage which can be use in PptxGenJS?

Can you please give some suggestion on this. Thanks in advance.

@gitbrent
Copy link
Owner

Hi @alagarrk ,

Thanks for the question.

A good rule of thumb is 100 px = 1 inch as modern LCD displays are mostly 96px/inch.

You can also pass x,y,w,h and colW percentage values, so it may be easier to just honor the layout you have now. For example, create a table that is 100% wide and has 3 columns, 25%/25%/50%, that way no pixel conversion is necessary.

Or you could be super fancy and measure the innerWidth of an HTML element relative to its window.size and then use that same percent as arguments to the library...

@gitbrent gitbrent self-assigned this Mar 16, 2017
@alagarrk
Copy link
Author

@gitbrent Thank you for the solution. Now its works fine 👍

Currently we can able to export the basic primitives chart [http:// basicprimitives.com/index.php] to PPT using PptxGenJS (Shapes). But the problem is we have generated chart as shapes(rect & lines), all are separate elements. If user wants to change/move the parent/child node, they need to move the relative shapes(lines & arrows).

Now i am trying to add smartArt(Organisation Chart) in powerpoint to generate the chart.
Is it possible to add the smartArt Graphics and show hierarchical information or reporting relationships in an organization.?
Ex:
samplediagram

@gitbrent
Copy link
Owner

Hi @alagarrk ,

I'm very glad to hear you were successful!

SmartArt isn't something i was planning on supporting, but Charts are coming soon... :-)

@alagarrk
Copy link
Author

Ok @gitbrent Thank you very much for your support.

Do you have any idea, how to add hierarchical chart in powerpoint using PptxGenJS. If you give some suggestion/idea it will very helpful for me to implement this.

Thanks in advance.

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