MarcusCalidus / marcuscalidus-svg-panel

Grafana panel for displaying metric sensitive SVG images using the snap svg library
MIT License
62 stars 28 forks source link

A possible DUMB question: How to make a resizable SVG panel?? #64

Open bgondell opened 2 years ago

bgondell commented 2 years ago

I'm pretty new on the SVG world, but I learn fast.

I made some SVG images with Inkscape, but I can't underestand still how to made them rezisables to grafana panel size. Tried to change the width, height and viewBox values on the SVG editor without success.

Can anyone help me with this possible dumb problem?

I attached the SVG file that I simply copy&paste into Grafana SVG data.

Many thanks in advance!!

258 - Control Molino - CLEAN.zip

MarcusCalidus commented 2 years ago

could you please try those suggestions? https://stackoverflow.com/questions/19484707/how-can-i-make-an-svg-scale-with-its-parent-container I am currently not anywhere near a device where I can test.

bgondell commented 2 years ago

Was a kind of play and test, but finally managed to do some kind of scaling.

width="100%" height="100%" viewBox="0 0 180 150"

And play with viewBox values to scale and center the svg to the panel.

But I'm afraid this will not have the same effect on different devices. I'll update with more info!