Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I link a CSS stylesheet in a Spotfire analysis?

I can create a Javascript in Spotfire page however I have no idea how to add CSS files.

Any suggestion please?

like image 598
beewest Avatar asked Sep 19 '25 19:09

beewest


1 Answers

this is not approved by Spotfire engineering, but you can inject a CSS that is hosted somewhere accessible to the machine running Spotfire (so, your local machine or a web player node) with JQuery:

$('head').append('<link rel="stylesheet" href="path/to/stylesheet.css" type="text/css" />');

so just put that into a JS inside a Text Area and voila!

one thing to note is that the file will be cached, you may want to update the code like:

var t = Date.now();
$('head').append('<link rel="stylesheet" href="style2.css?t=' + t + '" type="text/css" />');

this will append the current timestamp to the URL of the stylesheet ensuring you get a fresh copy every time. it's advised to do this only until you're done modifying the CSS.

like image 112
niko Avatar answered Sep 22 '25 08:09

niko