File: composite_f.t

package info (click to toggle)
libchart-perl 2.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 15,356 kB
  • ctags: 140
  • sloc: perl: 6,573; makefile: 40
file content (39 lines) | stat: -rwxr-xr-x 727 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl -w

use Chart::Composite;
use strict;

print "1..1\n";

my $g = Chart::Composite->new;

$g->add_dataset (1 , 2, 3, 7, 5, 6);
$g->add_dataset (0.1, 0.2, 0.3, 0.2, 0.4, 0.1);
$g->add_dataset (0.3, 0.5, 0.2, 0.6, 0.7, 0.4);
$g->add_dataset (10, 11, 6, 7, 7, 8);

$g->set ('title' => 'Composite f_tick Chart',
	 'composite_info' => [ ['Bars', [1,2]],
	 		       ['LinesPoints', [3]] ]);
$g->set( 'include_zero' => 'true');	 		       
	 		       
 
$g -> set ('f_y_tick' => \&multiply);
$g -> set ('f_x_tick' => \&int_quadrat);
$g->png("samples/composite_f.png");
	 		      

print "ok 1\n";

exit(0);

sub multiply {
 my $y = shift;

 return ($y*10);
 }

sub int_quadrat {
 my $x = shift;
 return $x*$x; 
 }