#!/usr/bin/perl
# This example shows how to output multiple samples to multiple files
# Notice how sources, files etc are all plural and refer to arrays

my $data_colour = [0.3, 0.7, 0.7 ];
my $bgnd_colour = [0.95,0.95,1   ];

my $seq1 = new PostScript::Graph::Sequence;
$seq1->setup('color', [
    [0.5,0,0], [1,0,0], [1,1,0], [0.5,0.5,0], [0,1,0],
    [0,0.5,0], [0,0.5,0.5], [0,0,1], [0.5,0,0.5]
]);
$seq1->auto(qw(color));

### Styles
my $fn_style = {
    sequence => $seq1,
    line => {
	width => 1.5,
	outer_color => 0.4,
    },
};

my $test_style = {
    sequence => $seq1,
    same => 1,
    line => {
	width => 3,
	dashes => [ 1, 2 ],
    },
};

### Model
source => {
    user     => 'test',
    password => 'test',
    database => 'test',
    #mode     => 'offline',
    mode     => 'fetch',
},

file => {
    landscape => 0,
},

charts => [
    default => {
	png => 1,
	ghostscript => 'gs',
	dots_per_inch => 75,
	background => $bgnd_colour,
	invert => 1,
	x_axis => {
	    mid_width => 0,
	    mid_color => $bgnd_colour,
	},
	key => {
	    background => $bgnd_colour,
	},
	prices => {
	    percent => 60,
	    points => {
		color => $data_colour,
		width => 1.5,
	    },
	},
	volumes => {
	    percent => 40,
	    bars => {
		color => $data_colour,
		width => 1,
	    },
	},
    },
],

sample => {
    dates_by   => 'weekdays',
    start_date => '2003-05-01',
    #end_date   => '2003-05-28'
},

