| 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 $y_axis = $g->get_axis('y_axis');
|
|---|
| 15 |
|
|---|
| 16 | my $e = $g->get_element('line');
|
|---|
| 17 |
|
|---|
| 18 | my $data = [];
|
|---|
| 19 | for( my $i=0; $i<5; $i++ ) {
|
|---|
| 20 | push ( @$data, rand(20) );
|
|---|
| 21 | }
|
|---|
| 22 | $e->set_values($data, 0);
|
|---|
| 23 | $e->set_dot_style({'type'=>'solid-dot', 'colour'=>'#a44a80', 'dot-size'=>4, 'tip'=>'#val#<br>#x_label#'});
|
|---|
| 24 | $y_axis->add_element($e);
|
|---|
| 25 |
|
|---|
| 26 | $e = $g->get_element('line');
|
|---|
| 27 | my $data = [];
|
|---|
| 28 | for( my $i=0; $i<5; $i++ ) {
|
|---|
| 29 | push ( @$data, rand(30) );
|
|---|
| 30 | }
|
|---|
| 31 | $e->set_values($data, 0);
|
|---|
| 32 | $e->set_dot_style({'type'=>'hollow-dot', 'colour'=>'#a44a80', 'dot-size'=>3, 'tip'=>'#val#<br>#x_label#'});
|
|---|
| 33 | $y_axis->add_element($e);
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | $e = $g->get_element('line');
|
|---|
| 37 | my $data = [];
|
|---|
| 38 | for( my $i=0; $i<5; $i++ ) {
|
|---|
| 39 | push ( @$data, rand(40) );
|
|---|
| 40 | }
|
|---|
| 41 | $e->set_values($data, 0);
|
|---|
| 42 | $y_axis->add_element($e);
|
|---|
| 43 |
|
|---|
| 44 | %>
|
|---|
| 45 | <html>
|
|---|
| 46 | <head>
|
|---|
| 47 | <title>OFC Test Suite - PERL</title>
|
|---|
| 48 | <link type="text/css" rel="stylesheet" media="all" href="style.css"/>
|
|---|
| 49 | </head>
|
|---|
| 50 | <body>
|
|---|
| 51 | <!--#INCLUDE FILE = "list_all_tests.inc"-->
|
|---|
| 52 | <h3>Line Test</h3>
|
|---|
| 53 | <%
|
|---|
| 54 | $Response->write($g->render_swf({'width'=>600, 'height'=>400}));
|
|---|
| 55 | $Response->write('<p>Should have one plain line, one line_dot, and one line_hollow with height=rnd(40)</p>');
|
|---|
| 56 | %>
|
|---|
| 57 | </body>
|
|---|
| 58 | </html> |
|---|