Branch Coverage

blib/lib/Excel/Writer/XLSX/Chart.pm
Criterion Covered Total %
branch 640 722 88.6


line true false branch
51 0 429 if $@
154 398 20 if $self->{'_embedded'}
183 0 1013 unless (exists $arg{'values'})
187 0 1013 if ($self->{'_requires_category'} and not exists $arg{'categories'})
191 0 1013 if (@{$self->{'_series'};} == 255)
214 7 1006 if ($arg{'border'})
228 56 957 if ($pattern)
233 11 1002 if ($gradient)
265 13 1000 if ($x2_axis or $y2_axis)
270 7 1006 if (defined $arg{'gap'})
271 2 5 if ($y2_axis) { }
280 7 1006 if (defined $arg{'overlap'})
281 2 5 if ($y2_axis) { }
471 6 0 defined $_[0] ? :
473 2 4 if ($style_id < 0 or $style_id > 48)
492 0 6 unless $option
501 0 6 unless (exists $valid{$option})
535 1 2 if $args{'width'}
536 1 2 if $args{'height'}
537 1 2 if $args{'x_scale'}
538 1 2 if $args{'y_scale'}
539 1 2 if $args{'x_offset'}
540 1 2 if $args{'y_offset'}
566 2 1 if defined $args{'horizontal'}
567 2 1 if defined $args{'vertical'}
568 2 1 if defined $args{'outline'}
569 2 1 if defined $args{'show_keys'}
588 0 3 if (defined $args{'up'}{'border'})
591 1 2 if (defined $args{'down'}{'border'})
712 1045 1580 defined $arg{'visible'} ? :
717 917 1179 if ($arg{'major_gridlines'} and $arg{'major_gridlines'}{'visible'})
723 9 0 if ($arg{'minor_gridlines'} and $arg{'minor_gridlines'}{'visible'})
730 11 2614 if (defined $arg{'display_units_visible'}) { }
738 519 2106 if (defined $axis->{'_position'})
743 3 2622 if (defined $axis->{'_position_axis'})
744 2 1 if ($axis->{'_position_axis'} eq 'on_tick') { }
1 0 elsif ($axis->{'_position_axis'} eq 'between') { }
758 4 2621 if ($arg{'date_axis'})
763 1 2624 if ($arg{'text_axis'})
802 5258 60 unless $args
818 8 52 if $font->{'_size'}
821 21 39 if ($font->{'_rotation'})
841 1993 33 unless ref $data
861 81 3581 if (defined $name)
863 1 80 if (ref $name eq 'ARRAY') { }
19 61 elsif ($name =~ /^=[^!]+!\$/) { }
894 0 255 unless defined $data
895 0 255 if @$data == 0
897 3 252 if (ref $data->[0] eq 'ARRAY')
903 1 1219 unless defined $token
904 9 1210 unless $token =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/
932 4390 1303 unless $formula
939 1184 119 if (not exists $self->{'_formula_ids'}{$formula}) { }
953 114 5 unless (defined $self->{'_formula_data'}[$id])
974 187 80 if (defined $color and $color =~ /^#[0-9a-fA-F]{6}$/)
982 0 80 unless ($index)
1050 2 0 if (exists $patterns{$value}) { }
1085 1 0 if (exists $weights{$value}) { }
1107 4765 62 unless $line
1129 28 34 if (defined $dash_type)
1130 28 0 if (exists $dash_types{$dash_type}) { }
1156 3795 51 unless $fill
1176 1156 59 unless $args
1179 0 59 unless ($args->{'pattern'})
1185 0 59 unless ($args->{'fg_color'})
1251 59 0 if (exists $types{$pattern_type}) { }
1260 50 9 if (not $args->{'bg_color'}) { }
1292 1201 14 unless $args
1295 0 14 if (not $args->{'colors'} or ref $args->{'colors'} ne 'ARRAY')
1301 0 14 if (@{$args->{'colors'};} < 2)
1308 2 12 if ($args->{'positions'}) { }
1311 0 2 if (@{$args->{'positions'};} != @{$args->{'colors'};})
1318 0 5 if ($pos < 0 or $pos > 100)
1329 1 11 if (@{$args->{'colors'};} == 2) { }
10 1 elsif (@{$args->{'colors'};} == 3) { }
1 0 elsif (@{$args->{'colors'};} == 4) { }
1345 2 12 if (defined $args->{'angle'}) { }
1348 0 2 if ($angle < 0 or $angle > 359.9)
1360 3 11 if (defined $args->{'type'}) { }
1363 0 3 unless (exists $types{$type})
1388 1002 11 if not $marker and ref $marker ne 'HASH'
1413 11 0 if (defined $marker_type)
1414 6 5 if ($marker_type eq 'automatic')
1418 11 0 if (exists $types{$marker_type}) { }
1431 0 11 if ($marker->{'border'})
1445 0 11 if ($pattern)
1450 0 11 if ($gradient)
1476 1000 13 if not $trendline and ref $trendline ne 'HASH'
1493 13 0 if (exists $types{$trend_type}) { }
1505 0 13 if ($trendline->{'border'})
1519 0 13 if ($pattern)
1524 0 13 if ($gradient)
1549 2012 14 if not $args and ref $args ne 'HASH'
1578 14 0 if (exists $types{$error_type}) { }
1587 3 11 if (defined $args->{'value'})
1592 1 13 if (defined $args->{'end_style'})
1597 2 12 if (defined $args->{'direction'})
1598 1 1 if ($args->{'direction'} eq 'minus') { }
1 0 elsif ($args->{'direction'} eq 'plus') { }
1610 3 11 if (defined $args->{'plus_values'})
1613 3 11 if (defined $args->{'minus_values'})
1616 1 13 if (defined $args->{'plus_data'})
1619 1 13 if (defined $args->{'minus_data'})
1663 944 87 if not $labels and ref $labels ne 'HASH'
1669 47 40 if (my $position = $labels->{'position'})
1671 47 0 if (exists $self->{'_label_positions'}{$position}) { }
1672 11 36 if ($position eq $self->{'_label_position_default'}) { }
1686 6 81 if (my $separator = $labels->{'separator'})
1696 6 0 if (exists $separators{$separator}) { }
1709 5 82 if ($labels->{'border'})
1723 1 86 if ($pattern)
1728 1 86 if ($gradient)
1739 6 81 if ($labels->{'font'})
1743 17 70 if ($labels->{'custom'})
1749 3 22 unless (defined $label)
1757 6 16 if ($property{'value'} and $property{'value'} =~ /^=[^!]+!\$/)
1761 8 14 if ($property{'formula'})
1769 7 15 if ($property{'font'})
1777 8 14 if ($property{'border'})
1791 0 22 if ($pattern)
1796 0 22 if ($gradient)
1830 2 18 if ($arg{'color'})
1835 1 19 if ($arg{'line_weight'})
1841 2 18 if ($arg{'line_pattern'})
1844 1 1 if ($pattern eq 'none') { }
1853 1 19 if ($arg{'line_color'})
1864 13 7 if ($arg{'border'})
1878 2 18 if ($pattern)
1883 2 18 if ($gradient)
1921 2 29 if ($arg{'none'})
1929 1 30 if ($arg{'border'})
1943 0 31 if ($pattern)
1948 0 31 if ($gradient)
1981 2717 11 unless $args
1983 6 5 if ($is_text) { }
1995 0 32 unless (exists $allowable{$key})
2004 0 32 unless (exists $args->{$property})
2011 0 32 unless ($value =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/)
2017 0 32 if ($value < 0 or $value > 1)
2043 1004 9 unless $user_points
2049 18 4 if (defined $user_point)
2055 1 17 if ($user_point->{'border'})
2072 0 18 if ($pattern)
2077 0 18 if ($gradient)
2082 0 18 if ($gradient)
2108 3207 246 if (not $element->{'_line'}{'_defined'} || $element->{'_fill'}{'_defined'} || $element->{'_pattern'} || $element->{'_gradient'}) { }
2132 2613 12 unless $display_units
2146 12 0 if (exists $types{$display_units}) { }
2170 5245 5 unless $tick_type
2179 5 0 if (exists $types{$tick_type}) { }
2203 935 12 unless $series->{'_y2_axis'}
2222 12 935 if $series->{'_y2_axis'}
2245 365 12 if $args{'primary_axes'}
2246 12 365 if not $args{'primary_axes'}
2261 146 77 unless $font
2264 8 69 if $font->{'_size'}
2265 31 46 if defined $font->{'_bold'}
2266 30 47 if defined $font->{'_italic'}
2267 2 75 if defined $font->{'_underline'}
2270 32 45 if ($font->{'_baseline'} != -1)
2289 146 77 unless $font
2292 12 65 if $font->{'_name'}
2295 12 65 if defined $font->{'_pitch_family'}
2298 12 65 if defined $font->{'_charset'}
2427 419 3 if $style_id == 2
2449 1 417 if ($self->{'_title_none'}) { }
2456 5 412 if ($title = $self->{'_title_formula'}) { }
15 397 elsif ($title = $self->{'_title_name'}) { }
2507 414 4 if $val eq 'gap'
2537 8 322 if ($second_chart)
2540 4 4 if ($second_chart->{'_is_secondary'}) { }
2565 16 314 if ($self->{'_date_category'}) { }
2584 4 4 if ($second_chart and $second_chart->{'_is_secondary'})
2596 16 314 if ($self->{'_date_category'}) { }
2625 922 9 if (not $layout) { }
2652 1 8 if ($type eq 'plot')
2663 3 6 if ($type ne 'text')
2767 205 741 if ($self->{'_smooth_allowed'})
2821 11 997 if ($name = $series->{'_name_formula'}) { }
2 995 elsif ($name = $series->{'_name'}) { }
2845 193 753 if (defined $data_id)
2850 753 193 unless $formula
2857 7 186 if ($type eq 'str') { }
3 183 elsif ($type eq 'multi_str') { }
2927 1253 0 if ($type eq 'num') { }
0 0 elsif ($type eq 'str') { }
2960 0 41 if ($type eq 'num') { }
41 0 elsif ($type eq 'str') { }
2988 0 3 unless $count
3051 365 12 if ($args{'primary_axes'}) { }
3097 0 628 unless $axis_ids
3098 304 324 unless scalar @$axis_ids
3113 10 314 unless $x_axis->{'_visible'}
3126 3 321 if ($title = $x_axis->{'_formula'}) { }
17 304 elsif ($title = $x_axis->{'_name'}) { }
3157 320 4 if ($self->{'_show_crosses'} or $x_axis->{'_visible'})
3160 319 1 if (not defined $y_axis->{'_crossing'} or $y_axis->{'_crossing'} eq 'max') { }
3173 323 1 unless ($x_axis->{'_text_axis'})
3211 353 373 unless $axis_ids and scalar @$axis_ids
3226 0 373 unless $y_axis->{'_visible'}
3239 4 369 if ($title = $y_axis->{'_formula'}) { }
19 350 elsif ($title = $y_axis->{'_name'}) { }
3270 371 2 if (not defined $x_axis->{'_crossing'} or $x_axis->{'_crossing'} eq 'max') { }
3315 30 32 unless $axis_ids and scalar @$axis_ids
3330 1 31 unless $x_axis->{'_visible'}
3343 1 31 if ($title = $x_axis->{'_formula'}) { }
1 30 elsif ($title = $x_axis->{'_name'}) { }
3374 31 1 if (not defined $y_axis->{'_crossing'} or $y_axis->{'_crossing'} eq 'max') { }
3416 15 17 unless $axis_ids and scalar @$axis_ids
3433 1 16 unless $x_axis->{'_visible'}
3446 0 17 if ($title = $x_axis->{'_formula'}) { }
1 16 elsif ($title = $x_axis->{'_name'}) { }
3476 16 1 if ($self->{'_show_crosses'} or $x_axis->{'_visible'})
3479 16 0 if (not defined $y_axis->{'_crossing'} or $y_axis->{'_crossing'} eq 'max') { }
3507 3 14 if (defined $x_axis->{'_major_unit'})
3515 3 14 if (defined $x_axis->{'_minor_unit'})
3566 745 1 unless $val
3586 5 742 if $reverse
3605 739 7 unless defined $max
3624 739 7 unless defined $min
3644 5 742 if ($reverse)
3645 3 2 if $val eq 'l'
3646 2 3 if $val eq 'b'
3671 8 416 if ($format_code ne $axis->{'_defaults'}{'num_format'})
3676 4 420 if ($axis->{'_num_format_linked'})
3705 6 320 if ($format_code ne $axis->{'_defaults'}{'num_format'})
3711 2 324 if ($axis->{'_num_format_linked'})
3716 253 73 if (not $self->{'_cat_has_num_fmt'} and $default_format)
3761 739 7 unless $val
3780 744 2 unless $val
3799 2 745 if ($val eq 'next_to')
3888 1 324 if ($val eq 'right')
3892 1 324 if ($val eq 'left')
3930 339 2 unless $val
3949 340 1 unless $val
3968 376 371 unless $gridlines
3969 0 371 unless $gridlines->{'_visible'}
3971 2 369 if ($gridlines->{'_line'}{'_defined'}) { }
3996 737 9 unless $gridlines
3997 0 9 unless $gridlines->{'_visible'}
3999 2 7 if ($gridlines->{'_line'}{'_defined'}) { }
4042 416 6 unless $val
4061 416 6 unless $val
4118 4 369 if (defined $legend->{'_delete_series'} and ref $legend->{'_delete_series'} eq 'ARRAY')
4124 5 368 if ($position =~ s/^overlay_//)
4136 3 370 if $position eq 'none'
4137 1 369 unless exists $allowed{$position}
4157 5 364 if $overlay
4163 2 367 if ($font)
4240 1 418 if $self->{'_show_hidden_data'}
4370 1 52 if $overlay
4401 1 12 if $overlay
4465 24 0 if (defined $data_id)
4494 18 0 if ($font and exists $font->{'_rotation'})
4526 18 150 if (not defined $rot and $is_y_axis)
4530 39 129 if (defined $rot)
4531 4 35 if ($rot == 16200000) { }
4 31 elsif ($rot == 16260000) { }
4583 55 5 unless ($ignore_rich_pr)
4672 11 48 if $font and $font->{'_color'}
4674 16 147 if (@latin_attributes or $has_color) { }
4678 11 5 if ($has_color)
4682 9 7 if (@latin_attributes)
4751 4 14 if $font and $font->{'_color'}
4757 4 56 if (@latin_attributes or $has_color) { }
4761 4 0 if ($has_color)
4765 3 1 if (@latin_attributes)
4807 13 0 if ($font and exists $font->{'_rotation'})
4837 744 265 unless $marker
4838 6 259 if $marker->{'automatic'}
4847 16 243 if $size
4901 3193 234 unless _has_fill_formatting($series)
4906 51 183 if ($series->{'_fill'}{'_defined'})
4908 6 45 if ($series->{'_fill'}{'none'}) { }
4919 59 175 if ($series->{'_pattern'})
4925 14 220 if ($series->{'_gradient'})
4933 140 94 if ($series->{'_line'}{'_defined'})
4954 92 48 if (my $width = $line->{'width'})
4968 86 54 if ($line->{'none'}) { }
48 6 elsif ($line->{'color'}) { }
4980 28 112 if (my $type = $line->{'dash_type'})
5017 108 0 if ($fill->{'color'})
5043 6 261 if ($transparency) { }
5104 995 13 unless $trendline
5118 4 9 if ($trendline->{'type'} eq 'poly')
5123 1 12 if ($trendline->{'type'} eq 'movingAvg')
5133 2 11 if (defined $trendline->{'intercept'})
5138 4 9 if ($trendline->{'display_r_squared'})
5143 6 7 if ($trendline->{'display_equation'})
5183 9 4 unless defined $data
5198 4 0 defined $_[0] ? :
5215 1 0 defined $_[0] ? :
5234 9 4 unless $val
5253 9 4 unless $val
5362 88 14 unless $hi_low_lines
5364 1 13 if ($hi_low_lines->{'_line'}{'_defined'}) { }
5391 110 4 unless $drop_lines
5393 1 3 if ($drop_lines->{'_line'}{'_defined'}) { }
5419 211 12 unless defined $val
5439 1254 0 if (defined $data)
5455 3 6065 if (defined $token and not $token =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/)
5540 18 6160 unless defined $value
5578 417 1 unless $self->{'_protection'}
5596 999 9 unless $points
5601 4 18 unless $point
5644 939 87 unless $labels
5649 17 70 if ($labels->{'custom'})
5654 4 83 if ($labels->{'num_format'})
5662 6 81 if ($labels->{'font'})
5667 36 51 if $labels->{'position'}
5670 3 84 if $labels->{'legend_key'}
5673 84 3 if $labels->{'value'}
5676 13 74 if $labels->{'category'}
5679 7 80 if $labels->{'series_name'}
5682 3 84 if $labels->{'percentage'}
5685 6 81 if $labels->{'separator'}
5688 14 73 if $labels->{'leader_lines'}
5709 3 22 unless defined $label
5716 4 18 if (defined $label->{'delete'} and $label->{'delete'}) { }
8 10 elsif (defined $label->{'formula'}) { }
7 3 elsif (defined $label->{'value'}) { }
5722 8 0 if $parent->{'value'}
5723 0 8 if $parent->{'category'}
5724 0 8 if $parent->{'series_name'}
5729 7 0 if $parent->{'value'}
5730 1 6 if $parent->{'category'}
5731 1 6 if $parent->{'series_name'}
5787 8 0 if (defined $data_id)
5819 6 5 if ($has_formatting) { }
2 3 elsif ($font) { }
5992 944 2 unless $invert
6011 724 28 unless $font
6052 327 3 unless $table
6056 1 2 if ($table->{'_horizontal'})
6062 1 2 if ($table->{'_vertical'})
6068 1 2 if ($table->{'_outline'})
6074 2 1 if ($table->{'_show_keys'})
6080 1 2 if ($table->{'_font'})
6163 0 1008 unless $error_bars
6165 2 1006 if ($error_bars->{'_x_error_bars'})
6169 12 996 if ($error_bars->{'_y_error_bars'})
6188 0 14 unless $error_bars
6201 1 13 unless ($error_bars->{'_endcap'})
6207 8 6 if ($error_bars->{'_type'} eq 'stdErr') { }
3 3 elsif ($error_bars->{'_type'} eq 'cust') { }
6323 3 0 if ($error_bars->{'_plus_values'})
6328 2 1 if (ref $error_bars->{'_plus_values'} eq 'ARRAY') { }
6339 3 0 if ($error_bars->{'_minus_values'})
6344 2 1 if (ref $error_bars->{'_minus_values'} eq 'ARRAY') { }
6384 0 8 if (defined $token and not $token =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/)
6411 100 3 unless $up_down_bars
6439 216 10 unless defined $val
6457 1 2 if ($format->{'_line'}{'_defined'} or $format->{'_fill'}{'_defined'}) { }
6483 1 2 if ($format->{'_line'}{'_defined'} or $format->{'_fill'}{'_defined'}) { }
6509 257 10 unless $smooth
6528 393 12 unless $units
6536 1 11 if ($display)
6564 11 3 if ($gradient->{'_type'} eq 'linear')
6573 11 3 if ($gradient->{'_type'} eq 'linear') { }
6681 1 2 if ($type eq 'shape') { }
6714 1 2 if ($type eq 'shape') { }