#!/usr/bin/perl
use utf8;
use strict;
use warnings;

use GD::Graph::histogram;


my $data = [
    sort map {
        $_ =~ s/\s.*//;
        $_ - 0.5
    } grep {
        $_ =~ m{^\d}
    } <DATA>
];

$data->[$#{$data}]++;
my $graph = new GD::Graph::histogram(400,600);

$graph->set(
    x_label         => 'Jaar',
    y_label         => 'Aantal',
    title           => 'Inter-Actief-fossielen',
    x_labels_vertical => 1,
    y_max_value     => 12,
    y_tick_number   => 12,
    bar_spacing     => 0,
    shadow_depth    => 1,
    shadowclr       => 'dred',
    transparent     => 0,
    histogram_bins  => 11,
) or warn $graph->error;

my $gd = $graph->plot($data) or die $graph->error;

open(IMG, '>inter-actief.png') or die $!;
binmode IMG;
print IMG $gd->png;

__DATA__
2008 `355`
2004 akaIDIOT
2008 Amrod
2003 Amy
2005 apie
2004 atum
2008 BasilFX
     BlackIce
2002 blathijs
     daenney
2007 deadlock
2010 Dipnoi
2006 DRiKE
2006 d-snp
2006 DTM
2003 dunamis
2006 Dutchy
2004 Emthigious
2004 ErikH
2005 ewoud
2001 fizzgig
     Gettow
2005 goudlokje
2004 Hobbit13
     hurne
     Il_Mostro
2006 ius
2008 J3173
2009 Jelco
     JoeyJo0
     JonathanJ
2010 Joost_
2004 kaasbol
2009 Koen
2004 lennard
     Liesje
2007 Marissa
     martijn
2001 ^michael^
     namnatulco
2002 Nieko
2007 Onmarag
     pieter
2005 Pimmeh
     ralphje
2004 Razzmann
2010 Regie
     Reinhart
2007 rem
2004 Sakartu
2006 sanny
2004 Scharrels
     Sjors
     ties_
     Tijnoz
     TinTin
     Tw4n
2001 vloris
2011 vollenbrockjhj
     Wanno
     WeeJeWel
     WillemM
     Woutifier
2004 Zosma
