cancel
Showing results for 
Search instead for 
Did you mean: 

i5SPCChart loading event ?

Momen_Allouh
Advisor
Advisor
0 Kudos

I use the following to add i5chart to my sapui5 page in MII :

  • var i5SPC = new com.sap.xmii.chart.hchart.i5SPCChart("<Display Template>", "<Query Template>");
  • i5SPC.setChartWidth("640px");
  • i5SPC.setChartHeight("400px");

but the sapui5 app freez for one min until the i5chart is loaded, is there any load event for the i5spc chart so that I can use the busy loading indicator for the page and when the i5spc loaded I will stop the busy loading ?

Accepted Solutions (1)

Accepted Solutions (1)

former_member185280
Active Contributor
0 Kudos

According to the help docs there are some events available you may be able to use:

i5spc chart events

Regards,
Christian

Momen_Allouh
Advisor
Advisor
0 Kudos

Do you know how can i use the events in my js code ? is it same as

  • i5SPC.setChartWidth("640px");
saivellanki
Active Contributor
0 Kudos

Hi Momen,

Yes, you could try something like this:


i5SPC.registerCreationEventHandler(function(oEvent){

//your logic

});

Regards,

Sai Vellanki.

Momen_Allouh
Advisor
Advisor
0 Kudos

It is not working, I am getting:

Uncaught TypeError: i5SPC.registerEventUpdateHandler is not a function

this is my code:

i5SPC.registerEventUpdateHandler(function(oEvent) {

     console.log("test", oEvent);

});

Is there any doc or example for how to use these events / methods for SPC charts ?

saivellanki
Active Contributor
0 Kudos

Hi Momen,

It should be:


i5SPC.registerUpdateEventHandler(function(oEvent){

console.log("test", oEvent);

});

In document, the method was mentioned wrong. Even I tried registerEventUpdateHandler, but it didn't worked. I tried to debug and actual method is registerUpdateEventHandler. Now, it works fine for me.

Check this snippet for more info:

I request SAP team (   /  ) to update the document i5SPCChart Events - SAP Manufacturing Integration and Intelligence - SAP Library. Thank you!

Regards,

Sai Vellanki.

Private_Member_14935
Active Participant
0 Kudos

Hi Sai,

Thanks for bringing this to our notice. We'll get this updated.

Best Regards,

Ria

Momen_Allouh
Advisor
Advisor
0 Kudos

Yes now it works and I don't see the error,

but I can't get any log msg from console anymore ?!

So I can't see the oEvent log from below:

console.log("test", oEvent);

And  the console also stop logging anything from any other functions I have.

I noticed this log msg that appear first from i5chart then after that no log msg appears:


Script console debug logs(INFO/LOG level) allowed: false

then I will get the following errors which has no effect on the chart or the sapui5 app:

Any idea about how to get the console log ? is there a way to change the debug to true ?

Private_Member_14935
Active Participant
0 Kudos

Hi Momen,

The log level console messages are disabled by i5SPCChart js library. You could however turn on the log messages by toggling the flag which controls this by using the below line of code:

com.sap.xmii.common.util.DEBUG_MODE_ON = true;

This line should be called before the i5SPCChart constructor call.

Alternatively, you could also use console.debug if it suffices.

Thanks and Best Regards,

Ria

Momen_Allouh
Advisor
Advisor
0 Kudos

I see why you turn it off by default because lot of logs msg from the js lib loaded for i5spc chart.

I used the console.debug() and it works, more clean and will logs what I need.

Private_Member_14935
Active Participant
0 Kudos

Perfect..

Answers (0)