【发布时间】:2015-01-11 00:48:39
【问题描述】:
如何限制pygal 生成的 SVG 的宽度/高度?我目前是通过img标签来做的,但是有没有更好的方法?
<img src="http://localhost/images/Store.Diapers.svg" width=800 height=600/>
【问题讨论】:
如何限制pygal 生成的 SVG 的宽度/高度?我目前是通过img标签来做的,但是有没有更好的方法?
<img src="http://localhost/images/Store.Diapers.svg" width=800 height=600/>
【问题讨论】:
如果对某人有帮助,只需在参数中指定 width=1000, height=800 即可:
chart = pygal.StackedLine(width=1000, height=800)
【讨论】:
您可以为此使用 div....
将以下内容放入您的代码中:
<div class="parent">
<img src="http://localhost/images/Store.Diapers.svg">
</div>
并将其放入您的 .css 文件中
.imagebox {
width: 42px; /*This is the height of the div class it self */
height: 42px;
}
/* This changes the height of any image with the <img> tag within the div class*/
.imagebox img {
height: 800px;
width: 600px;
}
【讨论】: