Hello, I'm trying to set the y-axis scale of a chart dynamically to read off a parameter but I can't get it working. Can someone please tell me what I'm missing? It's driving me nuts

<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeGeneration( chart, icsc )
{
importPackage(Packages.org.eclipse.birt.chart.model.data.impl)
yAxis1 = chart.primaryBaseAxes[0];
yScale1 = yAxis1.getScale();
{
yScale1.setMax(NumberDataElementImpl.create(icsc.externalContext.scriptable.getParameterValue("High")));
yAxis1.setScale(yScale1);
}
}
</pre>
<br />
Also attached the rptdesign file.<br />
(Eclipse BIRT Designer Version 2.6.0.v20100531)