Form with custom field for display Sparklines charts

Hi guys, I am using Jquery Sparklines to display tiny evolution graphs in a custom field in a form application, I have used the following events:

OnScriptInit event:
script src="<?php echo sc_url_library('prj', 'inlinegraph', 'jquery.sparkline.min.js');?>
script type=“text/javascript”> $(function() { $(’.inlinesparkline’).sparkline(); });

OnLoadRecord event:
…some code to get the data to generate the SparkLines chart…
{chart_field}=“span class=‘inlinesparkline’>” . $values . "</span

My question is: why does everything work well the first time the form is loaded ?, but do the graphics stop showing when you navigate through it or when it is filtered? The problem is only corrected when the form is reloaded, for example when saving the data.
Thanks for the collaboration, best regards to all, Ricardo