[jifty-devel] Chart plugin: Handling scripts in regions

Thomas Sibley trs at bestpractical.com
Sun Aug 5 16:11:38 EDT 2007


Andrew,

Could you let me know if the attached patch makes the PlotKit renderer 
work with regions the way you described?

Cheers,
Tom

Andrew Sterling Hanenkamp wrote:
> Thomas,
> 
> I've done some clean up on the charting API, which has included some 
> patches on the PlotKit renderer. I've tried to clean things up a bit now 
> that we have a few renderers and I know what to look for.
> 
> A new problem I see now is that if you place a PlotKit chart inside of a 
> region and then replace that with another region containing PlotKit 
> charts, the charts never render because the script tags are stripped. I 
> was trying to think of a better way to handle this and was wondering if 
> we might render a table containing the data for the chart, which would 
> then be replaced by a PlotKit chart when the next Behaviour.apply() call 
> is made. This could be a standard facility provided by the plugin rather 
> than by the renderer since I expect other renderers to need something 
> like it. If PlotKit failed to render, at least there'd be a table 
> showing the data.
> 
> What do you think?
> 
> Cheers,
> Andrew
> 
> P.S. Thanks for the work on PlotKit. It'll make the big bosses happier 
> than what I would have had time for otherwise.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel

-------------- next part --------------
=== lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm
==================================================================
--- lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm	(revision 25906)
+++ lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm	(local)
@@ -90,7 +90,7 @@
         @{[Jifty::JSON::objToJson( $args{data} )]}
     );
 };
-YAHOO.util.Event.addListener( window, "load", plot );
+YAHOO.util.Event.onAvailable( "$chart_id", plot );
 </script>
     END_OF_HTML
 


More information about the jifty-devel mailing list