[7849] | 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 | # and swfobject.js, json/json2.js if you use in-line js (default).
|
---|
| 7 |
|
---|
| 8 | use strict; use warnings;
|
---|
| 9 | our ($Server, $Request, $Response);
|
---|
| 10 | use lib $Server->mappath('.');
|
---|
| 11 |
|
---|
| 12 | use open_flash_chart;
|
---|
| 13 |
|
---|
| 14 | my $g = chart->new();
|
---|
| 15 | my $y_axis = $g->get_axis('y_axis');
|
---|
| 16 |
|
---|
| 17 | my $e = $g->get_element('bar');
|
---|
| 18 | my $data = [];
|
---|
| 19 | for( my $i=0; $i<5; $i++ ) {
|
---|
| 20 | push ( @$data, rand(20) );
|
---|
| 21 | }
|
---|
| 22 | $e->set_values($data, 0);
|
---|
| 23 | $y_axis->add_element($e);
|
---|
| 24 |
|
---|
| 25 | $e = $g->get_element('bar_filled');
|
---|
| 26 | my $data = [];
|
---|
| 27 | for( my $i=0; $i<5; $i++ ) {
|
---|
| 28 | push ( @$data, rand(40) );
|
---|
| 29 | }
|
---|
| 30 | $e->set_values($data, 0);
|
---|
| 31 | $y_axis->add_element($e);
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | my $g2 = chart->new();
|
---|
| 35 | $y_axis = $g2->get_axis('y_axis');
|
---|
| 36 | my $e2 = $g->get_element('bar_3d');
|
---|
| 37 | my $data2 = [];
|
---|
| 38 | for( my $i=0; $i<5; $i++ ) {
|
---|
| 39 | push ( @$data2, rand(20) );
|
---|
| 40 | }
|
---|
| 41 | $e2->set_values($data2, 0);
|
---|
| 42 | $y_axis->add_element($e2);
|
---|
| 43 |
|
---|
| 44 | $e2 = $g2->get_element('bar_glass');
|
---|
| 45 | my $data2 = [];
|
---|
| 46 | for( my $i=0; $i<5; $i++ ) {
|
---|
| 47 | push ( @$data2, rand(40) );
|
---|
| 48 | }
|
---|
| 49 | $e2->set_values($data2, 0);
|
---|
| 50 | $y_axis->add_element($e2);
|
---|
| 51 |
|
---|
| 52 | %>
|
---|
| 53 | <html>
|
---|
| 54 | <head>
|
---|
| 55 | <title>OFC Test Suite - PERL</title>
|
---|
| 56 | <link type="text/css" rel="stylesheet" media="all" href="style.css"/>
|
---|
| 57 | </head>
|
---|
| 58 | <body>
|
---|
| 59 | <!--#INCLUDE FILE = "list_all_tests.inc"-->
|
---|
| 60 | <h3>Bar Test</h3>
|
---|
| 61 | <%
|
---|
| 62 | $Response->write($g->render_swf({'width'=>600, 'height'=>400}));
|
---|
| 63 | $Response->write('<p>Should have one 2D plain, and one 2D outline bars with height=rnd(40)</p>');
|
---|
| 64 | $Response->write('<br/><hr/>');
|
---|
| 65 | $Response->write($g2->render_swf({'width'=>600, 'height'=>400}));
|
---|
| 66 | $Response->write('<p>Should have one 3D plain and one 3D bar glass with height=rnd(40)</p>');
|
---|
| 67 | %>
|
---|
| 68 |
|
---|
| 69 |
|
---|
| 70 | </body>
|
---|
| 71 | </html> |
---|