SAP UI5 VIZ charts in Chrome

I was preparing a demo showing how to visualize data from an IoT service using SAP UI5 VisFrame charts. To play around with VizFrame, I used the sample from SAPUI5 SDK. It was working perfectly on the online version, but while running the UI5 app and Chrome, I got an error message.

Googling for the error message revealed that with Chrome 50 a known error exists which makes it impossible to use a VizFrame chart. Luckily I found the solution on SCN. All it takes is to implement the function as a prototype and the chart will work.

SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(elem) { return elem.getScreenCTM().inverse().multiply(this.getScreenCTM()); };

I`ve put the code in my views controller init() function:

onInit : function (evt) {
  SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(elem) { return elem.getScreenCTM().inverse().multiply(this.getScreenCTM()); };
  oVizFrame = this.oVizFrame = this.getView().byId("idVizFrame");

Result

Now, this works magically when I access the online SDK, but is broken when using it locally. I guess SAP did some magic either in the SDK or in the UI5 library that my SAPUI5 version does not include. Either way, the above trick solves the problem.

Let the world know

NWBC logon error with IE 10

Today I came across a strange error when logging in to NWBC, or to be accurate, trying to log on to NWBC. The IE developer toolbar showed me that the JS failed, caused by an error message: “The system cannot find the path specified”. This error only occurred with Internet Explorer. Clicking the error message revealed that the error occurred in the lightspeed.js file. The highlighted JS command was window.localStorage. Entering window.localStorage at the command line gave me the same error message: “The system cannot find the path specified”.

  • Root cause found!

It’s an enterprise controlled environment, so updating IE is not possible and even with Microsoft slowly killing IE, it will be around longer than you might think. Therefore, this error needs to be solved immediately. First action I did was to clear the cache, restarting IE and still: same result.

Next was to ensure that the security permissions allow window.localStorage. Internet Explorer Options -> Advanced -> Security section -> Enable DOM Storage

The option is activated, so window.localStorage should work. After googling a little bit around, I found a blog describing the same error. And with a solution! When deleting IE data, it is important to delesect the option “Preserve Favorites website data“.

After restarting IE, calling window.localStorage returned:

Now NWBC logon works again!

Let the world know