Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic Markerline in chart
AlanC
I am trying to change a markerline and its associated label according to a parameter input to the report.
In the onRender script for the chart, I used the following code:
function beforeDrawMarkerLine( axis, markerLine, icsc )
{
if (icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("myPCT") == 'abc') {
var booger = markerLine.getValue();
booger.value = 2500;
markerLine.setValue(booger);
markerline.getLabel().getCaption().setValue("Target 2500")
}
}
When the condition is met (i.e. myPCT == abc), I get an Exception window (message: "Report service exception (Information Console render report error.)."
If I remove the label from the markerline (in the design) and then remove the markerline.getLabel()... statement from the code above, the report works OK and the markerline value is changed.
Is there something obvious I'm missing?
I'm using version 2.3.2v20081204-1200 of BIRT and version 3.4.1 of the Exclipse Platform.
Find more posts tagged with
Comments
mwilliams
Hi AlanC,
Can you recreate this issue with the sample database?
AlanC
Hi Michael
I've managed to recreate it using the sample database, in a slightly different form.
In this example, the Markerline is defaulted on the chart to be 200000. When the report is run, this is over-written in the code, to be 100000.
If I "uncomment" the "markerline.getLabel().getCaption().setValue..." line, I get the error. If I run it as it is, the value is changed but the label stays as the default.
Thanks
mwilliams
AlanC,
The only issue with your script was the use of "markerline", rather than "markerLine" as the function states. Let me know.
AlanC
Thanks Michael,
That has solved the problem. I probably would have looked at that code from here to the end of next year and not noticed the lack of Capitalisation in that word!
Thanks again!
mwilliams
No problem! Sometimes all it takes is that second set of eyes.