source: code/Website/perl-ofc-library/test_bar.asp@ 7849

Last change on this file since 7849 was 7849, checked in by dennisw, 15 years ago
File size: 1.8 KB
Line 
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
8use strict; use warnings;
9our ($Server, $Request, $Response);
10use lib $Server->mappath('.');
11
12use open_flash_chart;
13
14my $g = chart->new();
15my $y_axis = $g->get_axis('y_axis');
16
17my $e = $g->get_element('bar');
18my $data = [];
19for( 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');
26my $data = [];
27for( 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
34my $g2 = chart->new();
35$y_axis = $g2->get_axis('y_axis');
36my $e2 = $g->get_element('bar_3d');
37my $data2 = [];
38for( 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');
45my $data2 = [];
46for( 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>
Note: See TracBrowser for help on using the repository browser.