我在 spotfire 文本区域中有一个小的 javascript。它按设计工作。我保存并关闭了spotfire。重新打开时根本不显示。我的代码如下。任何帮助,将不胜感激。
resource = [
"//cdn.rawgit.com/toorshia/justgage/master/raphael-2.1.4.min.js",
"//cdnjs.cloudflare.com/ajax/libs/justgage/1.2.8/justgage.js"
]
//add scripts to head
$.getScript(resource[0], function() {
$.getScript(resource[1], init)
})
var init = function() {
var g = new JustGage({
id: "gauge",
min: 0,
max: 100,
customSectors: [{
"lo": 0,
"hi": 89.999,
"color": "#f05050"
},
{
"lo": 90,
"hi": 92.999,
"color": "#DD7502"
},
{
"lo": 93,
"hi": 100,
"color": "#41c572"
}
],
levelColorsGradient: false
});
//refresh gauge when calcvalue changes
$(calcValue).on('DOMSubtreeModified', function() {
g.refresh($(this).text())
})
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span id=calcValue><SpotfireControl id="3321e4c9003142ad83fdb753e6f66605" />
</span>
<DIV id=gauge></DIV>