#!C:/perl/bin/perl.exe use CGI::Carp qw(fatalsToBrowser); use CGI; $query = new CGI; print $query->header; print $query->start_html(-title=>'Fraley Scatterplot Demo'); print " "; @arrayx = (5.50,4.50,5.50,5.25,5.25,2.25,6.00,4.25,6.00,5.75,3.25,3.00,2.75,5.75,5.50,5.50,4.25,5.00,4.25,4.50,4.00,3.50,2.50,3.75,5.25,5.00,5.75,5.25,5.75,1.50,3.25,4.75,3.00,1.25,4.00,4.00,3.25,6.50,6.50,2.25,5.00,4.75,4.00,5.67,3.75,2.00,3.50,2.00,2.25,2.25,3.25,2.75,4.25,3.25,5.25,5.25,4.50,1.00,7.00,2.25,2.25,2.75,4.75,5.25,4.00,1.75,5.75,4.50,5.25,6.00,3.50,6.25,5.75,4.00,3.25,3.00,3.25,4.75,4.25,4.50,2.25,2.50,1.25,5.75,1.75,3.25,1.25,4.50,3.50,5.25,5.50,4.00,1.75,4.00,3.50,2.50,4.75,3.50,4.25,5.50,6.75,1.50,4.25,4.50,4.75,2.00,3.00,5.25,3.75,5.25,5.75,4.00,5.50,6.00,4.75,3.00,3.25,4.25,5.00,3.50); @arrayy = (5.75,2.25,4.50,4.75,5.25,2.25,4.00,3.00,5.50,6.50,1.75,1.75,2.00,5.00,6.25,4.25,4.00,4.50,3.50,2.75,2.25,2.50,2.00,2.25,3.00,4.25,5.50,6.25,6.25,2.00,3.50,4.50,2.25,1.75,4.00,3.00,3.00,7.00,7.00,2.00,6.75,5.25,2.75,5.25,3.25,4.25,3.75,1.75,3.00,3.00,2.75,3.00,3.75,2.50,4.75,5.25,4.50,1.00,7.00,2.25,1.25,1.50,4.00,6.00,3.00,1.25,5.00,3.50,5.75,6.50,3.50,6.50,5.50,3.75,3.25,2.75,3.00,5.50,3.25,5.50,1.00,1.00,2.00,5.00,1.00,2.00,1.75,5.75,4.00,4.50,5.50,1.75,1.75,3.25,4.50,1.50,3.75,4.00,4.75,6.25,5.25,1.00,2.50,2.75,5.25,1.00,2.50,3.25,2.75,6.50,6.75,4.25,7.00,5.50,4.00,2.50,2.00,3.50,3.50,2.00); print "This is an example of a scatterplot in which the data themselves exist in Perl-generated arrays. The trick is to translate the Perl representation of the array data into a format that conforms to the display jquery/flot wants to use. We do so with a loop that designed to extract the array data in Perl and 'format' it in a way that dumps it into the javascript code being sent to the user's browswer.

"; print "
"; print ""; print $query->end_html;