Skip to content

Commit

Permalink
Update auto-resize function for responsive (pyecharts#1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
paduel authored Apr 24, 2020
1 parent 973c982 commit 3cafa13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyecharts/render/templates/macro
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
{% endfor %}
{% endif %}
{% endif %}
{% if c.width.endswith('%') %}
window.addEventListener('resize', function(){
chart_{{ c.chart_id }}.resize();
})
{% endif %}
</script>
{%- endmacro %}

Expand Down

0 comments on commit 3cafa13

Please sign in to comment.