I think this is a simpler problem, but I'll give background in case it helps.<br />
<br />
I have a line chart that has dates on the x-axis, and integer values on the y-axis. I need to place vertical (x-axis) marker lines at a given date. These dates are not parameters passed at runtime, they are available in my dataSet.<br />
<br />
I am using an onCreate script to do:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.setPersistentGlobalVariable("evDate", value);</pre>
to place this marker line date available to the chart's onRender scripts.<br />
<br />
I have found that marker lines need to be placed at numeric values along the axis, even though the axis labels and the marker line values are date-time. I have found this link suggesting how to compare a date-time to the axis to find the numeric value of where to place the marker:<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/1158-setting-marker-line-based-on-date-parameter/#description'>Setting Marker Line based on Date Parameter - Designs & Code - BIRT Exchange</a><br />
<br />
However, in function afterDataSetFilled(series, dataSet, icsc), I get the following error when I try:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("evDate");</pre>
<pre class='_prettyXprint _lang-auto _linenums:0'>Cannot call method "getScriptable" of null at line 48</pre>
<br />
There doesn't seem to be any other code in effect here. icsc is passed in automatically. Looks as if getExternalContext() is returning null?<br />
<br />
This script is onRender for my chart.<br />
<br />
If it helps, I'm able to do exactly the same command from within the onRender function beforeGeneration().<br />
<br />
Thanks.