Commit e615a1e4 authored by Keith Jolley's avatar Keith Jolley
Browse files

Fix various uninitialized variable warnings.

parent 61ba92b6
#Written by Keith Jolley
#Copyright (c) 2010, University of Oxford
#Copyright (c) 2010-2011, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
......@@ -18,6 +18,7 @@
#along with BIGSdb. If not, see <http://www.gnu.org/licenses/>.
package BIGSdb::AlleleQueryPage;
use strict;
use warnings;
use base qw(BIGSdb::QueryPage);
use Log::Log4perl qw(get_logger);
my $logger = get_logger('BIGSdb.Page');
......@@ -85,7 +86,7 @@ sub print_content {
my ($self) = @_;
my $system = $self->{'system'};
my $q = $self->{'cgi'};
my $locus = $q->param('locus');
my $locus = $q->param('locus') || '';
$locus =~ s/^cn_//;
if ( $q->param('no_header') ) {
$self->_ajax_content($locus);
......@@ -98,16 +99,15 @@ sub print_content {
print " sequences - $system->{'description'} database</h1>\n";
my $qry;
if ( !defined $q->param('currentpage')
|| $q->param('pagejump') eq '1'
|| (defined $q->param('pagejump') && $q->param('pagejump') eq '1')
|| $q->param('First') )
{
if (!$q->param('no_js')){
my $locus_clause = $locus ? "&amp;locus=$locus" : '';
print "<noscript><p class=\"highlight\">The dynamic customisation of this interface requires that you enable Javascript in your
browser. Alternatively, you can use a <a href=\"$self->{'script_name'}?db=$self->{'instance'}&amp;page=alleleQuery$locus_clause&amp;no_js=1\">non-Javascript
browser. Alternatively, you can use a <a href=\"$self->{'system'}->{'script_name'}?db=$self->{'instance'}&amp;page=alleleQuery$locus_clause&amp;no_js=1\">non-Javascript
version</a> that has 4 combinations of fields.</p></noscript>\n";
}
}
$self->_print_query_interface();
}
if ( defined $q->param('query')
......@@ -148,10 +148,8 @@ sub _get_select_items {
$self->{'db'}->prepare(
"SELECT field,description,value_format,required,length,option_list FROM locus_extended_attributes WHERE locus=? ORDER BY field_order"
);
eval { $sql->execute($locus); };
if ($@) {
$logger->error("Can't execute $@");
}
eval { $sql->execute($locus) };
$logger->error($@) if $@;
while ( my ( $field, $desc, $format, $length, $optlist ) = $sql->fetchrow_array ) {
my $item = "extatt_$field";
push @select_items, $item;
......@@ -192,14 +190,12 @@ sub _print_query_interface {
print "<div class=\"box\" id=\"queryform\">\n";
my ($display_loci,$cleaned) = $self->{'datastore'}->get_locus_list;
unshift @$display_loci, '';
print $q->startform();
print $q->startform;
$cleaned->{''} = 'Please select ...';
print "<p><b>Locus: </b>";
print $q->popup_menu( -name => 'locus', -id => 'locus', -values => $display_loci, -labels => $cleaned );
print " <span class=\"comment\">Page will reload when changed</span></p>";
foreach (qw (db page no_js)) {
print $q->hidden($_);
}
print $q->hidden($_) foreach qw (db page no_js);
if ($q->param('locus')){
my $locus = $q->param('locus');
my $desc_exists = $self->{'datastore'}->run_simple_query("SELECT COUNT(*) FROM locus_descriptions WHERE locus=?",$locus)->[0];
......@@ -209,19 +205,14 @@ sub _print_query_interface {
}
print "<p>Please enter your search criteria below (or leave blank and submit to return all records).</p>";
print "<div style=\"white-space:nowrap\">";
my $table_fields;
if ($q->param('no_js')){
$table_fields = 4;
} else {
$table_fields = $self->_highest_entered_fields('table_fields') || 1;
}
my $table_fields = $q->param('no_js') ? 4 : ($self->_highest_entered_fields('table_fields') || 1);
print "<fieldset>\n<legend>Locus fields</legend>\n";
my $table_field_heading = $table_fields == 1 ? 'none' : 'inline';
print "<span id=\"table_field_heading\" style=\"display:$table_field_heading\"><label for=\"c0\">Combine searches with: </label>\n";
print $q->popup_menu( -name => 'c0', -id => 'c0', -values => [ "AND", "OR" ] );
print "</span>\n<ul id=\"table_fields\">\n";
for ( my $i = 1 ; $i <= $table_fields ; $i++ ) {
foreach my $i ( 1 .. $table_fields ) {
print "<li>";
$self->_print_table_fields($locus, $i, $table_fields, $select_items, $labels);
print "</li>\n";
......@@ -234,14 +225,12 @@ sub _print_query_interface {
print $q->popup_menu( -name => 'direction', -values => [ 'ascending', 'descending' ], -default => 'ascending' );
print "</span></li>\n<li><span style=\"white-space:nowrap\">\n";
if ( $q->param('displayrecs') ) {
$prefs->{'displayrecs'} = $q->param('displayrecs');
}
$prefs->{'displayrecs'} = $q->param('displayrecs') if $q->param('displayrecs');
print "<label for=\"displayrecs\" class=\"display\">Display: </label>\n";
print $q->popup_menu(
-name => 'displayrecs',
-id => 'displayrecs',
-values => [ '10', '25', '50', '100', '200', '500', 'all' ],
-values => [ qw (10 25 50 100 200 500 all) ],
-default => $prefs->{'displayrecs'}
);
print " records per page&nbsp;";
......@@ -252,23 +241,7 @@ sub _print_query_interface {
print
"</ul><span style=\"float:left\"><a href=\"$self->{'system'}->{'script_name'}?db=$self->{'instance'}&amp;page=alleleQuery$locus_clause\" class=\"resetbutton\">Reset</a></span><span style=\"float:right\">";
print $q->submit( -name => 'submit', -label => 'Submit', -class => 'submit' );
print "</span></fieldset>\n";
print "</div>\n";
my %labels;
my @username;
my $qry = "SELECT id,first_name,surname FROM users WHERE id>0 ORDER BY surname ";
my $sql = $self->{'db'}->prepare($qry);
eval { $sql->execute(); };
if ($@) {
$logger->error("Can't execute: $qry");
} else {
$logger->debug("Query: $qry");
}
while ( my @data = $sql->fetchrow_array() ) {
push @username, $data[0];
$labels{ $data[0] } = "$data[2], $data[1]";
}
print "</span></fieldset>\n</div>\n";
print "<div style=\"white-space:nowrap\"><fieldset><legend>Filter query by</legend>\n";
print "<ul>\n";
print "<li><span style=\"white-space:nowrap\">";
......@@ -302,8 +275,8 @@ sub _run_query {
my $andor = $q->param('c0');
my $first_value = 1;
my $extatt_sql = $self->{'db'}->prepare("SELECT * FROM locus_extended_attributes WHERE locus=? AND field=?");
for ( my $i = 1 ; $i <= MAX_ROWS ; $i++ ) {
if ( $q->param("t$i") ne '' ) {
foreach my $i ( 1 .. MAX_ROWS ) {
if ( defined $q->param("t$i") && $q->param("t$i") ne '' ) {
my $field = $q->param("s$i");
my $operator = $q->param("y$i");
my $text = $q->param("t$i");
......@@ -315,9 +288,7 @@ sub _run_query {
#search by extended attribute
$field = $1;
eval { $extatt_sql->execute( $locus, $field ); };
if ($@) {
$logger->error("Can't execute $@");
}
$logger->error($@) if $@;
my $thisfield = $extatt_sql->fetchrow_hashref;
if ( $text ne '<blank>'
&& $text ne 'null'
......@@ -472,8 +443,9 @@ sub _run_query {
$locus =~ s/'/\\'/g;
$qry2 = "SELECT * FROM sequences WHERE locus=E'$locus' AND ($qry)";
foreach (@$attributes) {
if ( $q->param( $_->{'name'} . '_list' ) ne '' ) {
my $value = $q->param( $_->{'name'} . '_list' );
my $param = $_->{'name'} . '_list';
if ( defined $q->param( $param ) && $q->param( $param ) ne '' ) {
my $value = $q->param( $param );
if ( $qry2 !~ /WHERE \(\)\s*$/ ) {
$qry2 .= " AND ";
} else {
......@@ -496,7 +468,7 @@ sub _run_query {
}
my @hidden_attributes;
push @hidden_attributes, 'c0';
for ( my $i = 1 ; $i <= MAX_ROWS ; $i++ ) {
foreach my $i ( 1 .. MAX_ROWS ) {
push @hidden_attributes, "s$i", "t$i", "y$i";
}
foreach (@$attributes) {
......
#Written by Keith Jolley
#Copyright (c) 2010, University of Oxford
#Copyright (c) 2010-2011, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
......@@ -18,6 +18,7 @@
#along with BIGSdb. If not, see <http://www.gnu.org/licenses/>.
package BIGSdb::AlleleSequencePage;
use strict;
use warnings;
use base qw(BIGSdb::IsolateInfoPage BIGSdb::ExtractedSequencePage);
use Log::Log4perl qw(get_logger);
use Error qw(:try);
......@@ -51,11 +52,8 @@ sub print_content {
my $qry =
"SELECT seqbin_id,start_pos,end_pos,reverse,complete,method FROM allele_sequences LEFT JOIN sequence_bin ON allele_sequences.seqbin_id = sequence_bin.id WHERE isolate_id=? AND locus=? ORDER BY complete desc,allele_sequences.datestamp";
my $sql = $self->{'db'}->prepare($qry);
eval { $sql->execute( $isolate_id, $locus ); };
if ($@) {
$logger->error("Can't execute $qry $@");
}
eval { $sql->execute( $isolate_id, $locus ) };
$logger->error($@) if $@;
my $buffer;
my $td = 1;
while ( my ( $seqbin_id, $start_pos, $end_pos, $reverse, $complete, $method ) = $sql->fetchrow_array ) {
......
#Written by Keith Jolley
#(c) 2010, University of Oxford
#(c) 2010-2011, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
......@@ -19,6 +19,7 @@
package BIGSdb::BIGSException;
use strict;
use warnings;
use base qw(Error);
use overload ( '""' => 'stringify' );
no warnings 'redefine';
......
#Written by Keith Jolley
#Copyright (c) 2010, University of Oxford
#Copyright (c) 2010-2011, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
......@@ -18,6 +18,7 @@
#along with BIGSdb. If not, see <http://www.gnu.org/licenses/>.
package BIGSdb::BatchProfileQueryPage;
use strict;
use warnings;
use base qw(BIGSdb::Page);
use Log::Log4perl qw(get_logger);
use Error qw(:try);
......@@ -31,7 +32,7 @@ sub get_title {
sub initiate {
my ($self) = @_;
if ( $self->{'cgi'}->param('function') eq 'examples' ) {
if ( $self->{'cgi'}->param('function') && $self->{'cgi'}->param('function') eq 'examples' ) {
$self->{'type'} = 'text';
} else {
$self->{'jQuery'} = 1;
......@@ -41,7 +42,7 @@ sub initiate {
sub print_content {
my ($self) = @_;
my $q = $self->{'cgi'};
if ( $q->param('function') eq 'examples' ) {
if ( $q->param('function') && $q->param('function') eq 'examples' ) {
$self->_print_examples;
return;
}
......@@ -54,7 +55,7 @@ sub print_content {
print "<div class=\"box\" id=\"statusbad\"><p>This function is only available for sequence definition databases.</p></div>\n";
return;
}
my $scheme_info = $self->{'datastore'}->get_scheme_info($scheme_id) if $scheme_id > 0;
my $scheme_info = $scheme_id > 0 ? $self->{'datastore'}->get_scheme_info($scheme_id) : undef;
if ( ( !$scheme_info->{'id'} || !$scheme_id ) ) {
print "<h1>Batch profile query</h1>\n";
print "<div class=\"box\" id=\"statusbad\"><p>Invalid scheme selected.</p></div>\n";
......@@ -119,12 +120,8 @@ sub print_content {
while (@profile > @$loci){
pop @profile;
}
eval {
$sql->execute(@profile);
};
if ($@){
$logger->error("Can't execute $@");
}
eval { $sql->execute(@profile) };
$logger->error($@) if $@;
@field_data = $sql->fetchrow_array;
} else {
$incomplete =1 ;
......@@ -132,7 +129,7 @@ sub print_content {
my $i=0;
foreach (@$scheme_fields){
if (exists $field_data[$i]){
print "<td>$field_data[$i]</td>";
print defined $field_data[$i] ? "<td>$field_data[$i]</td>" : '<td />';
} else {
print "<td class=\"statusbad\" style=\"font-size:2em\">-</td>";
}
......@@ -152,10 +149,7 @@ sub print_content {
print "<div class=\"box\" id=\"queryform\">\n";
print $q->start_form;
foreach (qw (db page scheme_id)) {
print $q->hidden($_);
}
print $q->hidden($_) foreach qw (db page scheme_id);
print <<"HTML";
<p>Enter allelic profiles below in tab (or space) delimited text format
......@@ -171,8 +165,7 @@ HTML
print $q->reset( -class => 'reset' );
print $q->submit( -label => 'Submit query', -class => 'submit' );
print $q->endform;
print "<p />";
print "</div>";
print "<p />\n</div>";
}
sub _print_examples {
......@@ -189,7 +182,7 @@ sub _print_examples {
print "This function is only available for sequence definition databases.\n";
return;
}
my $scheme_info = $self->{'datastore'}->get_scheme_info($scheme_id) if $scheme_id > 0;
my $scheme_info = $scheme_id > 0 ? $self->{'datastore'}->get_scheme_info($scheme_id) : undef;
if ( ( !$scheme_info->{'id'} || !$scheme_id ) ) {
print "Invalid scheme selected.\n";
return;
......@@ -203,10 +196,8 @@ sub _print_examples {
$_ =~ s/'/_PRIME_/g;
}
my $sql = $self->{'db'}->prepare("SELECT @cleaned_loci FROM scheme_$scheme_id ORDER BY random() LIMIT 15");
eval { $sql->execute; };
if ($@) {
$logger->error("Can't execute $@");
}
eval { $sql->execute };
$logger->error($@) if $@;
$" = "\t";
my $i = 1;
while ( my @profile = $sql->fetchrow_array ) {
......
#Written by Keith Jolley
#(c) 2010, University of Oxford
#(c) 2010-2011, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
......@@ -18,15 +18,14 @@
#along with BIGSdb. If not, see <http://www.gnu.org/licenses/>.
package BIGSdb::BrowsePage;
use strict;
use warnings;
use base qw(BIGSdb::Page);
use Log::Log4perl qw(get_logger);
my $logger = get_logger('BIGSdb.Page');
sub initiate {
my ($self) = @_;
foreach (qw (field_help tooltips jQuery)){
$self->{$_} = 1;
}
$self->{$_} = 1 foreach qw (field_help tooltips jQuery);
}
sub set_pref_requirements {
......@@ -83,9 +82,7 @@ sub print_content {
print "<table><tr><td>\n";
print $q->startform;
print $q->hidden( 'sent', 1 );
foreach (qw (db page sent scheme_id)) {
print $q->hidden($_);
}
print $q->hidden($_) foreach qw (db page sent scheme_id);
print "<table style=\"border-spacing:0\">\n";
print "<tr><td style=\"text-align:right\">Order by: </td><td>\n";
my $labels;
......@@ -130,9 +127,7 @@ sub print_content {
print $q->popup_menu( -name => 'direction', -values => [ 'ascending', 'descending' ], -default => 'ascending' );
print "</td></tr>\n";
print "<tr><td style=\"text-align:right\">Display </td><td>\n";
if ( $q->param('displayrecs') ) {
$prefs->{'displayrecs'} = $q->param('displayrecs');
}
$prefs->{'displayrecs'} = $q->param('displayrecs') if $q->param('displayrecs');
print $q->popup_menu(
-name => 'displayrecs',
-values => [ '10', '25', '50', '100', '200', '500', 'all' ],
......
#Written by Keith Jolley
#Copyright (c) 2010, University of Oxford
#Copyright (c) 2010-2011, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
......@@ -18,6 +18,7 @@
#along with BIGSdb. If not, see <http://www.gnu.org/licenses/>.
package BIGSdb::ChangePasswordPage;
use strict;
use warnings;
use base qw(BIGSdb::LoginMD5);
use Log::Log4perl qw(get_logger);
my $logger = get_logger('BIGSdb.Page');
......@@ -66,16 +67,12 @@ sub print_content {
print "<div class=\"box\" id=\"statusbad\"><p>The password was not re-typed the same as the first time.</p></div>\n";
} else {
my $username = $q->param('page') eq 'changePassword' ? $self->{'username'} : $q->param('user');
if ($self->_set_password_hash($username,$q->param('new_password1'))){
if ($self->_set_password_hash($username,$q->param('new_password1'))){
print "<div class=\"box\" id=\"resultsheader\"><p>". ($q->param('page') eq 'changePassword' ? "Password updated ok." : "Password set for user '$username'.")."</p>\n";
} else {
print "<div class=\"box\" id=\"resultsheader\"><p>Password not updated. Please check with the system administrator.</p>\n";
}
print "<p><a href=\"$self->{'system'}->{'script_name'}?db=$self->{'instance'}\">Return to index</a></p>\n";
print "</div>\n";
}
print "<p><a href=\"$self->{'system'}->{'script_name'}?db=$self->{'instance'}\">Return to index</a></p>\n</div>\n";
return;
}
}
......@@ -98,12 +95,8 @@ sub print_content {
print $q->password_field(-name=>'existing');
} else {
my $sql = $self->{'db'}->prepare("SELECT user_name, first_name, surname FROM users WHERE id>0 ORDER BY surname");
eval {
$sql->execute;
};
if ($@){
$logger->error("Can't execute $@");
}
eval { $sql->execute };
$logger->error($@) if $@;
my (@users,%labels);
while (my ($username,$first_name,$surname) = $sql->fetchrow_array){
push @users,$username;
......@@ -121,14 +114,10 @@ sub print_content {
print $q->submit(-class=>'submit', -label=>'Set password');
print "</td></tr>\n";
print "</table>\n";
foreach (qw (existing_password new_password1 new_password2 new_length)){
$q->param($_,'');
}
$q->param($_,'') foreach qw (existing_password new_password1 new_password2 new_length);
$q->param('user',$self->{'username'}) if $q->param('page') eq 'changePassword';
$q->param('sent',1);
foreach (qw (db page existing_password new_password1 new_password2 new_length user sent)){
print $q->hidden($_);
}
print $q->hidden($_) foreach qw (db page existing_password new_password1 new_password2 new_length user sent);
print $q->end_form;
print "</div>\n";
}
......
#Written by Keith Jolley
#Copyright (c) 2010, University of Oxford
#Copyright (c) 2010-2011, University of Oxford
#E-mail: keith.jolley@zoo.ox.ac.uk
#
#This file is part of Bacterial Isolate Genome Sequence Database (BIGSdb).
......@@ -17,15 +17,16 @@
#
#You should have received a copy of the GNU General Public License
#along with BIGSdb. If not, see <http://www.gnu.org/licenses/>.
package BIGSdb::Charts;
use strict;
use warnings;
use Log::Log4perl qw(get_logger);
my $logger = get_logger('BIGSdb.Charts');
sub piechart {
#size = 'small' or 'large'
my ( $labels, $data, $filename, $num_labels, $size, $prefs ) = @_;
my ( $labels, $data, $filename, $num_labels, $size, $prefs ) = @_;
$prefs->{'style'} = 'pie' if !$prefs->{'style'} || $prefs->{'style'} ne 'doughnut';
#if there are more than $num_labels headings, display the top ones and group the rest
......@@ -47,34 +48,30 @@ sub piechart {
push @grouped_labels, "all others ($num_others values)";
$explode = scalar @grouped_labels - 1;
push @grouped_data, $allothers;
}
else {
} else {
@grouped_labels = @$labels;
@grouped_data = @$data;
}
}
else {
} else {
@grouped_labels = @$labels;
@grouped_data = @$data;
}
my $chart;
if ( $size eq 'small' ) {
$chart = new PieChart( 780, 350 );
if ($prefs->{'style'} eq 'doughnut'){
$chart->setDonutSize(390,120,100,20);
if ( $prefs->{'style'} eq 'doughnut' ) {
$chart->setDonutSize( 390, 120, 100, 20 );
} else {
$chart->setPieSize( 390, 120, 100 );
}
}
else {
} else {
$chart = new PieChart( 920, 500 );
if ($prefs->{'style'} eq 'doughnut'){
$chart->setDonutSize(450,200,170,50);
if ( $prefs->{'style'} eq 'doughnut' ) {
$chart->setDonutSize( 450, 200, 170, 50 );
} else {
$chart->setPieSize( 450, 200, 170 );
}
}
$chart->setLabelFormat("{label} ({value} - {percent}%)");
{
no warnings 'once';
......@@ -95,41 +92,40 @@ sub piechart {
}
sub barchart {
my ( $labels, $data, $filename, $size, $prefs ) = @_;
my $max_label_length = &find_length_of_largest_label($labels);
my $preferred=10;
my $values = scalar @$labels;
my ( $labels, $data, $filename, $size, $prefs ) = @_;
my $max_label_length = _find_length_of_largest_label($labels);
my $preferred = 10;
my $values = scalar @$labels;
my $display_labels;
if ($values > 50){
my $pruning_factor = int($values / 50);
if ( $values > 50 ) {
my $pruning_factor = int( $values / 50 );
#prune labels
my $i=0;
foreach (@$labels){
if ($i < $pruning_factor){
push @$display_labels,'';
my $i = 0;
foreach (@$labels) {
if ( $i < $pruning_factor ) {
push @$display_labels, '';
} else {
push @$display_labels,$_;
push @$display_labels, $_;
}
$i++;
$i=0 if $i > $pruning_factor;
$i = 0 if $i > $pruning_factor;
}
} else {
$display_labels = $labels;
}
my $y_offset = $max_label_length * 5;
$y_offset += 10 if $prefs->{'x-title'};
my $x_offset = $prefs->{'y-title'} ? 10: 0 ;
my ($chart,$layer);
my $x_offset = $prefs->{'y-title'} ? 10 : 0;
my ( $chart, $layer );
if ( $size eq 'small' ) {
$chart = new XYChart( 780, 350 );
$chart->setPlotArea( 30 + $x_offset, 20 , 710, 300 - $y_offset );
$layer = $chart->addBarLayer( $data,
$chart->gradientColor( 0, 0, 0, 350, 0xf0f0f0, 0x404080 ) );
$chart->setPlotArea( 30 + $x_offset, 20, 710, 300 - $y_offset );
$layer = $chart->addBarLayer( $data, $chart->gradientColor( 0, 0, 0, 350, 0xf0f0f0, 0x404080 ) );
} else {
$chart = new XYChart( 920, 500 );
$chart->setPlotArea( 30 + $x_offset, 20 , 800, 450 - $y_offset );
$layer = $chart->addBarLayer( $data,
$chart->gradientColor( 0, 0, 0, 500, 0xf0f0f0, 0x404080 ) );
$chart->setPlotArea( 30 + $x_offset, 20, 800, 450 - $y_offset );
$layer = $chart->addBarLayer( $data, $chart->gradientColor( 0, 0, 0, 500, 0xf0f0f0, 0x404080 ) );
}
$chart->setBackground(0x00FFFFFF);
$chart->setTransparentColor(0x00FFFFFF);
......@@ -141,30 +137,29 @@ sub barchart {
$layer->setBorderColor( -1, 1 );
my $angle = $max_label_length > 12 ? 90 : 45;
$chart->xAxis()->setLabels($display_labels)->setFontAngle($angle);
if ($prefs->{'offset_label'}){
$chart->xAxis->setTickOffset(-0.5);
if ( $prefs->{'offset_label'} ) {
$chart->xAxis->setTickOffset(-0.5);
$chart->xAxis->setLabelOffset(-0.5);
}
$chart->yAxis()->setAutoScale(0.1,0.1,1);
$chart->yAxis()->setMinTickInc(1);# if ($config{'mintick'});
if ($prefs->{'x-title'}){
$chart->xAxis->setTitle($prefs->{'x-title'});
$chart->yAxis()->setAutoScale( 0.1, 0.1, 1 );
$chart->yAxis()->setMinTickInc(1); # if ($config{'mintick'});
if ( $prefs->{'x-title'} ) {
$chart->xAxis->setTitle( $prefs->{'x-title'} );
}
if ($prefs->{'y-title'}){
$chart->yAxis->setTitle($prefs->{'y-title'});
if ( $prefs->{'y-title'} ) {
$chart->yAxis->setTitle( $prefs->{'y-title'} );
}
$chart->makeChart($filename);
}
sub find_length_of_largest_label {
sub _find_length_of_largest_label {
my ($label_ref) = @_;
my $max = 0;
foreach (@$label_ref){
if (length $_ > $max){