8 use CXGN
::Tools
::WebImageCache
;
9 use CXGN
::Phenome
::Locus
;
11 use GD
::Graph
::linespoints
;
14 use CatalystX
::GlobalContext
'$c';
16 use CXGN
::Page
::FormattingHelpers qw
/info_section_html
23 my $dbh = $c->dbc->dbh;
25 my $logged_sp_person_id = CXGN
::Login
->new($dbh)->verify_session();
27 my $page = CXGN
::Page
->new("Phenome annotation stats","Naama");
31 my $form = CXGN
::Page
::WebForm
->new();
33 my @lstats=CXGN
::Phenome
::Locus
->get_locus_stats( $dbh );
36 my $image= get_graph
(@lstats);
37 print info_section_html
(title
=> 'Locus stats',
45 my $basepath = $c->config->{"basepath"};
46 my $tempfile_dir = $c->config->{"tempfiles_subdir"};
47 my $cache = CXGN
::Tools
::WebImageCache
->new;
48 $cache->set_basedir($basepath);
49 $cache->set_temp_dir($tempfile_dir."/temp_images");
50 $cache->set_key("Locus_num");
51 #$cache->set_map_name("locusnum");
54 if (! $cache->is_valid()) {
56 my $graph = GD
::Graph
::area
->new(600,400);
59 y_label
=> 'Number of loci',
60 title
=> 'SGN locus database',
65 ) or die $graph->error;
67 for my $i ( 0 .. $#stats ) {
68 my $aref = $stats[$i];
70 for my $j ( 0 .. $n ) {
75 $graph->set_title_font('gdTinyFont');
76 my @bar_clr = ("orange");
79 $cache->set_image_data($graph->plot(\
@stats)->png);
83 my $image = $cache->get_image_tag();
84 my $title = "SGN locus database";