1 | <%@ Language="PerlScript"%>
|
---|
2 | <%
|
---|
3 |
|
---|
4 | # For this test you must have an iis webserver with the perlscript dll installed as a language.
|
---|
5 | # Also you'll need the open-flash-chart.swf file and the open_flash_chart.pm files together with this one
|
---|
6 | #
|
---|
7 |
|
---|
8 | use strict;
|
---|
9 | our ($Server, $Request, $Response);
|
---|
10 | use lib $Server->mappath('.');
|
---|
11 | use open_flash_chart;
|
---|
12 |
|
---|
13 | my $g = chart->new();
|
---|
14 | my $x = $g->get_axis('x_axis');
|
---|
15 | $x->set_labels({"labels"=>[]}); #clear out the default labels so scatter can plot the x axis.
|
---|
16 | my $y_axis = $g->get_axis('y_axis');
|
---|
17 |
|
---|
18 | my $e = $g->get_element('scatter');
|
---|
19 | $e->set_values([
|
---|
20 | {"x"=>-rand(5), "y"=>-rand(5)},
|
---|
21 | {"x"=>-rand(4), "y"=>-rand(4)},
|
---|
22 | {"x"=>-rand(2), "y"=>-rand(2), "dot-size"=>20},
|
---|
23 | {"x"=>rand(3), "y"=>rand(3), "dot-size"=>5},
|
---|
24 | {"x"=>rand(6), "y"=>rand(6), "dot-size"=>5},
|
---|
25 | {"x"=>rand(10), "y"=>rand(10), "dot-size"=>15}
|
---|
26 | ]);
|
---|
27 | $y_axis->add_element($e);
|
---|
28 |
|
---|
29 | %>
|
---|
30 | <html>
|
---|
31 | <head>
|
---|
32 | <title>OFC Test Suite - PERL</title>
|
---|
33 | <link type="text/css" rel="stylesheet" media="all" href="style.css"/>
|
---|
34 | </head>
|
---|
35 | <body>
|
---|
36 | <!--#INCLUDE FILE = "list_all_tests.inc"-->
|
---|
37 | <h3>Scatter Test</h3>
|
---|
38 | <%
|
---|
39 | $Response->write($g->render_swf({'width'=>600, 'height'=>400}));
|
---|
40 | $Response->write('<p>Should plot six dots of various sizes.</p>');
|
---|
41 | %>
|
---|
42 | </body>
|
---|
43 | </html> |
---|