X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FChart;h=e5cb765bbe5adf5327c72400b6fc8bb8f1aaab52;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=881a3d6d968cbabc00384bfd3741de4e857de21c;hpb=026dc7ad72ba972f230b6709e31fa64397d75ad4;p=freeside.git diff --git a/rt/share/html/Search/Chart b/rt/share/html/Search/Chart index 881a3d6d9..e5cb765bb 100644 --- a/rt/share/html/Search/Chart +++ b/rt/share/html/Search/Chart @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -371,8 +371,14 @@ if ($chart_class eq "GD::Graph::bars") { if ( $width > $x_space_for_label ) { $can{'horizontal, one line'} = 0; } - my $y_space_for_label = $Height * 0.6 - *( 1 - ($args{'element'}-$min_value)/($max_value-$min_value) ); + my $y_space_for_label; + if ($max_value == $min_value) { + $y_space_for_label = 0; + } + else { + $y_space_for_label = $Height * 0.6 + *( 1 - ($args{'element'}-$min_value)/($max_value-$min_value) ); + } if ( $width > $y_space_for_label ) { $can{'vertical, one line'} = 0; }