Adds two tests for horizontal graphs, and fixes some warnings exposed by them
[imager-graph.git] / lib / Imager / Graph / Horizontal.pm
index 2377e06..aae51cf 100644 (file)
@@ -709,6 +709,14 @@ sub _get_y_tic_width {
   my $self = shift;
 
   my $labels = $self->_get_labels();
+
+  if (!$labels) {
+    return;
+  }
+
+  my %text_info = $self->_text_style('legend')
+    or return;
+
   my $max_width = 0;
   foreach my $label (@$labels) {
     my @box = $self->_text_bbox($label, 'legend');