cancel
Showing results for 
Search instead for 
Did you mean: 

place datalinks in the title of a chart

Former Member
0 Kudos

I have a chart that I would like to take the datalink value of an iBrowser and stick it in the chart's title.

<param name="Title" value="Line {<b>LINE</b>} Shift Percent Uptime">

I know the above doesn't work because it does not know where to look for it, but I tried placing the below javascript in between the {} brackets and it comes up blank on the screen. This tells me it is able to put something there, but what I have it not correct.

This is the correct syntax for extract the Line value from the iBrowser.

<b>document.Line.getBrowserObject().getSelectedDatalinkValue()</b>

What should I do?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use:

document.yourChartApplet.getChartObject().setTitle("Line " + document.Line.getBrowserObject().getSelectedDatalinkValue() + " Shift Percent Uptime");

document.yourChartApplet.updateChart(false);

- Rick

Former Member
0 Kudos

Here is what I have so far. I have three charts on one web page which the top chart has a time refresh control that updates the other two charts. I also have an iBrowser that allows the user to pick a line and click the GO button to update all three charts. The problem I am seeing with your title creation you helped me on is when the charts are created and when the charts get updated. When the charts get created all three charts show the default line in the title. So no problem here. Once I select a line and click GO, only charts 2 and 3 actually get updated. The reason for this is when I create the charts, I am actually updating the title in chart 1 which then triggers the UpdateEvent. This then throws it in a loop. So I guess the question is please review my functions below and tell me how I can update the first chart without the endless loop?

Thanks!!

function UpdateDetails()

{

FR_Runtime_DailyHistory.getQueryObject().setStartDate(FR_Runtime_ShiftHistory.getQueryObject().getStartDate());

FR_Runtime_DailyHistory.getQueryObject().setEndDate(FR_Runtime_ShiftHistory.getQueryObject().getEndDate());

//FR_Runtime_DailyHistory.updateChart(true);

FR_Runtime_WeeklyHistory.getQueryObject().setStartDate(FR_Runtime_ShiftHistory.getQueryObject().getStartDate());

FR_Runtime_WeeklyHistory.getQueryObject().setEndDate(FR_Runtime_ShiftHistory.getQueryObject().getEndDate());

//FR_Runtime_WeeklyHistory.updateChart(true);

document.FR_Runtime_ShiftHistory.getChartObject().setTitle("Line " + document.Line.getBrowserObject().getSelectedDatalinkValue() + " Shift Percent Uptime");

document.FR_Runtime_DailyHistory.getChartObject().setTitle("Line " + document.Line.getBrowserObject().getSelectedDatalinkValue() + " Daily Percent Uptime");

document.FR_Runtime_WeeklyHistory.getChartObject().setTitle("Line " + document.Line.getBrowserObject().getSelectedDatalinkValue() + " Weekly Percent Uptime");

<b> //document.FR_Runtime_ShiftHistory.refresh(); LOOPS

//document.FR_Runtime_ShiftHistory.updateChart(true); LOOPS</b>

document.FR_Runtime_DailyHistory.updateChart(true);

document.FR_Runtime_WeeklyHistory.updateChart(true);

}

function changeTitle()

{

document.FR_Runtime_ShiftHistory.getChartObject().setTitle("Line " + document.Line.getBrowserObject().getSelectedDatalinkValue() + " Shift Percent Uptime");

document.FR_Runtime_DailyHistory.getChartObject().setTitle("Line " + document.Line.getBrowserObject().getSelectedDatalinkValue() + " Daily Percent Uptime");

document.FR_Runtime_WeeklyHistory.getChartObject().setTitle("Line " + document.Line.getBrowserObject().getSelectedDatalinkValue() + " Weekly Percent Uptime");

document.FR_Runtime_ShiftHistory.updateChart(true);

document.FR_Runtime_DailyHistory.updateChart(true);

document.FR_Runtime_WeeklyHistory.updateChart(true);

}

<u><b>FR_Runtime_ShiftHistory Applet</b></u>

<param name="UpdateEvent" value="UpdateDetails">

<param name="CreationEvent" value="changeTitle">

Former Member
0 Kudos

I didn't look through this completely, but if the updateChart(true) on the FR_Runtime_ShiftHistory applet causes a loop, try doing this:


document.FR_Runtime_ShiftHistory.setUpdateEventEnabled(false); //turn off update event
document.FR_Runtime_ShiftHistory.updateChart(true); //update chart
document.FR_Runtime_ShiftHistory.setUpdateEventEnabled(true); //turn update event back on

Answers (3)

Answers (3)

Former Member
0 Kudos

Actually, you should not call updateChart(true) unless you need to re-retrieve the back end data. In this case, you should call updateChart(false) (since you are only changing "appearance" properties). In general, if you're not changing query parameters or data binding parameters, you don't need to call updateChart(true).

- Rick

Former Member
0 Kudos

Adding a follow up question

jamie_cawley
Advisor
Advisor
0 Kudos

If it is on the same page then you could do something like

document.iChart.getChartObject().setTitle(document.iBrowser.getBrowserObject().getSelectedDatalinkValue());

document.iChart.updateChart(false);

if it is on a page you are opening then on the opener page use

document.iChart.setPropertyValue("mytitle",.iBrowser.getBrowserObject().getSelectedDatalinkValue());

and then on the opened page

<param name="Title" value="">

Regards,

Jamie