cancel
Showing results for 
Search instead for 
Did you mean: 

iChart onclick event chartselection refreshing itself.

Former Member
0 Kudos

Hi,

MII Version : 12.2.4 Build (92)

I have an iChart (Bar Chart) which displays the date wise production for the given period and has a selection event, which captures the date clicked and passes the same to the next chart for shiftwise production. but the problem is that the first applet displays correctly (date wise production) and then on selection of the day from the first applet, date is captured correctly and second applet (shift wise) displays correctly and at the same time the first applet (date wise production) applet refresh with current date time with no values.

I want to avoid the refresh of the first applet...

I am only refreshing the second applet and no action other than capturing of the selection point is done on the first applet.

Thanks in advance...

R. Prasanna

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

Can you share the syntax and events you are using?

Former Member
0 Kudos

Hi Jeremy,

Pl. find the syntax and events i am using for the iChart.

first Applet :

<APPLET NAME="ProdDtApplet" CODEBASE="/XMII/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="800" HEIGHT="400" MAYSCRIPT>

<PARAM NAME="QueryTemplate" VALUE="LPMES/Dashboard/Query Templates/Prod_DB_Date_Shiftwise_Prodn_Xcute" />

<PARAM NAME="DisplayTemplate" VALUE="LPMES/Dashboard/Display Templates/Prod_DB_Date_wise_Display" />

<PARAM NAME="InitialUpdate" VALUE="false">

<PARAM NAME="ChartSelectionEvent" VALUE="SelectDayBar" />

</APPLET>

Second Applet:

<APPLET NAME="shiftApplet" CODEBASE="/XMII/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="500" HEIGHT="400" MAYSCRIPT>

<PARAM NAME="QueryTemplate" VALUE="LPMES/Dashboard/Query Templates/Prod_DB_Shiftwise_Prodn_Xcute" />

<PARAM NAME="DisplayTemplate" VALUE="LPMES/Dashboard/Display Templates/Prod_DB_Shift_Wise_Chart_Display" />

<PARAM NAME="InitialUpdate" VALUE="false">

</APPLET>

The function SelectDayBar

var docProdDtShftApplet = document.shiftApplet;

var query_ProdDtShftApplet = docProdDtShftApplet.getQueryObject();

document.shiftApplet.getChartObject().setTitle("Shiftwise Prodn for selected date "+Bfdt);

query_ProdDtShftApplet.setParam(1,gsys);

query_ProdDtShftApplet.setParam(2,gmandt);

query_ProdDtShftApplet.setParam(3,garbpl);

query_ProdDtShftApplet.setParam(4,glang);

query_ProdDtShftApplet.setParam(5,Bparam5);

query_ProdDtShftApplet.setParam(6,Bparam6);

query_ProdDtShftApplet.setParam(7,"%");

document.shiftApplet.refresh();

R. Prasanna.

jcgood25
Active Contributor
0 Kudos

There is obviously more on the page and script because with both applets not having the initial update enabled I am wondering how you can click on a bar in the chart when is should not run the underlying query or display anything?

Perhaps consider isolating just the first applet on a test page to alert the event to make sure it is really only firing once per click in the bar.  You can also add the Trace PARAM in your applet tags with a value of true, then observe the information in the browser java console.

Former Member
0 Kudos

Hi Jeremy,

I do have a two date pickers for the from date and to date and then a display button, wherein on click of the button, i am calling function which would display the first chart with the production details.

Function btnApplyclick() {

var fdt = document.getElementById('fromdate').value;

var tdt = document.getElementById('todate').value;

var param5=fdt.substring(6)+"-"+fdt.substring(3,5)+"-"+fdt.substring(0,2) ;

var param6=tdt.substring(6)+"-"+tdt.substring(3,5)+"-"+tdt.substring(0,2) ;

var docProdDtApplet = document.ProdDtApplet;

var query_ProdDtApplet = docProdDtApplet.getQueryObject();

document.ProdDtApplet.getChartObject().setTitle("Production Data for Workcenter "+garbpl+" - "+document.getElementById("wctxt").value+" from "+fdt+" to "+tdt);

query_ProdDtApplet.setParam(1,gsys);

query_ProdDtApplet.setParam(2,gmandt);

query_ProdDtApplet.setParam(3,garbpl);

query_ProdDtApplet.setParam(4,glang);

query_ProdDtApplet.setParam(5,param5);

query_ProdDtApplet.setParam(6,param6);

query_ProdDtApplet.setParam(7,"%");

document.ProdDtApplet.updateChart(true);

}

On the suggestion in your reply for isolating the first applet and making sure it is firing only one per click and then observe the Trace for the applet. what i found was on clicking of the display button the first applet showing the chart correctly... and on selection of a bar in the chart showed the following error... but the second applet was showing the chart but the first one showed no values since it showed error in the java console, which is as under:

ProdDtApplet [ERROR] - No Data Available

This indicates that the first applet is getting refreshed on the chartselectionevent and trying to refresh the first applet with current period (system date and time) and hence returning the error No Data Avaialble.

Where as there is no refresh or update grid on the first applet.. only refresh is on the second applet based on the selection of the bar in the first applet.

Please find the debug log created on chartselectionevent, which is clearly indicating that an update on the first applet is called.

ProdDtApplet [DEBUG] - pressed pt: java.awt.Point[x=305,y=174]

ProdDtApplet [DEBUG] - FIRE_CUSTOM_EVENT SelectDayBar

ProdDtApplet [DEBUG] - Update Called

ProdDtApplet [DEBUG] - updating data handler..

ProdDtApplet [DEBUG] - BEGINNING QUERY EXECUTION

ProdDtApplet [ERROR] - No Data Available

ProdDtApplet [DEBUG] - dZoomMin: 0.0

ProdDtApplet [DEBUG] - dZoomMax: 100.0

ProdDtApplet [DEBUG] - dScaledMin (converted): 01/01/1970 01:00:00

ProdDtApplet [DEBUG] - dScaledMax (converted): 12/02/292269055 17:47:04

ProdDtApplet [DEBUG] - dZoomMin: 0.0

ProdDtApplet [DEBUG] - dZoomMax: 100.0

ProdDtApplet [DEBUG] - dScaledMin (converted): 01/01/1970 01:00:00

ProdDtApplet [DEBUG] - dScaledMax (converted): 12/02/292269055 17:47:04

ProdDtApplet [DEBUG] - dZoomMin: 0.0

ProdDtApplet [DEBUG] - dZoomMax: 100.0

ProdDtApplet [DEBUG] - dScaledMin (converted): 01/01/1970 01:00:00

ProdDtApplet [DEBUG] - dScaledMax (converted): 01/01/1970 01:00:14

ProdDtApplet [DEBUG] - dZoomMin: 0.0

ProdDtApplet [DEBUG] - dZoomMax: 100.0

ProdDtApplet [DEBUG] - dScaledMin (converted): 01/01/1970 01:00:00

ProdDtApplet [DEBUG] - dScaledMax (converted): 01/01/1970 01:00:00

R. Prasanna

Former Member
0 Kudos

I had the same problem with graphics chart line few time ago.

I have configurated in web page only this 2 parameters.

<PARAM NAME="QueryTemplate"

<PARAM NAME="DisplayTemplate"

1. Are you sending to first graph the parameters SD and ED from web page?.

2. How configured you parameters at Refresh page properties on workbech?

Regards.

Federico.-

Former Member
0 Kudos

Hi Federico,

I am using the setStartDate and setEndDate for passing the from and to dates from the web page to the Xcute query. and with regard to the refresh page properties on work bench

all the check boxes like Allow Automatic Refresh, Automatically Refresh and initial update are set to false.

Further, I am observing that the on chartselectionevent there is an update event called on itself, as it can been seen in the console when debug is enabled for the applet.

ProdDtApplet [DEBUG] - pressed pt: java.awt.Point[x=197,y=205]

ProdDtApplet [DEBUG] - FIRE_CUSTOM_EVENT SelectDayBar

ProdDtApplet [DEBUG] - Update Called

ProdDtApplet [DEBUG] - updating data handler..

ProdDtApplet [DEBUG] - BEGINNING QUERY EXECUTION

I have not enabled the autorefresh nor i am refreshing the applet second time... it is calling on update on selection of the bar in the chart.

R. Prasanna

Former Member
0 Kudos

I had the same problem, in my case, initial update was enable, and the first pair of SD and ED was taken from hardcode from workbench, but, when i send SD and ED from the web page, the graph was coming down in white.

My case: was sent wrong The date format SD and ED from the page to the query.

( remember: this graph need time stamp date format )

I hope it helps

Federico.-

jcgood25
Active Contributor
0 Kudos

If you are using a time based query, using the mapped dates and .setStartDate .setEndDate methods then make sure you use .updateChart(true) or .updateGrid(true) in your JavaScript.  Using the .refresh method will overwrite your dates and update to the current 60 minutes (or whatever your duration for the query looks like).

I actually think you can see mention about this common issue in the help.

If the updateevent is truly being called from inside the activities of the chart selection event (and not because of any of your code) then it sounds like you might have a bug and should probably log a support ticket.

Former Member
0 Kudos

Thanks Jeremy,

I think there is a bug which is triggering update when ever i select the chart (chartselection event). This was not the case earlier in 12.0 or 11.5. So i will raise a support ticket.

Thanks for all the help.

R. Prasanna

Answers (0)