1

I am new to angular js. I am dealing with SVG which is taking fixed width and height. Because of this I am unable to make a responsive graph application. Can anyone tell me some methods in angular which helps me in getting through this error. thank You.....

2 Answers 2

1

You cal use AngularJS service $window and check for the resize event. Whenever any resize window event occurs , the function binded to the resize event will fire up and you can then redraw the graph. I solved my problem using this. Hop this works for you also....

Sign up to request clarification or add additional context in comments.

1 Comment

yeah it worked for me in a sample code but why doesn't SVG accept width and hright in percentages. BDW thank you...
1

You can use the viewbox in SVG to scale the image if that's what you're looking for. That way the contents always fit withing the SVG area even if it's scaled down or up. Here's an example: http://plnkr.co/edit/w2uOb9TSf8LWBAWyDdGm?p=preview

Use the button in the top right of the preview to open it in a new window, then you can see how scaling the window larger and smaller scales the contents of the SVG area. For some more details on the viewbox and how it works take a look here: http://tutorials.jenkov.com/svg/svg-viewport-view-box.html

1 Comment

Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Please edit the post and update the answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.