PlotLine dynamically on HTML5 chart
<p>Hello,</p>
<p> </p>
<p>I wanna plot a line dynamically on a HTML5 chart.</p>
<p>I searched for some scripts and i succeed for a an hard line like this :</p>
<p> </p>
<blockquote class="ipsBlockquote">
<p> </p>
<p>afterRendering: function(myChart, icsc)</p>
<div>{</div>
<div> </div>
<div>//var pSite = icsc.getExternalContext().getScriptable().getParameterValue( "Test");</div>
<div>//var nb = icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("var1");</div>
<div>var chart=myChart.getCore();</div>
<div>var mySeries = chart.series[0];</div>
<div>var Pgvalue = 130;</div>
<div> </div>
<div>mySeries.yAxis.addPlotLine({</div>
<div>color: 'green',</div>
<div>width: 2,</div>
<div>value: Pgvalue,</div>
<div>id: 'Pg max',</div>
<div>zIndex: 2</div>
<div>});</div>
<div> </div>
<div>// Add a legend item that labels the plot line</div>
<div>// Do this by adding an empty series</div>
<div>chart.addSeries({</div>
<div>color: 'green',</div>
<div>name: 'Pg max:'+ Pgvalue,</div>
<div> <span> </span>marker: {</div>
<div>enabled: false</div>
<div>}</div>
<div>});</div>
<div>},</div>
</blockquote>
<p> </p>
<p>But i wanna do it with conditions on paramaters of the birt.</p>
<p>i saw i can get the parameter like this :</p>
<blockquote class="ipsBlockquote">
<p> </p>
<p>beforeGeneration: function(icsc) {</p>
<div>var pSite = icsc.getExternalContext().getScriptable().getParameterValue( "Test");</div>
<div>},</div>
</blockquote>
<p> </p>
<p>But the variable created in the "beforegeneration" doesn't exist in the "afterrendering" function, and i believe that i can only get the parameter in the "beforegeneration" and plot the line in the "afterrendering", if i'm not wrong.</p>
<p> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I really appreciate any help you can provide,</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">with regards,</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Jonathan</p>