areski / django-nvd3

Django wrapper for nvd3 - It's time for beautiful charts
Other
416 stars 124 forks source link

Ability to omit width and height #32

Closed jnishiyama closed 9 years ago

jnishiyama commented 10 years ago

I think that it should be possible to omit at least width from the template tag, without it defaulting to a value. As far as I know, if height and width are set on the svg element, the nv resize utility function doesn't do anything.

jnishiyama commented 10 years ago

In fact, after second inspection, simply by changing line 80 in nvd3_tags.py: from def include_container(include_container, height=400, width=600): to def include_container(include_container, height=400, width=None):

We can omit width in the template tag, and the resize kwarg works.

areski commented 9 years ago

you can omit both height and or width, the following work {% include_container chartcontainer %}