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

Shape line Diagonal #75

Closed
vanekar opened this issue Apr 12, 2017 · 2 comments
Closed

Shape line Diagonal #75

vanekar opened this issue Apr 12, 2017 · 2 comments
Assignees

Comments

@vanekar
Copy link

vanekar commented Apr 12, 2017

Hello

Thanks for the beautiful control, is there an option to draw a line diagonally.

Regards
Anwar

@ZouhaierSebri
Copy link

ZouhaierSebri commented Apr 12, 2017

Hi @vanekar ,
var pptx = new PptxGenJS();
pptx.setLayout('LAYOUT_WIDE');

var slide = pptx.addNewSlide();

// Misc Shapes
slide.addShape(pptx.shapes.LINE, { x:0, y:0, w:13.33, h:7.5, line:'FF0000'});

pptx.save('Demo-Shapes');

and you will get

image

to get the right x,y,h,w you can adjust the line manually in your pptx document then use 'Size and Position'
image

@gitbrent gitbrent self-assigned this Apr 12, 2017
@gitbrent
Copy link
Owner

I've added "Diagonal Line" to the README and the demo.

You can draw a box as shown above and plot a line between the corners, or draw an actual line and rotate it:

slide.addShape(pptx.shapes.LINE, { x:0, y:0, w:5.0, h:0, line:'FF0000', rotate:45 });

gitbrent pushed a commit that referenced this issue Apr 30, 2017
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

3 participants