hi how can i use global javascript functions in a chart event?<br />
<br />
i have a js file: birt-functions.js which i added via resource tab into the report <br />
<br />
in can use my functions in a dynamic text but when im use it in a chart event i get an error: ReferenceError: "<strong class='bbc'>myFunc</strong>" is not defined<br />
<br />
after few hours i found a solution

<br />
<br />
1. create a global variable with the function: <br />
reportContext.setPersistentGlobalVariable("<strong class='bbc'>myFunc</strong>", <strong class='bbc'>myFunc</strong>);<br />
<br />
2. use it in a chart event:<br />
function beforeDrawAxisLabel( axis, label, icsc )<br />
{<br />
<strong class='bbc'>myFunc </strong>= icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("<strong class='bbc'>myFunc</strong>");<br />
<br />
label.getCaption().setValue(<strong class='bbc'>myFunc</strong>(20)); <br />
}<br />
<br />
but its annoying to create a global variable for each javascript function.<br />
<br />
have someone a better idea for global js functions?