0

My SCADA widgets display correctly in Chrome and Firefox, but not in Internet Explorer (I tried IE 11). Maybe this is a general IE/.svg problem, or maybe I got something wrong, here is an extract from my .svg:

...
<g
    id="layer1-1-7"
    inkscape:label="Layer 1"
    transform="translate(90.285715,99.790733)">
    <!--{{state1}}-->
    <rect ... ng-class="{spotFree: state1=='free', spotOccupied: state1!='free'}" ... />
    ...
</g>
...
<style
    id="style3348"
    type="text/css">
    .spotOccupied {
        fill:#ff0000;
    }
    .spotFree {
        fill:#00ff00;
    }
</style>
...

So, really just a rectangle that's supposed to change color depending on the value of a property, which a link to the property of one of my devices. Works on Chrome/FF, but in IE, no style is applied at all (rectengle is black and doesn't change with the state of the prop). Is there something more/different I should do?

Gaetan L.
  • 649
  • 6
  • 20

2 Answers2

1

It seems that's an issue of IE - it doesn't process <style> tags in added dynamically. The issue is discussed e.g. here in general and here in the context of SVG. SVG files in SCADA widget are inserted dynamically so they are affected. You can check that if you execute the following JavaScript code (taken from the second link) in the console of IE11 with your dashboard open the colors will appear on SVG.

_.each(document.querySelectorAll('style'), function (s) {
  s.textContent += '';
});

I don't see a good workaround at the moment. Temporarily you could assign fill property directly with ng-style for each element but it duplicates code obviously. I think you can raise a ticket to Cumulocity to improve SCADA widget so that it triggers evaluation of <style> tags inside inserted SVG file.

Community
  • 1
  • 1
0

I checked with our own SCADA widgets here at Cumulocity if they work fine. Those are working on IE11. So I cannot confirm, that there is an general SCADA widget problem with IE11.

  • please don't solve question in private messsages, the aim of QA is to help everyone who visits this site - edit the questions/answers regardingly or use comments if clarification or additional information is needed – Florian Koch Jul 21 '16 at 14:26
  • 1
    I changed to answer. Now I am just answering the part regarding the general problem with SCADA widgets in IE11. Also I removed the part with my suggestion. Hope the edited answer fits better in the guideline. – Michael Welsing Jul 21 '16 at 15:29
  • Thanks for your answer Michael, I followed my question to support. Florian I'll come back here to post the solution once we find it. – Gaetan L. Jul 26 '16 at 07:18