Skip to content

Auto-Resize Images in Spotfire

In Spotfire, in a text area, it is possible to place pictures. And you can even choose to either place the picture as a background image or as a regular image. Great…. but there is just one tiny issue. The pictures do not size with the box they are in, and do not size when switching to another screen resolution. So quite often I created pretty solutions with beautiful pictures in them, just to get a message from test users indicating that the logo I put in the solution was only half visible and had scroll bars.


So, time to find a workaround! And to be honest there is no 100% solution, but I did find a way to make it work better. Let’s look at an example. In this solution I added a text area with a picture.

Notice that the picture is too high and not wide enough to fit into the text area. But even if you would resize the text area to fit the picture it would not resize properly on a mobile device or a laptop screen.

Now, in the Spotfire text box, it is possible to use HTML. So what I will do is place a small snippet of HTML in my text box, that creates a table with one row, and one cell. And my image goes into this one cell. Initially (example above), the HTML in my text box looks like this. But now I will add my table stuff in, and it will look like this:

<table style=”width:100%”>


   <td><IMG src=”fa44c17702444313a68ecc9bda6e30a5.png” border=0 width=”100%” height=”auto”> </td>




This little bit of script will maximize the width of our picture and set the height to be relative to the width. The result looks like this:

Of course we can set both width and height to auto but that will deform the picture. But at this point, we can resize the text area to correctly contain this picture, and it will more or less be consistent when opening the solution on another size screen:

All together, this solution can bring what you are looking for. No guarantees, but the chance is that it will be better than before.

Need help with Spotfire?

Devoteam has extensive knowledge in Data Visualization technologies such as Spotfire, based on years of experience in transforming well-known organizations to (well-known) data-driven organizations. If you need any additional help with Spotfire or any other data technology, reach out to me via my contact details in the author-section at the bottom of the page.

More about our TIBCO Spotfire Knowledge

Want to learn more about Spotfire through our client use cases, handy how-to articles and blog-posts? Click the button below to discover our knowledge.