How to constrain svg width / height in pygal

How do I constrain the SVG width / height pygal

? I am currently doing this with tags img

, but is there a better way?

<img src="http://localhost/images/Store.Diapers.svg" width=800 height=600/>

      

+3


source to share


2 answers


In case it helps someone, it's as easy as specifying width = 1000, height = 800 in the parameters:



chart = pygal.StackedLine(width=1000, height=800)

      

+3


source


You can use a div for this ....

In the code, enter the following:

<div class="parent">    
   <img src="http://localhost/images/Store.Diapers.svg">    
</div>    

      



And put this in your .css file

.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;
}

      

+1


source







All Articles