Branch Coverage

blib/lib/Imager/Graph/Pie.pm
Criterion Covered Total %
branch 108 132 81.8


line true false branch
231 3 21 unless $self->_valid_input($data_series)
236 2 19 unless $self->_get_labels(\%opts)
242 1 20 unless my $img = $self->_make_img
246 7 13 if ($$style{'title'}{'text'})
247 1 6 unless $self->_draw_title($img, \@chart_box)
259 10 0 if ($$style{'features'}{'legend'} and scalar @labels)
260 2 8 unless $self->_draw_legend($img, \@labels, \@chart_box)
270 0 17 unless defined(my $callout_outside = $self->_get_number('callout.outside'))
272 0 17 unless defined(my $callout_leadlen = $self->_get_number('callout.leadlen'))
274 0 17 unless defined(my $callout_gap = $self->_get_number('callout.gap'))
276 0 17 unless defined(my $label_vpad = $self->_get_number('label.vpad'))
278 0 17 unless defined(my $label_hpad = $self->_get_number('label.hpad'))
288 86 0 if (scalar @labels)
291 15 71 if ($$style{'features'}{'labelspconly'})
295 86 0 if ($$item{'text'})
296 24 62 if ($$style{'features'}{'labelspc'}) { }
15 47 elsif ($$style{'features'}{'labelspconly'}) { }
27 20 elsif ($$style{'features'}{'labels'}) { }
309 21 65 if $$style{'features'}{'allcallouts'}
310 65 21 unless ($$item{'callout'})
311 1 64 unless my(@lbox) = $self->_text_bbox($$item{'text'}, 'label')
314 51 13 if ($$item{'label'})
315 18 33 unless ($self->_fit_text(0, 0, 'label', $$item{'text'}, $guessradius, $$item{'begin'}, $$item{'end'}))
321 39 46 if ($$item{'callout'})
323 1 38 unless my(@cbox) = $self->_text_bbox($$item{'text'}, 'callout')
330 4 34 if ($dist < 0) { }
332 4 0 if $dist < $ebox[0]
336 29 5 if $dist > $ebox[2]
347 5 10 if ($radius > $max_width / 2)
354 10 5 if ($$style{'features'}{'dropshadow'})
355 0 10 unless my(@shadow_fill) = $self->_get_fill('dropshadow.fill')
357 0 10 unless my $offx = $self->_get_number('dropshadow.offx')
365 10 0 if $$style{'dropshadow'}{'filter'}
375 3 81 unless $$item{'begin'} < $$item{'end'}
377 0 81 unless my(@fill) = $self->_data_fill($$item{'index'}, \@fill_box)
383 6 9 if ($$style{'features'}{'outline'})
389 3 38 unless $$item{'begin'} < $$item{'end'}
394 38 2140 if $stroke_end > $$item{'end'}
410 33 51 if ($$label{'label'} and not $$label{'callout'})
413 8 25 unless (%label_text)
414 0 8 unless (%label_text) = $self->_text_style('label')
419 33 0 if (@loc) { }
430 0 0 unless my(@cbox) = $self->_text_bbox($$label{'text'}, 'callout')
436 38 46 if ($$label{'callout'})
437 12 26 unless (%callout_text)
438 0 12 unless (%callout_text) = $self->_text_style('callout')
446 4 34 $ox < $cx ? :
453 4 34 if ($lx < $cx) { }
470 0 24 unless (defined $data_series and scalar @$data_series)
474 0 24 unless @$data_series == 1
479 1 23 unless (scalar @$data)
487 1 152 if $item < 0
495 1 21 if $total == 0
520 48 86 if ($item / $total < $$self{'_style'}{'pie'}{'maxsegment'})
525 18 1 if (@others)
532 18 0 if @$labels
542 0 0 abs $res < 1e-06 ? :
558 0 84 unless my(@tbox) = $self->_text_bbox($text, $name)
579 239 419 if ($goodsign * $sign < 0)
580 237 2 if (my(@p) = intersect_lines(@line, @{$entry{'line'};})) { }
595 204 452 if ($dist2 > $radius * $radius)
600 70 338 if ($p[0] < $cx and $tcx + $pos < $p[0]) { }
106 366 elsif ($p[0] > $cx and $tcx + $pos > $p[0]) { }
612 41 41 $lines[0]{'left'} > $lines[1]{'left'} ? :
613 44 38 $lines[0]{'right'} < $lines[1]{'right'} ? :
614 16 66 if $right - $left < $tbox[2]