The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 026
MANIFEST 0122
META.json 11
META.yml 11
README 11
examples/chart_doughnut.pl 33
examples/chart_pie.pl 11
examples/headers.pl 2039
lib/Excel/Writer/XLSX/Chart/Area.pm 15
lib/Excel/Writer/XLSX/Chart/Bar.pm 110
lib/Excel/Writer/XLSX/Chart/Column.pm 19
lib/Excel/Writer/XLSX/Chart/Doughnut.pm 11
lib/Excel/Writer/XLSX/Chart/Line.pm 114
lib/Excel/Writer/XLSX/Chart/Pie.pm 110
lib/Excel/Writer/XLSX/Chart/Radar.pm 15
lib/Excel/Writer/XLSX/Chart/Scatter.pm 114
lib/Excel/Writer/XLSX/Chart/Stock.pm 114
lib/Excel/Writer/XLSX/Chart.pm 35203
lib/Excel/Writer/XLSX/Chartsheet.pm 11
lib/Excel/Writer/XLSX/Drawing.pm 11
lib/Excel/Writer/XLSX/Examples.pm 108130
lib/Excel/Writer/XLSX/Format.pm 11
lib/Excel/Writer/XLSX/Package/App.pm 11
lib/Excel/Writer/XLSX/Package/Comments.pm 11
lib/Excel/Writer/XLSX/Package/ContentTypes.pm 11
lib/Excel/Writer/XLSX/Package/Core.pm 11
lib/Excel/Writer/XLSX/Package/Packager.pm 1165
lib/Excel/Writer/XLSX/Package/Relationships.pm 11
lib/Excel/Writer/XLSX/Package/SharedStrings.pm 11
lib/Excel/Writer/XLSX/Package/Styles.pm 11
lib/Excel/Writer/XLSX/Package/Table.pm 11
lib/Excel/Writer/XLSX/Package/Theme.pm 11
lib/Excel/Writer/XLSX/Package/VML.pm 10243
lib/Excel/Writer/XLSX/Package/XMLwriter.pm 11
lib/Excel/Writer/XLSX/Shape.pm 11
lib/Excel/Writer/XLSX/Utility.pm 624
lib/Excel/Writer/XLSX/Workbook.pm 85191
lib/Excel/Writer/XLSX/Worksheet.pm 54208
lib/Excel/Writer/XLSX.pm 240
t/chart/sub_write_d_lbls.t 8114
t/lib/TestFunctions.pm 11
t/package/vml/vml_01.t 19
t/package/vml/vml_03.t 070
t/regression/chart_axis35.t 087
t/regression/chart_axis36.t 087
t/regression/chart_axis37.t 088
t/regression/chart_axis38.t 085
t/regression/chart_axis39.t 091
t/regression/chart_data_labels01.t 090
t/regression/chart_data_labels02.t 090
t/regression/chart_data_labels03.t 090
t/regression/chart_data_labels04.t 090
t/regression/chart_data_labels05.t 093
t/regression/chart_data_labels06.t 093
t/regression/chart_data_labels07.t 083
t/regression/chart_data_labels08.t 089
t/regression/chart_data_labels09.t 090
t/regression/chart_data_labels10.t 090
t/regression/chart_data_labels11.t 080
t/regression/chart_data_labels12.t 080
t/regression/chart_data_labels13.t 080
t/regression/chart_data_labels14.t 080
t/regression/chart_data_labels15.t 080
t/regression/chart_data_labels16.t 083
t/regression/chart_data_labels17.t 0106
t/regression/chart_data_labels18.t 093
t/regression/chart_data_labels19.t 093
t/regression/chart_data_labels20.t 087
t/regression/chart_data_labels21.t 091
t/regression/chart_data_labels22.t 090
t/regression/chart_data_labels23.t 093
t/regression/chart_scatter15.t 086
t/regression/header01.t 069
t/regression/header02.t 069
t/regression/header03.t 069
t/regression/header_image01.t 069
t/regression/header_image02.t 075
t/regression/header_image03.t 076
t/regression/header_image04.t 076
t/regression/header_image05.t 073
t/regression/header_image06.t 077
t/regression/header_image07.t 070
t/regression/header_image08.t 076
t/regression/header_image09.t 079
t/regression/header_image10.t 079
t/regression/header_image11.t 069
t/regression/header_image12.t 069
t/regression/header_image13.t 076
t/regression/header_image14.t 076
t/regression/image22.t 068
t/regression/image23.t 070
t/regression/image24.t 068
t/regression/image25.t 068
t/regression/image26.t 070
t/regression/image27.t 068
t/regression/images/black_150.jpg --
t/regression/images/black_150.png --
t/regression/images/black_150e.png --
t/regression/images/black_300.jpg --
t/regression/images/black_300.png --
t/regression/images/black_300e.png --
t/regression/images/black_72.jpg --
t/regression/images/black_72.png --
t/regression/images/black_72e.png --
t/regression/images/black_96.jpg --
t/regression/images/black_96.png --
t/regression/quote_name01.t 094
t/regression/quote_name02.t 087
t/regression/quote_name03.t 087
t/regression/xlsx_files/chart_axis35.xlsx --
t/regression/xlsx_files/chart_axis36.xlsx --
t/regression/xlsx_files/chart_axis37.xlsx --
t/regression/xlsx_files/chart_axis38.xlsx --
t/regression/xlsx_files/chart_axis39.xlsx --
t/regression/xlsx_files/chart_data_labels01.xlsx --
t/regression/xlsx_files/chart_data_labels02.xlsx --
t/regression/xlsx_files/chart_data_labels03.xlsx --
t/regression/xlsx_files/chart_data_labels04.xlsx --
t/regression/xlsx_files/chart_data_labels05.xlsx --
t/regression/xlsx_files/chart_data_labels06.xlsx --
t/regression/xlsx_files/chart_data_labels07.xlsx --
t/regression/xlsx_files/chart_data_labels08.xlsx --
t/regression/xlsx_files/chart_data_labels09.xlsx --
t/regression/xlsx_files/chart_data_labels10.xlsx --
t/regression/xlsx_files/chart_data_labels11.xlsx --
t/regression/xlsx_files/chart_data_labels12.xlsx --
t/regression/xlsx_files/chart_data_labels13.xlsx --
t/regression/xlsx_files/chart_data_labels14.xlsx --
t/regression/xlsx_files/chart_data_labels15.xlsx --
t/regression/xlsx_files/chart_data_labels16.xlsx --
t/regression/xlsx_files/chart_data_labels17.xlsx --
t/regression/xlsx_files/chart_data_labels18.xlsx --
t/regression/xlsx_files/chart_data_labels19.xlsx --
t/regression/xlsx_files/chart_data_labels20.xlsx --
t/regression/xlsx_files/chart_data_labels21.xlsx --
t/regression/xlsx_files/chart_data_labels22.xlsx --
t/regression/xlsx_files/chart_data_labels23.xlsx --
t/regression/xlsx_files/chart_scatter15.xlsx --
t/regression/xlsx_files/header01.xlsx --
t/regression/xlsx_files/header02.xlsx --
t/regression/xlsx_files/header03.xlsx --
t/regression/xlsx_files/header_image01.xlsx --
t/regression/xlsx_files/header_image02.xlsx --
t/regression/xlsx_files/header_image03.xlsx --
t/regression/xlsx_files/header_image04.xlsx --
t/regression/xlsx_files/header_image05.xlsx --
t/regression/xlsx_files/header_image06.xlsx --
t/regression/xlsx_files/header_image07.xlsx --
t/regression/xlsx_files/header_image08.xlsx --
t/regression/xlsx_files/header_image09.xlsx --
t/regression/xlsx_files/header_image10.xlsx --
t/regression/xlsx_files/header_image11.xlsx --
t/regression/xlsx_files/header_image12.xlsx --
t/regression/xlsx_files/header_image13.xlsx --
t/regression/xlsx_files/header_image14.xlsx --
t/regression/xlsx_files/image22.xlsx --
t/regression/xlsx_files/image23.xlsx --
t/regression/xlsx_files/image24.xlsx --
t/regression/xlsx_files/image25.xlsx --
t/regression/xlsx_files/image26.xlsx --
t/regression/xlsx_files/image27.xlsx --
t/regression/xlsx_files/quote_name01.xlsx --
t/regression/xlsx_files/quote_name02.xlsx --
t/regression/xlsx_files/quote_name03.xlsx --
t/worksheet/sub_convert_date_time_01.t 11
t/worksheet/sub_convert_date_time_03.t 11
t/worksheet/sub_write_data_validations_01.t 11
t/worksheet/sub_write_data_validations_02.t 33
t/worksheet/worksheet_cond_format_12.t 11
t/worksheet/worksheet_cond_format_13.t 11
t/worksheet/worksheet_cond_format_14.t 11
t/worksheet/worksheet_cond_format_16.t 11
t/worksheet/worksheet_cond_format_17.t 11
t/worksheet/worksheet_cond_format_18.t 11
t/worksheet/worksheet_cond_format_19.t 11
175 files changed (This is a version diff) 3846086
@@ -5,6 +5,32 @@ Revision history for Perl module Excel::Writer::XLSX.
      ! Bug fix.
 
 
+0.81 2014-11-01
+
+    + Added chart axis line and fill properties.
+
+
+0.80 2014-10-29
+
+    + Chart Data Label enhancements. Added number formatting, font handling
+      (issue #106), separator (issue #107) and legend key.
+
+    + Added chart specific handling of data label positions since not all
+      positions are available for all chart types. Issue #110.
+
+
+0.79 2014-10-16
+
+    + Added option to add images to headers and footers.
+
+    + Added option to not scale heaader/footer with page.
+
+    ! Fixed issue where non 96dpi images weren’t scaled properly in Excel.
+
+    ! Fix for issue where X axis title formula was overwritten by the
+      Y axis title.
+
+
 0.78 2014-09-28
 
     + Added Doughnut chart with set_rotation() and set_hole_size()
@@ -287,6 +287,7 @@ t/package/vml/sub_write_stroke.t
 t/package/vml/sub_write_textbox.t
 t/package/vml/vml_01.t
 t/package/vml/vml_02.t
+t/package/vml/vml_03.t
 t/package/xml_writer/sub_write_xml_declaration.t
 t/regression/array_formula01.t
 t/regression/array_formula02.t
@@ -348,6 +349,11 @@ t/regression/chart_axis31.t
 t/regression/chart_axis32.t
 t/regression/chart_axis33.t
 t/regression/chart_axis34.t
+t/regression/chart_axis35.t
+t/regression/chart_axis36.t
+t/regression/chart_axis37.t
+t/regression/chart_axis38.t
+t/regression/chart_axis39.t
 t/regression/chart_bar01.t
 t/regression/chart_bar02.t
 t/regression/chart_bar03.t
@@ -397,6 +403,29 @@ t/regression/chart_crossing01.t
 t/regression/chart_crossing02.t
 t/regression/chart_crossing03.t
 t/regression/chart_crossing04.t
+t/regression/chart_data_labels01.t
+t/regression/chart_data_labels02.t
+t/regression/chart_data_labels03.t
+t/regression/chart_data_labels04.t
+t/regression/chart_data_labels05.t
+t/regression/chart_data_labels06.t
+t/regression/chart_data_labels07.t
+t/regression/chart_data_labels08.t
+t/regression/chart_data_labels09.t
+t/regression/chart_data_labels10.t
+t/regression/chart_data_labels11.t
+t/regression/chart_data_labels12.t
+t/regression/chart_data_labels13.t
+t/regression/chart_data_labels14.t
+t/regression/chart_data_labels15.t
+t/regression/chart_data_labels16.t
+t/regression/chart_data_labels17.t
+t/regression/chart_data_labels18.t
+t/regression/chart_data_labels19.t
+t/regression/chart_data_labels20.t
+t/regression/chart_data_labels21.t
+t/regression/chart_data_labels22.t
+t/regression/chart_data_labels23.t
 t/regression/chart_date01.t
 t/regression/chart_date02.t
 t/regression/chart_date03.t
@@ -511,6 +540,7 @@ t/regression/chart_scatter11.t
 t/regression/chart_scatter12.t
 t/regression/chart_scatter13.t
 t/regression/chart_scatter14.t
+t/regression/chart_scatter15.t
 t/regression/chart_size01.t
 t/regression/chart_size02.t
 t/regression/chart_size03.t
@@ -610,6 +640,23 @@ t/regression/format03.t
 t/regression/format04.t
 t/regression/format05.t
 t/regression/gridlines01.t
+t/regression/header01.t
+t/regression/header02.t
+t/regression/header03.t
+t/regression/header_image01.t
+t/regression/header_image02.t
+t/regression/header_image03.t
+t/regression/header_image04.t
+t/regression/header_image05.t
+t/regression/header_image06.t
+t/regression/header_image07.t
+t/regression/header_image08.t
+t/regression/header_image09.t
+t/regression/header_image10.t
+t/regression/header_image11.t
+t/regression/header_image12.t
+t/regression/header_image13.t
+t/regression/header_image14.t
 t/regression/hide01.t
 t/regression/hyperlink01.t
 t/regression/hyperlink02.t
@@ -650,6 +697,23 @@ t/regression/image16.t
 t/regression/image17.t
 t/regression/image18.t
 t/regression/image19.t
+t/regression/image22.t
+t/regression/image23.t
+t/regression/image24.t
+t/regression/image25.t
+t/regression/image26.t
+t/regression/image27.t
+t/regression/images/black_150.jpg
+t/regression/images/black_150.png
+t/regression/images/black_150e.png
+t/regression/images/black_300.jpg
+t/regression/images/black_300.png
+t/regression/images/black_300e.png
+t/regression/images/black_72.jpg
+t/regression/images/black_72.png
+t/regression/images/black_72e.png
+t/regression/images/black_96.jpg
+t/regression/images/black_96.png
 t/regression/images/blue.jpg
 t/regression/images/blue.png
 t/regression/images/grey.jpg
@@ -708,6 +772,9 @@ t/regression/properties01.t
 t/regression/protect01.t
 t/regression/protect02.t
 t/regression/protect03.t
+t/regression/quote_name01.t
+t/regression/quote_name02.t
+t/regression/quote_name03.t
 t/regression/repeat01.t
 t/regression/repeat02.t
 t/regression/repeat03.t
@@ -864,6 +931,11 @@ t/regression/xlsx_files/chart_axis31.xlsx
 t/regression/xlsx_files/chart_axis32.xlsx
 t/regression/xlsx_files/chart_axis33.xlsx
 t/regression/xlsx_files/chart_axis34.xlsx
+t/regression/xlsx_files/chart_axis35.xlsx
+t/regression/xlsx_files/chart_axis36.xlsx
+t/regression/xlsx_files/chart_axis37.xlsx
+t/regression/xlsx_files/chart_axis38.xlsx
+t/regression/xlsx_files/chart_axis39.xlsx
 t/regression/xlsx_files/chart_bar01.xlsx
 t/regression/xlsx_files/chart_bar02.xlsx
 t/regression/xlsx_files/chart_bar03.xlsx
@@ -912,6 +984,29 @@ t/regression/xlsx_files/chart_crossing01.xlsx
 t/regression/xlsx_files/chart_crossing02.xlsx
 t/regression/xlsx_files/chart_crossing03.xlsx
 t/regression/xlsx_files/chart_crossing04.xlsx
+t/regression/xlsx_files/chart_data_labels01.xlsx
+t/regression/xlsx_files/chart_data_labels02.xlsx
+t/regression/xlsx_files/chart_data_labels03.xlsx
+t/regression/xlsx_files/chart_data_labels04.xlsx
+t/regression/xlsx_files/chart_data_labels05.xlsx
+t/regression/xlsx_files/chart_data_labels06.xlsx
+t/regression/xlsx_files/chart_data_labels07.xlsx
+t/regression/xlsx_files/chart_data_labels08.xlsx
+t/regression/xlsx_files/chart_data_labels09.xlsx
+t/regression/xlsx_files/chart_data_labels10.xlsx
+t/regression/xlsx_files/chart_data_labels11.xlsx
+t/regression/xlsx_files/chart_data_labels12.xlsx
+t/regression/xlsx_files/chart_data_labels13.xlsx
+t/regression/xlsx_files/chart_data_labels14.xlsx
+t/regression/xlsx_files/chart_data_labels15.xlsx
+t/regression/xlsx_files/chart_data_labels16.xlsx
+t/regression/xlsx_files/chart_data_labels17.xlsx
+t/regression/xlsx_files/chart_data_labels18.xlsx
+t/regression/xlsx_files/chart_data_labels19.xlsx
+t/regression/xlsx_files/chart_data_labels20.xlsx
+t/regression/xlsx_files/chart_data_labels21.xlsx
+t/regression/xlsx_files/chart_data_labels22.xlsx
+t/regression/xlsx_files/chart_data_labels23.xlsx
 t/regression/xlsx_files/chart_date01.xlsx
 t/regression/xlsx_files/chart_date02.xlsx
 t/regression/xlsx_files/chart_date03.xlsx
@@ -1023,6 +1118,7 @@ t/regression/xlsx_files/chart_scatter10.xlsx
 t/regression/xlsx_files/chart_scatter11.xlsx
 t/regression/xlsx_files/chart_scatter12.xlsx
 t/regression/xlsx_files/chart_scatter14.xlsx
+t/regression/xlsx_files/chart_scatter15.xlsx
 t/regression/xlsx_files/chart_size01.xlsx
 t/regression/xlsx_files/chart_size04.xlsx
 t/regression/xlsx_files/chart_sparse01.xlsx
@@ -1115,6 +1211,23 @@ t/regression/xlsx_files/format03.xlsx
 t/regression/xlsx_files/format04.xlsx
 t/regression/xlsx_files/format05.xlsx
 t/regression/xlsx_files/gridlines01.xlsx
+t/regression/xlsx_files/header01.xlsx
+t/regression/xlsx_files/header02.xlsx
+t/regression/xlsx_files/header03.xlsx
+t/regression/xlsx_files/header_image01.xlsx
+t/regression/xlsx_files/header_image02.xlsx
+t/regression/xlsx_files/header_image03.xlsx
+t/regression/xlsx_files/header_image04.xlsx
+t/regression/xlsx_files/header_image05.xlsx
+t/regression/xlsx_files/header_image06.xlsx
+t/regression/xlsx_files/header_image07.xlsx
+t/regression/xlsx_files/header_image08.xlsx
+t/regression/xlsx_files/header_image09.xlsx
+t/regression/xlsx_files/header_image10.xlsx
+t/regression/xlsx_files/header_image11.xlsx
+t/regression/xlsx_files/header_image12.xlsx
+t/regression/xlsx_files/header_image13.xlsx
+t/regression/xlsx_files/header_image14.xlsx
 t/regression/xlsx_files/hide01.xlsx
 t/regression/xlsx_files/hyperlink01.xlsx
 t/regression/xlsx_files/hyperlink02.xlsx
@@ -1155,6 +1268,12 @@ t/regression/xlsx_files/image16.xlsx
 t/regression/xlsx_files/image17.xlsx
 t/regression/xlsx_files/image18.xlsx
 t/regression/xlsx_files/image19.xlsx
+t/regression/xlsx_files/image22.xlsx
+t/regression/xlsx_files/image23.xlsx
+t/regression/xlsx_files/image24.xlsx
+t/regression/xlsx_files/image25.xlsx
+t/regression/xlsx_files/image26.xlsx
+t/regression/xlsx_files/image27.xlsx
 t/regression/xlsx_files/macro01.xlsm
 t/regression/xlsx_files/merge_cells01.xlsx
 t/regression/xlsx_files/optimize01.xlsx
@@ -1199,6 +1318,9 @@ t/regression/xlsx_files/properties01.xlsx
 t/regression/xlsx_files/protect01.xlsx
 t/regression/xlsx_files/protect02.xlsx
 t/regression/xlsx_files/protect03.xlsx
+t/regression/xlsx_files/quote_name01.xlsx
+t/regression/xlsx_files/quote_name02.xlsx
+t/regression/xlsx_files/quote_name03.xlsx
 t/regression/xlsx_files/repeat01.xlsx
 t/regression/xlsx_files/repeat02.xlsx
 t/regression/xlsx_files/repeat03.xlsx
@@ -49,5 +49,5 @@
       },
       "x_MailingList" : "http://groups.google.com/group/spreadsheet-writeexcel"
    },
-   "version" : "0.78"
+   "version" : "0.81"
 }
@@ -26,4 +26,4 @@ resources:
   bugtracker: http://github.com/jmcnamara/excel-writer-xlsx/issues
   homepage: http://jmcnamara.github.com/excel-writer-xlsx/
   repository: http://github.com/jmcnamara/excel-writer-xlsx
-version: '0.78'
+version: '0.81'
@@ -69,7 +69,7 @@ INSTALLATION
 
         Unzip and untar the module as follows:
 
-            tar -zxvf Excel-Writer-XLSX-0.78.tar.gz
+            tar -zxvf Excel-Writer-XLSX-0.81.tar.gz
 
         The module can be installed using the standard Perl procedure:
 
@@ -87,7 +87,7 @@ $worksheet->insert_chart( 'C18', $chart2, 25, 10 );
 # Create an example Doughnut chart like above.
 my $chart3 = $workbook->add_chart( type => 'doughnut', embedded => 1 );
 
-# Configure the series and add user defined segment colours.
+# Configure the series.
 $chart3->add_series(
     name       => 'Doughnut sales data',
     categories => '=Sheet1!$A$2:$A$4',
@@ -111,7 +111,7 @@ $worksheet->insert_chart( 'C34', $chart3, 25, 10 );
 # Create an example Doughnut chart like above.
 my $chart4 = $workbook->add_chart( type => 'doughnut', embedded => 1 );
 
-# Configure the series and add user defined segment colours.
+# Configure the series.
 $chart4->add_series(
     name       => 'Doughnut sales data',
     categories => '=Sheet1!$A$2:$A$4',
@@ -121,7 +121,7 @@ $chart4->add_series(
 # Add a title.
 $chart4->set_title( name => 'Doughnut Chart with user defined hole size' );
 
-# Change the angle/rotation of the first segment.
+# Change the hole size.
 $chart4->set_hole_size(33);
 
 # Insert the chart into the worksheet (with an offset).
@@ -87,7 +87,7 @@ $worksheet->insert_chart( 'C18', $chart2, 25, 10 );
 # Create an example Pie chart like above.
 my $chart3 = $workbook->add_chart( type => 'pie', embedded => 1 );
 
-# Configure the series and add user defined segment colours.
+# Configure the series.
 $chart3->add_series(
     name       => 'Pie sales data',
     categories => '=Sheet1!$A$2:$A$4',
@@ -28,6 +28,9 @@
 #     &X                                      Superscript
 #     &Y                                      Subscript
 #
+#     &[Picture]          Images              Image placeholder
+#     &G                                      Same as &[Picture]
+#
 #     &&                  Miscellaneous       Literal ampersand &
 #
 # See the main Excel::Writer::XLSX documentation for more information.
@@ -61,44 +64,47 @@ $worksheet1->write( 'A1', $preview );
 
 ######################################################################
 #
-# This is an example of some of the header/footer variables.
+# A simple example to start
 #
-my $worksheet2 = $workbook->add_worksheet( 'Variables' );
-my $header2    = '&LPage &P of &N' . '&CFilename: &F' . '&RSheetname: &A';
-my $footer2    = '&LCurrent date: &D' . '&RCurrent time: &T';
+my $worksheet2 = $workbook->add_worksheet( 'Image' );
+my $header2    = '&L&[Picture]';
 
-$worksheet2->set_header( $header2 );
-$worksheet2->set_footer( $footer2 );
+# Adjust the page top margin to allow space for the header image.
+$worksheet2->set_margin_top(1.75);
+
+$worksheet2->set_header( $header2, 0.3, {image_left => 'republic.png'});
 
 $worksheet2->set_column( 'A:A', 50 );
-$worksheet2->write( 'A1',  $preview );
-$worksheet2->write( 'A21', 'Next sheet' );
-$worksheet2->set_h_pagebreaks( 20 );
+$worksheet2->write( 'A1', $preview );
 
 
 ######################################################################
 #
-# This example shows how to use more than one font
+# This is an example of some of the header/footer variables.
 #
-my $worksheet3 = $workbook->add_worksheet( 'Mixed fonts' );
-my $header3    = q(&C&"Courier New,Bold"Hello &"Arial,Italic"World);
-my $footer3    = q(&C&"Symbol"e&"Arial" = mc&X2);
+my $worksheet3 = $workbook->add_worksheet( 'Variables' );
+my $header3    = '&LPage &P of &N' . '&CFilename: &F' . '&RSheetname: &A';
+my $footer3    = '&LCurrent date: &D' . '&RCurrent time: &T';
 
 $worksheet3->set_header( $header3 );
 $worksheet3->set_footer( $footer3 );
 
 $worksheet3->set_column( 'A:A', 50 );
-$worksheet3->write( 'A1', $preview );
+$worksheet3->write( 'A1',  $preview );
+$worksheet3->write( 'A21', 'Next sheet' );
+$worksheet3->set_h_pagebreaks( 20 );
 
 
 ######################################################################
 #
-# Example of line wrapping
+# This example shows how to use more than one font
 #
-my $worksheet4 = $workbook->add_worksheet( 'Word wrap' );
-my $header4    = "&CHeading 1\nHeading 2";
+my $worksheet4 = $workbook->add_worksheet( 'Mixed fonts' );
+my $header4    = q(&C&"Courier New,Bold"Hello &"Arial,Italic"World);
+my $footer4    = q(&C&"Symbol"e&"Arial" = mc&X2);
 
 $worksheet4->set_header( $header4 );
+$worksheet4->set_footer( $footer4 );
 
 $worksheet4->set_column( 'A:A', 50 );
 $worksheet4->write( 'A1', $preview );
@@ -106,13 +112,26 @@ $worksheet4->write( 'A1', $preview );
 
 ######################################################################
 #
-# Example of inserting a literal ampersand &
+# Example of line wrapping
 #
-my $worksheet5 = $workbook->add_worksheet( 'Ampersand' );
-my $header5    = '&CCuriouser && Curiouser - Attorneys at Law';
+my $worksheet5 = $workbook->add_worksheet( 'Word wrap' );
+my $header5    = "&CHeading 1\nHeading 2";
 
 $worksheet5->set_header( $header5 );
 
 $worksheet5->set_column( 'A:A', 50 );
 $worksheet5->write( 'A1', $preview );
 
+
+######################################################################
+#
+# Example of inserting a literal ampersand &
+#
+my $worksheet6 = $workbook->add_worksheet( 'Ampersand' );
+my $header6    = '&CCuriouser && Curiouser - Attorneys at Law';
+
+$worksheet6->set_header( $header6 );
+
+$worksheet6->set_column( 'A:A', 50 );
+$worksheet6->write( 'A1', $preview );
+
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -46,6 +46,10 @@ sub new {
 
     $self->set_y_axis();
 
+    # Sset the available data label positions for this chart type.
+    $self->{_label_position_default} = 'center';
+    $self->{_label_positions} = { center => 'ctr' };
+
     bless $self, $class;
     return $self;
 }
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -53,6 +53,15 @@ sub new {
     $self->set_x_axis();
     $self->set_y_axis();
 
+    # Set the available data label positions for this chart type.
+    $self->{_label_position_default} = 'outside_end';
+    $self->{_label_positions} = {
+        center      => 'ctr',
+        inside_base => 'inBase',
+        inside_end  => 'inEnd',
+        outside_end => 'outEnd',
+    };
+
     bless $self, $class;
     return $self;
 }
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -45,6 +45,14 @@ sub new {
 
     $self->set_y_axis();
 
+    # Set the available data label positions for this chart type.
+    $self->{_label_position_default} = 'outside_end';
+    $self->{_label_positions} = {
+        center      => 'ctr',
+        inside_base => 'inBase',
+        inside_end  => 'inEnd',
+        outside_end => 'outEnd',
+    };
 
     bless $self, $class;
 
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart::Pie;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart::Pie);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -38,6 +38,19 @@ sub new {
     $self->{_default_marker} = { type => 'none' };
     $self->{_smooth_allowed} = 1;
 
+    # Set the available data label positions for this chart type.
+    $self->{_label_position_default} = 'right';
+    $self->{_label_positions} = {
+        center      => 'ctr',
+        right       => 'r',
+        left        => 'l',
+        above       => 't',
+        below       => 'b',
+        # For backward compatibility.
+        top         => 't',
+        bottom      => 'b',
+    };
+
     bless $self, $class;
     return $self;
 }
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -38,6 +38,15 @@ sub new {
     $self->{_vary_data_color} = 1;
     $self->{_rotation}        = 0;
 
+    # Set the available data label positions for this chart type.
+    $self->{_label_position_default} = 'best_fit';
+    $self->{_label_positions} = {
+        center      => 'ctr',
+        inside_end  => 'inEnd',
+        outside_end => 'outEnd',
+        best_fit    => 'bestFit',
+    };
+
     bless $self, $class;
     return $self;
 }
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -48,6 +48,10 @@ sub new {
     # Hardcode major_tick_mark for now until there is an accessor.
     $self->{_y_axis}->{_major_tick_mark} = 'cross';
 
+    # Set the available data label positions for this chart type.
+    $self->{_label_position_default} = 'center';
+    $self->{_label_positions} = { center => 'ctr' };
+
     bless $self, $class;
 
     return $self;
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -41,6 +41,19 @@ sub new {
     $self->{_val_axis_postion} = 'b';
     $self->{_smooth_allowed}   = 1;
 
+    # Set the available data label positions for this chart type.
+    $self->{_label_position_default} = 'right';
+    $self->{_label_positions} = {
+        center      => 'ctr',
+        right       => 'r',
+        left        => 'l',
+        above       => 't',
+        below       => 'b',
+        # For backward compatibility.
+        top         => 't',
+        bottom      => 'b',
+    };
+
     bless $self, $class;
     return $self;
 }
@@ -22,7 +22,7 @@ use Carp;
 use Excel::Writer::XLSX::Chart;
 
 our @ISA     = qw(Excel::Writer::XLSX::Chart);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -44,6 +44,19 @@ sub new {
     $self->set_x_axis();
     $self->set_x2_axis();
 
+    # Set the available data label positions for this chart type.
+    $self->{_label_position_default} = 'right';
+    $self->{_label_positions} = {
+        center      => 'ctr',
+        right       => 'r',
+        left        => 'l',
+        above       => 't',
+        below       => 'b',
+        # For backward compatibility.
+        top         => 't',
+        bottom      => 'b',
+    };
+
     bless $self, $class;
     return $self;
 }
@@ -26,7 +26,7 @@ use Excel::Writer::XLSX::Utility qw(xl_cell_to_rowcol
   xl_range_formula );
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -107,6 +107,9 @@ sub new {
     $self->{_cross_between}     = 'between';
     $self->{_date_category}     = 0;
 
+    $self->{_label_positions}          = {};
+    $self->{_label_position_default}   = '';
+
     bless $self, $class;
     $self->_set_default_properties();
     return $self;
@@ -702,6 +705,12 @@ sub _convert_axis_args {
     # Set the axis name layout.
     $axis->{_layout} = $self->_get_layout_properties( $arg{name_layout}, 1 );
 
+    # Set the line properties for the axis.
+    $axis->{_line} = $self->_get_line_properties( $arg{line} );
+
+    # Set the fill properties for the axis.
+    $axis->{_fill} = $self->_get_fill_properties( $arg{fill} );
+
     return $axis;
 }
 
@@ -1305,29 +1314,44 @@ sub _get_labels_properties {
     # Map user defined label positions to Excel positions.
     if ( my $position = $labels->{position} ) {
 
-        my %positions = (
-            center      => 'ctr',
-            right       => 'r',
-            left        => 'l',
-            top         => 't',
-            above       => 't',
-            bottom      => 'b',
-            below       => 'b',
-            inside_base => 'inBase',
-            inside_end  => 'inEnd',
-            outside_end => 'outEnd',
-            best_fit    => 'bestFit',
+        if ( exists $self->{_label_positions}->{$position} ) {
+            if ($position eq $self->{_label_position_default}) {
+                $labels->{position} = undef;
+            }
+            else {
+                $labels->{position} = $self->{_label_positions}->{$position};
+            }
+        }
+        else {
+            carp "Unsupported label position '$position' for this chart type";
+            return undef
+        }
+    }
+
+    # Map the user defined label separator to the Excel separator.
+    if ( my $separator = $labels->{separator} ) {
+
+        my %separators = (
+            ','  => ', ',
+            ';'  => '; ',
+            '.'  => '. ',
+            "\n" => "\n",
+            ' '  => ' '
         );
 
-        if ( exists $positions{$position} ) {
-            $labels->{position} = $positions{$position};
+        if ( exists $separators{$separator} ) {
+            $labels->{separator} = $separators{$separator};
         }
         else {
-            carp "Unknown label position '$position'";
-            $labels->{position} = $positions{$position};
+            carp "Unsupported label separator";
+            return undef
         }
     }
 
+    if ($labels->{font}) {
+        $labels->{font} = $self->_convert_font_args( $labels->{font} );
+    }
+
     return $labels;
 }
 
@@ -2370,6 +2394,9 @@ sub _write_cat_axis {
     # Write the c:tickLblPos element.
     $self->_write_tick_label_pos( $x_axis->{_label_position} );
 
+    # Write the c:spPr element for the axis line.
+    $self->_write_sp_pr( $x_axis );
+
     # Write the axis font elements.
     $self->_write_axis_font( $x_axis->{_num_font} );
 
@@ -2471,6 +2498,9 @@ sub _write_val_axis {
     # Write the c:tickLblPos element.
     $self->_write_tick_label_pos( $y_axis->{_label_position} );
 
+    # Write the c:spPr element for the axis line.
+    $self->_write_sp_pr( $y_axis );
+
     # Write the axis font elements.
     $self->_write_axis_font( $y_axis->{_num_font} );
 
@@ -2548,7 +2578,7 @@ sub _write_cat_val_axis {
     # Write the axis title elements.
     my $title;
     if ( $title = $x_axis->{_formula} ) {
-        $self->_write_title_formula( $title, $y_axis->{_data_id}, $horiz,
+        $self->_write_title_formula( $title, $x_axis->{_data_id}, $horiz,
             $x_axis->{_name_font}, $x_axis->{_layout} );
     }
     elsif ( $title = $x_axis->{_name} ) {
@@ -2565,6 +2595,9 @@ sub _write_cat_val_axis {
     # Write the c:tickLblPos element.
     $self->_write_tick_label_pos( $x_axis->{_label_position} );
 
+    # Write the c:spPr element for the axis line.
+    $self->_write_sp_pr( $x_axis );
+
     # Write the axis font elements.
     $self->_write_axis_font( $x_axis->{_num_font} );
 
@@ -2658,6 +2691,9 @@ sub _write_date_axis {
     # Write the c:tickLblPos element.
     $self->_write_tick_label_pos( $x_axis->{_label_position} );
 
+    # Write the c:spPr element for the axis line.
+    $self->_write_sp_pr( $x_axis );
+
     # Write the axis font elements.
     $self->_write_axis_font( $x_axis->{_num_font} );
 
@@ -2916,6 +2952,27 @@ sub _write_cat_number_format {
 
 ##############################################################################
 #
+# _write_number_format()
+#
+# Write the <c:numberFormat> element for data labels.
+#
+sub _write_data_label_number_format {
+
+    my $self          = shift;
+    my $format_code   = shift;
+    my $source_linked = 0;
+
+    my @attributes = (
+        'formatCode'   => $format_code,
+        'sourceLinked' => $source_linked,
+    );
+
+    $self->xml_empty_tag( 'c:numFmt', @attributes );
+}
+
+
+##############################################################################
+#
 # _write_major_tick_mark()
 #
 # Write the <c:majorTickMark> element.
@@ -4607,9 +4664,22 @@ sub _write_d_lbls {
 
     $self->xml_start_tag( 'c:dLbls' );
 
+    # Write the c:numFmt element.
+    if ( $labels->{num_format} ) {
+        $self->_write_data_label_number_format( $labels->{num_format} );
+    }
+
+    # Write the data label font elements.
+    if ($labels->{font} ) {
+        $self->_write_axis_font( $labels->{font} );
+    }
+
     # Write the c:dLblPos element.
     $self->_write_d_lbl_pos( $labels->{position} ) if $labels->{position};
 
+    # Write the c:showLegendKey element.
+    $self->_write_show_legend_key() if $labels->{legend_key};
+
     # Write the c:showVal element.
     $self->_write_show_val() if $labels->{value};
 
@@ -4622,12 +4692,30 @@ sub _write_d_lbls {
     # Write the c:showPercent element.
     $self->_write_show_percent() if $labels->{percentage};
 
+    # Write the c:separator element.
+    $self->_write_separator($labels->{separator}) if $labels->{separator};
+
     # Write the c:showLeaderLines element.
     $self->_write_show_leader_lines() if $labels->{leader_lines};
 
     $self->xml_end_tag( 'c:dLbls' );
 }
 
+##############################################################################
+#
+# _write_show_legend_key()
+#
+# Write the <c:showLegendKey> element.
+#
+sub _write_show_legend_key {
+
+    my $self = shift;
+    my $val  = 1;
+
+    my @attributes = ( 'val' => $val );
+
+    $self->xml_empty_tag( 'c:showLegendKey', @attributes );
+}
 
 ##############################################################################
 #
@@ -4696,6 +4784,19 @@ sub _write_show_percent {
     $self->xml_empty_tag( 'c:showPercent', @attributes );
 }
 
+##############################################################################
+#
+# _write_separator()
+#
+# Write the <c:separator> element.
+#
+sub _write_separator {
+
+    my $self = shift;
+    my $data = shift;
+
+    $self->xml_data_element( 'c:separator', $data );
+}
 
 ##############################################################################
 #
@@ -5544,6 +5645,8 @@ The properties that can be set are:
     name_layout
     num_font
     num_format
+    line
+    fill
     min
     max
     minor_unit
@@ -5609,7 +5712,19 @@ Set the number format for the axis. (Applicable to category and value axes).
     $chart->set_x_axis( num_format => '#,##0.00' );
     $chart->set_y_axis( num_format => '0.00%'    );
 
-The number format is similar to the Worksheet Cell Format C<num_format> apart from the fact that a format index cannot be used. The explicit format string must be used as show above. See L<Excel::Writer::XLSX/set_num_format()> for more information.
+The number format is similar to the Worksheet Cell Format C<num_format> apart from the fact that a format index cannot be used. The explicit format string must be used as shown above. See L<Excel::Writer::XLSX/set_num_format()> for more information.
+
+=item * C<line>
+
+Set the properties of the axis line type such as colour and width. See the L</CHART FORMATTING> section below.
+
+    $chart->set_x_axis( line => { none => 1 });
+
+
+=item * C<fill>
+
+Set the fill properties of the axis such as colour. See the L</CHART FORMATTING> section below. Note, in Excel the axis fill is applied to the area of the numbers of the axis and not to the area of the axis bounding box. That background is set from the chartarea fill.
+
 
 =item * C<min>
 
@@ -6233,7 +6348,7 @@ Several of these properties can be set in one go:
         },
     );
 
-Trendlines cannot be added to series in a stacked chart or pie chart, radar chart, doughtnut or (when implemented) to 3D, or surface charts.
+Trendlines cannot be added to series in a stacked chart or pie chart, radar chart, doughnut or (when implemented) to 3D, or surface charts.
 
 =head2 Error Bars
 
@@ -6332,9 +6447,12 @@ The following properties can be set for C<data_labels> formats in a chart.
     category
     series_name
     position
-    leader_lines
     percentage
-
+    leader_lines
+    separator
+    legend_key
+    num_format
+    font
 
 The C<value> property turns on the I<Value> data label for a series.
 
@@ -6365,19 +6483,23 @@ The C<position> property is used to position the data label for a series.
         data_labels => { value => 1, position => 'center' },
     );
 
-Valid positions are:
+In Excel the data label positions vary for different chart types. The allowable positions are:
 
-    center
-    right
-    left
-    top
-    bottom
-    above           # Same as top
-    below           # Same as bottom
-    inside_base     # Mainly for Column/Bar charts.
-    inside_end      # Pie chart mainly.
-    outside_end     # Pie chart mainly.
-    best_fit        # Pie chart mainly.
+    |  Position     |  Line     |  Bar      |  Pie      |  Area     |
+    |               |  Scatter  |  Column   |  Doughnut |  Radar    |
+    |               |  Stock    |           |           |           |
+    |---------------|-----------|-----------|-----------|-----------|
+    |  center       |  Yes      |  Yes      |  Yes      |  Yes*     |
+    |  right        |  Yes*     |           |           |           |
+    |  left         |  Yes      |           |           |           |
+    |  above        |  Yes      |           |           |           |
+    |  below        |  Yes      |           |           |           |
+    |  inside_base  |           |  Yes      |           |           |
+    |  inside_end   |           |  Yes      |  Yes      |           |
+    |  outside_end  |           |  Yes*     |  Yes      |           |
+    |  best_fit     |           |           |  Yes*     |           |
+
+Note: The * indicates the default position for each chart type in Excel, if a position isn't specified.
 
 The C<percentage> property is used to turn on the display of data labels as a I<Percentage> for a series. It is mainly used for pie and doughnut charts.
 
@@ -6395,6 +6517,52 @@ The C<leader_lines> property is used to turn on  I<Leader Lines> for the data la
 
 Note: Even when leader lines are turned on they aren't automatically visible in Excel or Excel::Writer::XLSX. Due to an Excel limitation (or design) leader lines only appear if the data label is moved manually or if the data labels are very close and need to be adjusted automatically.
 
+The C<separator> property is used to change the separator between multiple data label items:
+
+    $chart->add_series(
+        values      => '=Sheet1!$B$1:$B$5',
+        data_labels => { percentage => 1 },
+        data_labels => { value => 1, category => 1, separator => "\n" },
+    );
+
+The separator value must be one of the following strings:
+
+            ','
+            ';'
+            '.'
+            "\n"
+            ' '
+
+The C<legend_key> property is used to turn on  I<Legend Key> for the data label for a series:
+
+    $chart->add_series(
+        values      => '=Sheet1!$B$1:$B$5',
+        data_labels => { value => 1, legend_key => 1 },
+    );
+
+
+The C<num_format> property is used to set the number format for the data labels.
+
+    $chart->add_series(
+        values      => '=Sheet1!$A$1:$A$5',
+        data_labels => { value => 1, num_format => '#,##0.00' },
+    );
+
+The number format is similar to the Worksheet Cell Format C<num_format> apart from the fact that a format index cannot be used. The explicit format string must be used as shown above. See L<Excel::Writer::XLSX/set_num_format()> for more information.
+
+The C<font> property is used to set the font properties of the data labels in a series:
+
+    $chart->add_series(
+        values      => '=Sheet1!$A$1:$A$5',
+        data_labels => {
+            value => 1,
+            font  => { name => 'Consolas' }
+        },
+    );
+
+See the L</CHART FONTS> section below.
+
+
 =head2 Points
 
 In general formatting is applied to an entire series in a chart. However, it is occasionally required to format individual points in a series. In particular this is required for Pie and Doughnut charts where each segment is represented by a point.
@@ -6584,7 +6752,7 @@ The C<fill> format is generally used in conjunction with a C<border> format whic
 
 =head1 CHART FONTS
 
-The following font properties can be set for any chart object that they apply to (and that are supported by Excel::Writer::XLSX) such as chart titles, axis labels and axis numbering. They correspond to the equivalent Worksheet cell Format object properties. See L<Excel::Writer::XLSX/FORMAT_METHODS> for more information.
+The following font properties can be set for any chart object that they apply to (and that are supported by Excel::Writer::XLSX) such as chart titles, axis labels, axis numbering and data labels. They correspond to the equivalent Worksheet cell Format object properties. See L<Excel::Writer::XLSX/FORMAT_METHODS> for more information.
 
     name
     size
@@ -20,7 +20,7 @@ use Exporter;
 use Excel::Writer::XLSX::Worksheet;
 
 our @ISA     = qw(Excel::Writer::XLSX::Worksheet);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -21,7 +21,7 @@ use Excel::Writer::XLSX::Package::XMLwriter;
 use Excel::Writer::XLSX::Worksheet;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -17,7 +17,7 @@ package Excel::Writer::XLSX::Examples;
 use strict;
 use warnings;
 
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 1;
 
@@ -278,7 +278,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/a_simple.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/a_simple.pl>
 
 =head2 Example: bug_report.pl
 
@@ -428,7 +428,7 @@ Run this program and read the output from the command line.
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/bug_report.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/bug_report.pl>
 
 =head2 Example: demo.pl
 
@@ -569,7 +569,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/demo.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/demo.pl>
 
 =head2 Example: formats.pl
 
@@ -1107,7 +1107,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/formats.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/formats.pl>
 
 =head2 Example: regions.pl
 
@@ -1174,7 +1174,7 @@ Source code for this example:
     $south->set_selection( 0, 1 );
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/regions.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/regions.pl>
 
 =head2 Example: stats.pl
 
@@ -1265,7 +1265,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/stats.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/stats.pl>
 
 =head2 Example: autofilter.pl
 
@@ -1565,7 +1565,7 @@ Source code for this example:
     East      Grape     6000      February
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/autofilter.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/autofilter.pl>
 
 =head2 Example: array_formula.pl
 
@@ -1620,7 +1620,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/array_formula.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/array_formula.pl>
 
 =head2 Example: cgi.pl
 
@@ -1695,7 +1695,7 @@ that line as shown below.
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/cgi.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/cgi.pl>
 
 =head2 Example: chart_area.pl
 
@@ -1845,7 +1845,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_area.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_area.pl>
 
 =head2 Example: chart_bar.pl
 
@@ -1995,7 +1995,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_bar.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_bar.pl>
 
 =head2 Example: chart_column.pl
 
@@ -2145,7 +2145,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_column.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_column.pl>
 
 =head2 Example: chart_line.pl
 
@@ -2224,7 +2224,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_line.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_line.pl>
 
 =head2 Example: chart_pie.pl
 
@@ -2337,7 +2337,7 @@ Source code for this example:
     # Create an example Pie chart like above.
     my $chart3 = $workbook->add_chart( type => 'pie', embedded => 1 );
     
-    # Configure the series and add user defined segment colours.
+    # Configure the series.
     $chart3->add_series(
         name       => 'Pie sales data',
         categories => '=Sheet1!$A$2:$A$4',
@@ -2358,7 +2358,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_pie.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_pie.pl>
 
 =head2 Example: chart_doughnut.pl
 
@@ -2471,7 +2471,7 @@ Source code for this example:
     # Create an example Doughnut chart like above.
     my $chart3 = $workbook->add_chart( type => 'doughnut', embedded => 1 );
     
-    # Configure the series and add user defined segment colours.
+    # Configure the series.
     $chart3->add_series(
         name       => 'Doughnut sales data',
         categories => '=Sheet1!$A$2:$A$4',
@@ -2495,7 +2495,7 @@ Source code for this example:
     # Create an example Doughnut chart like above.
     my $chart4 = $workbook->add_chart( type => 'doughnut', embedded => 1 );
     
-    # Configure the series and add user defined segment colours.
+    # Configure the series.
     $chart4->add_series(
         name       => 'Doughnut sales data',
         categories => '=Sheet1!$A$2:$A$4',
@@ -2505,7 +2505,7 @@ Source code for this example:
     # Add a title.
     $chart4->set_title( name => 'Doughnut Chart with user defined hole size' );
     
-    # Change the angle/rotation of the first segment.
+    # Change the hole size.
     $chart4->set_hole_size(33);
     
     # Insert the chart into the worksheet (with an offset).
@@ -2515,7 +2515,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_doughnut.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_doughnut.pl>
 
 =head2 Example: chart_radar.pl
 
@@ -2665,7 +2665,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_radar.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_radar.pl>
 
 =head2 Example: chart_scatter.pl
 
@@ -2893,7 +2893,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_scatter.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_scatter.pl>
 
 =head2 Example: chart_secondary_axis.pl
 
@@ -2969,7 +2969,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_secondary_axis.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_secondary_axis.pl>
 
 =head2 Example: chart_stock.pl
 
@@ -3058,7 +3058,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_stock.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_stock.pl>
 
 =head2 Example: chart_data_table.pl
 
@@ -3174,7 +3174,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_data_table.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_data_table.pl>
 
 =head2 Example: chart_data_tools.pl
 
@@ -3412,7 +3412,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/chart_data_tools.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/chart_data_tools.pl>
 
 =head2 Example: colors.pl
 
@@ -3544,7 +3544,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/colors.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/colors.pl>
 
 =head2 Example: comments1.pl
 
@@ -3595,7 +3595,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/comments1.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/comments1.pl>
 
 =head2 Example: comments2.pl
 
@@ -3967,7 +3967,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/comments2.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/comments2.pl>
 
 =head2 Example: conditional_format.pl
 
@@ -4310,7 +4310,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/conditional_format.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/conditional_format.pl>
 
 =head2 Example: data_validate.pl
 
@@ -4647,7 +4647,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/data_validate.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/data_validate.pl>
 
 =head2 Example: date_time.pl
 
@@ -4759,7 +4759,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/date_time.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/date_time.pl>
 
 =head2 Example: defined_name.pl
 
@@ -4820,7 +4820,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/defined_name.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/defined_name.pl>
 
 =head2 Example: diag_border.pl
 
@@ -4880,7 +4880,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/diag_border.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/diag_border.pl>
 
 =head2 Example: filehandle.pl
 
@@ -5004,7 +5004,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/filehandle.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/filehandle.pl>
 
 =head2 Example: headers.pl
 
@@ -5036,6 +5036,9 @@ The control characters used in the header/footer strings are:
     &X                                      Superscript
     &Y                                      Subscript
 
+    &[Picture]          Images              Image placeholder
+    &G                                      Same as &[Picture]
+
     &&                  Miscellaneous       Literal ampersand &
 
 See the main Excel::Writer::XLSX documentation for more information.
@@ -5080,6 +5083,9 @@ Source code for this example:
     #     &X                                      Superscript
     #     &Y                                      Subscript
     #
+    #     &[Picture]          Images              Image placeholder
+    #     &G                                      Same as &[Picture]
+    #
     #     &&                  Miscellaneous       Literal ampersand &
     #
     # See the main Excel::Writer::XLSX documentation for more information.
@@ -5113,44 +5119,47 @@ Source code for this example:
     
     ######################################################################
     #
-    # This is an example of some of the header/footer variables.
+    # A simple example to start
     #
-    my $worksheet2 = $workbook->add_worksheet( 'Variables' );
-    my $header2    = '&LPage &P of &N' . '&CFilename: &F' . '&RSheetname: &A';
-    my $footer2    = '&LCurrent date: &D' . '&RCurrent time: &T';
+    my $worksheet2 = $workbook->add_worksheet( 'Image' );
+    my $header2    = '&L&[Picture]';
+    
+    # Adjust the page top margin to allow space for the header image.
+    $worksheet2->set_margin_top(1.75);
     
-    $worksheet2->set_header( $header2 );
-    $worksheet2->set_footer( $footer2 );
+    $worksheet2->set_header( $header2, 0.3, {image_left => 'republic.png'});
     
     $worksheet2->set_column( 'A:A', 50 );
-    $worksheet2->write( 'A1',  $preview );
-    $worksheet2->write( 'A21', 'Next sheet' );
-    $worksheet2->set_h_pagebreaks( 20 );
+    $worksheet2->write( 'A1', $preview );
     
     
     ######################################################################
     #
-    # This example shows how to use more than one font
+    # This is an example of some of the header/footer variables.
     #
-    my $worksheet3 = $workbook->add_worksheet( 'Mixed fonts' );
-    my $header3    = q(&C&"Courier New,Bold"Hello &"Arial,Italic"World);
-    my $footer3    = q(&C&"Symbol"e&"Arial" = mc&X2);
+    my $worksheet3 = $workbook->add_worksheet( 'Variables' );
+    my $header3    = '&LPage &P of &N' . '&CFilename: &F' . '&RSheetname: &A';
+    my $footer3    = '&LCurrent date: &D' . '&RCurrent time: &T';
     
     $worksheet3->set_header( $header3 );
     $worksheet3->set_footer( $footer3 );
     
     $worksheet3->set_column( 'A:A', 50 );
-    $worksheet3->write( 'A1', $preview );
+    $worksheet3->write( 'A1',  $preview );
+    $worksheet3->write( 'A21', 'Next sheet' );
+    $worksheet3->set_h_pagebreaks( 20 );
     
     
     ######################################################################
     #
-    # Example of line wrapping
+    # This example shows how to use more than one font
     #
-    my $worksheet4 = $workbook->add_worksheet( 'Word wrap' );
-    my $header4    = "&CHeading 1\nHeading 2";
+    my $worksheet4 = $workbook->add_worksheet( 'Mixed fonts' );
+    my $header4    = q(&C&"Courier New,Bold"Hello &"Arial,Italic"World);
+    my $footer4    = q(&C&"Symbol"e&"Arial" = mc&X2);
     
     $worksheet4->set_header( $header4 );
+    $worksheet4->set_footer( $footer4 );
     
     $worksheet4->set_column( 'A:A', 50 );
     $worksheet4->write( 'A1', $preview );
@@ -5158,19 +5167,32 @@ Source code for this example:
     
     ######################################################################
     #
-    # Example of inserting a literal ampersand &
+    # Example of line wrapping
     #
-    my $worksheet5 = $workbook->add_worksheet( 'Ampersand' );
-    my $header5    = '&CCuriouser && Curiouser - Attorneys at Law';
+    my $worksheet5 = $workbook->add_worksheet( 'Word wrap' );
+    my $header5    = "&CHeading 1\nHeading 2";
     
     $worksheet5->set_header( $header5 );
     
     $worksheet5->set_column( 'A:A', 50 );
     $worksheet5->write( 'A1', $preview );
     
+    
+    ######################################################################
+    #
+    # Example of inserting a literal ampersand &
+    #
+    my $worksheet6 = $workbook->add_worksheet( 'Ampersand' );
+    my $header6    = '&CCuriouser && Curiouser - Attorneys at Law';
+    
+    $worksheet6->set_header( $header6 );
+    
+    $worksheet6->set_column( 'A:A', 50 );
+    $worksheet6->write( 'A1', $preview );
+    
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/headers.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/headers.pl>
 
 =head2 Example: hide_row_col.pl
 
@@ -5230,7 +5252,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/hide_row_col.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/hide_row_col.pl>
 
 =head2 Example: hide_sheet.pl
 
@@ -5281,7 +5303,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/hide_sheet.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/hide_sheet.pl>
 
 =head2 Example: hyperlink1.pl
 
@@ -5360,7 +5382,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/hyperlink1.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/hyperlink1.pl>
 
 =head2 Example: hyperlink2.pl
 
@@ -5529,7 +5551,7 @@ See also hyperlink1.pl for web URL examples.
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/hyperlink2.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/hyperlink2.pl>
 
 =head2 Example: indent.pl
 
@@ -5580,7 +5602,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/indent.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/indent.pl>
 
 =head2 Example: macros.pl
 
@@ -5650,7 +5672,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/macros.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/macros.pl>
 
 =head2 Example: merge1.pl
 
@@ -5712,7 +5734,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/merge1.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/merge1.pl>
 
 =head2 Example: merge2.pl
 
@@ -5783,7 +5805,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/merge2.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/merge2.pl>
 
 =head2 Example: merge3.pl
 
@@ -5848,7 +5870,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/merge3.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/merge3.pl>
 
 =head2 Example: merge4.pl
 
@@ -5957,7 +5979,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/merge4.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/merge4.pl>
 
 =head2 Example: merge5.pl
 
@@ -6054,7 +6076,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/merge5.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/merge5.pl>
 
 =head2 Example: merge6.pl
 
@@ -6128,7 +6150,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/merge6.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/merge6.pl>
 
 =head2 Example: mod_perl1.pl
 
@@ -6253,7 +6275,7 @@ The PerlHandler name above and the package name below *have* to match.
     1;
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/mod_perl1.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/mod_perl1.pl>
 
 =head2 Example: mod_perl2.pl
 
@@ -6381,7 +6403,7 @@ The PerlResponseHandler must match the package name below.
     1;
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/mod_perl2.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/mod_perl2.pl>
 
 =head2 Example: outline.pl
 
@@ -6709,7 +6731,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/outline.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/outline.pl>
 
 =head2 Example: outline_collapsed.pl
 
@@ -6945,7 +6967,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/outline_collapsed.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/outline_collapsed.pl>
 
 =head2 Example: panes.pl
 
@@ -7098,7 +7120,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/panes.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/panes.pl>
 
 =head2 Example: properties.pl
 
@@ -7153,7 +7175,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/properties.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/properties.pl>
 
 =head2 Example: protection.pl
 
@@ -7217,7 +7239,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/protection.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/protection.pl>
 
 =head2 Example: rich_strings.pl
 
@@ -7281,7 +7303,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/rich_strings.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/rich_strings.pl>
 
 =head2 Example: right_to_left.pl
 
@@ -7328,7 +7350,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/right_to_left.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/right_to_left.pl>
 
 =head2 Example: sales.pl
 
@@ -7451,7 +7473,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/sales.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/sales.pl>
 
 =head2 Example: shape1.pl
 
@@ -7504,7 +7526,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape1.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape1.pl>
 
 =head2 Example: shape2.pl
 
@@ -7577,7 +7599,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape2.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape2.pl>
 
 =head2 Example: shape3.pl
 
@@ -7629,7 +7651,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape3.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape3.pl>
 
 =head2 Example: shape4.pl
 
@@ -7706,7 +7728,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape4.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape4.pl>
 
 =head2 Example: shape5.pl
 
@@ -7766,7 +7788,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape5.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape5.pl>
 
 =head2 Example: shape6.pl
 
@@ -7826,7 +7848,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape6.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape6.pl>
 
 =head2 Example: shape7.pl
 
@@ -7915,7 +7937,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape7.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape7.pl>
 
 =head2 Example: shape8.pl
 
@@ -8003,7 +8025,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape8.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape8.pl>
 
 =head2 Example: shape_all.pl
 
@@ -8266,7 +8288,7 @@ Source code for this example:
     Tabs	squareTabs
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/shape_all.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/shape_all.pl>
 
 =head2 Example: sparklines1.pl
 
@@ -8353,7 +8375,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/sparklines1.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/sparklines1.pl>
 
 =head2 Example: sparklines2.pl
 
@@ -8780,7 +8802,7 @@ Source code for this example:
     __END__
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/sparklines2.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/sparklines2.pl>
 
 =head2 Example: stats_ext.pl
 
@@ -8879,7 +8901,7 @@ Source code for this example:
     $worksheet2->write( 'B9', 24.8,     $numformat );
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/stats_ext.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/stats_ext.pl>
 
 =head2 Example: stocks.pl
 
@@ -8978,7 +9000,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/stocks.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/stocks.pl>
 
 =head2 Example: tab_colors.pl
 
@@ -9023,7 +9045,7 @@ Source code for this example:
     $worksheet4->set_tab_color( 0x35 );    # Orange
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/tab_colors.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/tab_colors.pl>
 
 =head2 Example: tables.pl
 
@@ -9414,7 +9436,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/tables.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/tables.pl>
 
 =head2 Example: write_handler1.pl
 
@@ -9502,7 +9524,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/write_handler1.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/write_handler1.pl>
 
 =head2 Example: write_handler2.pl
 
@@ -9599,7 +9621,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/write_handler2.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/write_handler2.pl>
 
 =head2 Example: write_handler3.pl
 
@@ -9688,7 +9710,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/write_handler3.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/write_handler3.pl>
 
 =head2 Example: write_handler4.pl
 
@@ -9817,7 +9839,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/write_handler4.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/write_handler4.pl>
 
 =head2 Example: write_to_scalar.pl
 
@@ -9866,7 +9888,7 @@ An example of writing an Excel::Writer::XLSX file to a perl scalar.
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/write_to_scalar.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/write_to_scalar.pl>
 
 =head2 Example: unicode_2022_jp.pl
 
@@ -9931,7 +9953,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_2022_jp.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_2022_jp.pl>
 
 =head2 Example: unicode_8859_11.pl
 
@@ -9996,7 +10018,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_8859_11.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_8859_11.pl>
 
 =head2 Example: unicode_8859_7.pl
 
@@ -10061,7 +10083,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_8859_7.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_8859_7.pl>
 
 =head2 Example: unicode_big5.pl
 
@@ -10126,7 +10148,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_big5.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_big5.pl>
 
 =head2 Example: unicode_cp1251.pl
 
@@ -10191,7 +10213,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_cp1251.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_cp1251.pl>
 
 =head2 Example: unicode_cp1256.pl
 
@@ -10256,7 +10278,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_cp1256.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_cp1256.pl>
 
 =head2 Example: unicode_cyrillic.pl
 
@@ -10326,7 +10348,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_cyrillic.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_cyrillic.pl>
 
 =head2 Example: unicode_koi8r.pl
 
@@ -10391,7 +10413,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_koi8r.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_koi8r.pl>
 
 =head2 Example: unicode_polish_utf8.pl
 
@@ -10456,7 +10478,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_polish_utf8.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_polish_utf8.pl>
 
 =head2 Example: unicode_shift_jis.pl
 
@@ -10521,7 +10543,7 @@ Source code for this example:
     
 
 
-Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.78/examples/unicode_shift_jis.pl>
+Download this example: L<http://cpansearch.perl.org/src/JMCNAMARA/Excel-Writer-XLSX-0.81/examples/unicode_shift_jis.pl>
 
 =head1 AUTHOR
 
@@ -20,7 +20,7 @@ use Carp;
 
 
 our @ISA     = qw(Exporter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 our $AUTOLOAD;
 
 
@@ -20,7 +20,7 @@ use Carp;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -22,7 +22,7 @@ use Excel::Writer::XLSX::Utility qw(xl_rowcol_to_cell);
 
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -21,7 +21,7 @@ use Carp;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -20,7 +20,7 @@ use Carp;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -31,7 +31,7 @@ use Excel::Writer::XLSX::Package::Theme;
 use Excel::Writer::XLSX::Package::VML;
 
 our @ISA     = qw(Exporter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -284,21 +284,41 @@ sub _write_vml_files {
 
     my $index = 1;
     for my $worksheet ( @{ $self->{_workbook}->{_worksheets} } ) {
-        next unless $worksheet->{_has_vml};
 
-        my $vml = Excel::Writer::XLSX::Package::VML->new();
+        next if !$worksheet->{_has_vml} and !$worksheet->{_has_header_vml};
 
         _mkdir( $dir . '/xl' );
         _mkdir( $dir . '/xl/drawings' );
 
-        $vml->_set_xml_writer(
-            $dir . '/xl/drawings/vmlDrawing' . $index++ . '.vml' );
-        $vml->_assemble_xml_file(
-            $worksheet->{_vml_data_id},
-            $worksheet->{_vml_shape_id},
-            $worksheet->{_comments_array},
-            $worksheet->{_buttons_array},
-        );
+        if ( $worksheet->{_has_vml} ) {
+            my $vml = Excel::Writer::XLSX::Package::VML->new();
+
+            $vml->_set_xml_writer(
+                $dir . '/xl/drawings/vmlDrawing' . $index . '.vml' );
+            $vml->_assemble_xml_file(
+                $worksheet->{_vml_data_id},    $worksheet->{_vml_shape_id},
+                $worksheet->{_comments_array}, $worksheet->{_buttons_array},
+                undef
+            );
+
+            $index++;
+        }
+
+        if ( $worksheet->{_has_header_vml} ) {
+            my $vml = Excel::Writer::XLSX::Package::VML->new();
+
+            $vml->_set_xml_writer(
+                $dir . '/xl/drawings/vmlDrawing' . $index . '.vml' );
+            $vml->_assemble_xml_file(
+                $worksheet->{_vml_header_id},
+                $worksheet->{_vml_header_id} * 1024,
+                undef, undef, $worksheet->{_header_images_array}
+            );
+
+            $self->_write_vml_drawing_rels_file($worksheet, $index);
+
+            $index++;
+        }
     }
 }
 
@@ -791,6 +811,40 @@ sub _write_drawing_rels_files {
 
 ###############################################################################
 #
+# _write_vml_drawing_rels_files()
+#
+# Write the vmlDdrawing .rels files for worksheets with images in header or
+# footers.
+#
+sub _write_vml_drawing_rels_file {
+
+    my $self      = shift;
+    my $worksheet = shift;
+    my $index     = shift;
+    my $dir       = $self->{_package_dir};
+
+
+    # Create the drawing .rels dir.
+    _mkdir( $dir . '/xl' );
+    _mkdir( $dir . '/xl/drawings' );
+    _mkdir( $dir . '/xl/drawings/_rels' );
+
+    my $rels = Excel::Writer::XLSX::Package::Relationships->new();
+
+    for my $drawing_data ( @{ $worksheet->{_vml_drawing_links} } ) {
+        $rels->_add_document_relationship( @$drawing_data );
+    }
+
+    # Create the .rels file such as /xl/drawings/_rels/vmlDrawing1.vml.rels.
+    $rels->_set_xml_writer(
+        $dir . '/xl/drawings/_rels/vmlDrawing' . $index . '.vml.rels' );
+    $rels->_assemble_xml_file();
+
+}
+
+
+###############################################################################
+#
 # _add_image_files()
 #
 # Write the /xl/media/image?.xml files.
@@ -20,7 +20,7 @@ use Carp;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 our $schema_root     = 'http://schemas.openxmlformats.org';
 our $package_schema  = $schema_root . '/package/2006/relationships';
@@ -21,7 +21,7 @@ use Encode;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -20,7 +20,7 @@ use Carp;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -20,7 +20,7 @@ use Carp;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -30,7 +30,7 @@ use IO::File;
 use utf8;
 
 our @ISA     = qw(Exporter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -20,7 +20,7 @@ use Carp;
 use Excel::Writer::XLSX::Package::XMLwriter;
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -56,19 +56,21 @@ sub new {
 #
 sub _assemble_xml_file {
 
-    my $self          = shift;
-    my $data_id       = shift;
-    my $vml_shape_id  = shift;
-    my $comments_data = shift;
-    my $buttons_data  = shift;
-    my $z_index       = 1;
+    my $self               = shift;
+    my $data_id            = shift;
+    my $vml_shape_id       = shift;
+    my $comments_data      = shift;
+    my $buttons_data       = shift;
+    my $header_images_data = shift;
+    my $z_index            = 1;
+
 
     $self->_write_xml_namespace;
 
     # Write the o:shapelayout element.
     $self->_write_shapelayout( $data_id );
 
-    if ( defined $buttons_data && @$buttons_data) {
+    if ( defined $buttons_data && @$buttons_data ) {
 
         # Write the v:shapetype element.
         $self->_write_button_shapetype();
@@ -76,8 +78,7 @@ sub _assemble_xml_file {
         for my $button ( @$buttons_data ) {
 
             # Write the v:shape element.
-            $self->_write_button_shape( ++$vml_shape_id, $z_index++,
-                $button );
+            $self->_write_button_shape( ++$vml_shape_id, $z_index++, $button );
         }
     }
 
@@ -94,6 +95,19 @@ sub _assemble_xml_file {
         }
     }
 
+    if ( defined $header_images_data && @$header_images_data ) {
+
+        # Write the v:shapetype element.
+        $self->_write_image_shapetype();
+
+        my $index = 1;
+        for my $image ( @$header_images_data ) {
+
+            # Write the v:shape element.
+            $self->_write_image_shape( ++$vml_shape_id, $index++, $image );
+        }
+    }
+
 
     $self->xml_end_tag( 'xml' );
 
@@ -140,6 +154,7 @@ sub _pixels_to_points {
 #
 ###############################################################################
 
+
 ###############################################################################
 #
 # _write_xml_namespace()
@@ -279,6 +294,51 @@ sub _write_button_shapetype {
 
 ##############################################################################
 #
+# _write_image_shapetype()
+#
+# Write the <v:shapetype> element.
+#
+sub _write_image_shapetype {
+
+    my $self             = shift;
+    my $id               = '_x0000_t75';
+    my $coordsize        = '21600,21600';
+    my $spt              = 75;
+    my $o_preferrelative = 't';
+    my $path             = 'm@4@5l@4@11@9@11@9@5xe';
+    my $filled           = 'f';
+    my $stroked          = 'f';
+
+    my @attributes = (
+        'id'               => $id,
+        'coordsize'        => $coordsize,
+        'o:spt'            => $spt,
+        'o:preferrelative' => $o_preferrelative,
+        'path'             => $path,
+        'filled'           => $filled,
+        'stroked'          => $stroked,
+    );
+
+    $self->xml_start_tag( 'v:shapetype', @attributes );
+
+    # Write the v:stroke element.
+    $self->_write_stroke();
+
+    # Write the v:formulas element.
+    $self->_write_formulas();
+
+    # Write the v:path element.
+    $self->_write_image_path();
+
+    # Write the o:lock element.
+    $self->_write_aspect_ratio_lock();
+
+    $self->xml_end_tag( 'v:shapetype' );
+}
+
+
+##############################################################################
+#
 # _write_stroke()
 #
 # Write the <v:stroke> element.
@@ -340,6 +400,30 @@ sub _write_button_path {
     $self->xml_empty_tag( 'v:path', @attributes );
 }
 
+
+##############################################################################
+#
+# _write_image_path()
+#
+# Write the <v:path> element.
+#
+sub _write_image_path {
+
+    my $self            = shift;
+    my $extrusionok     = 'f';
+    my $gradientshapeok = 't';
+    my $connecttype     = 'rect';
+
+    my @attributes = (
+        'o:extrusionok'   => $extrusionok,
+        'gradientshapeok' => $gradientshapeok,
+        'o:connecttype'   => $connecttype,
+    );
+
+    $self->xml_empty_tag( 'v:path', @attributes );
+}
+
+
 ##############################################################################
 #
 # _write_shapetype_lock()
@@ -384,6 +468,26 @@ sub _write_rotation_lock {
 
 ##############################################################################
 #
+# _write_aspect_ratio_lock()
+#
+# Write the <o:lock> element.
+#
+sub _write_aspect_ratio_lock {
+
+    my $self        = shift;
+    my $ext         = 'edit';
+    my $aspectratio = 't';
+
+    my @attributes = (
+        'v:ext'       => $ext,
+        'aspectratio' => $aspectratio,
+    );
+
+    $self->xml_empty_tag( 'o:lock', @attributes );
+}
+
+##############################################################################
+#
 # _write_comment_shape()
 #
 # Write the <v:shape> element.
@@ -529,6 +633,68 @@ sub _write_button_shape {
 
 ##############################################################################
 #
+# _write_image_shape()
+#
+# Write the <v:shape> element.
+#
+sub _write_image_shape {
+
+    my $self       = shift;
+    my $id         = shift;
+    my $index      = shift;
+    my $image_data = shift;
+    my $type       = '#_x0000_t75';
+
+    # Set the shape index.
+    $id = '_x0000_s' . $id;
+
+    # Get the image parameters
+    my $width    = $image_data->[0];
+    my $height   = $image_data->[1];
+    my $name     = $image_data->[2];
+    my $position = $image_data->[3];
+    my $x_dpi    = $image_data->[4];
+    my $y_dpi    = $image_data->[5];
+
+    # Scale the height/width by the resolution, relative to 72dpi.
+    $width  = $width  * 72 / $x_dpi;
+    $height = $height * 72 / $y_dpi;
+
+    # Excel uses a rounding based around 72 and 96 dpi.
+    $width  = 72/96 * int($width  * 96/72 + 0.25);
+    $height = 72/96 * int($height * 96/72 + 0.25);
+
+    my $style =
+        'position:absolute;'
+      . 'margin-left:0;'
+      . 'margin-top:0;'
+      . 'width:'
+      . $width . 'pt;'
+      . 'height:'
+      . $height . 'pt;'
+      . 'z-index:'
+      . $index;
+
+    my @attributes = (
+        'id'     => $position,
+        'o:spid' => $id,
+        'type'   => $type,
+        'style'  => $style,
+    );
+
+    $self->xml_start_tag( 'v:shape', @attributes );
+
+    # Write the v:imagedata element.
+    $self->_write_imagedata( $index, $name );
+
+    # Write the o:lock element.
+    $self->_write_rotation_lock();
+
+    $self->xml_end_tag( 'v:shape' );
+}
+
+##############################################################################
+#
 # _write_comment_fill()
 #
 # Write the <v:fill> element.
@@ -940,6 +1106,73 @@ sub _write_fmla_macro {
     $self->xml_data_element( 'x:FmlaMacro', $data );
 }
 
+##############################################################################
+#
+# _write_imagedata()
+#
+# Write the <v:imagedata> element.
+#
+sub _write_imagedata {
+
+    my $self    = shift;
+    my $index   = shift;
+    my $o_title = shift;
+
+    my @attributes = (
+        'o:relid' => 'rId' . $index,
+        'o:title' => $o_title,
+    );
+
+    $self->xml_empty_tag( 'v:imagedata', @attributes );
+}
+
+
+
+##############################################################################
+#
+# _write_formulas()
+#
+# Write the <v:formulas> element.
+#
+sub _write_formulas {
+
+    my $self                 = shift;
+
+    $self->xml_start_tag( 'v:formulas' );
+
+    # Write the v:f elements.
+    $self->_write_f('if lineDrawn pixelLineWidth 0');
+    $self->_write_f('sum @0 1 0');
+    $self->_write_f('sum 0 0 @1');
+    $self->_write_f('prod @2 1 2');
+    $self->_write_f('prod @3 21600 pixelWidth');
+    $self->_write_f('prod @3 21600 pixelHeight');
+    $self->_write_f('sum @0 0 1');
+    $self->_write_f('prod @6 1 2');
+    $self->_write_f('prod @7 21600 pixelWidth');
+    $self->_write_f('sum @8 21600 0');
+    $self->_write_f('prod @7 21600 pixelHeight');
+    $self->_write_f('sum @10 21600 0');
+
+    $self->xml_end_tag( 'v:formulas' );
+}
+
+
+##############################################################################
+#
+# _write_f()
+#
+# Write the <v:f> element.
+#
+sub _write_f {
+
+    my $self = shift;
+    my $eqn  = shift;
+
+    my @attributes = ( 'eqn' => $eqn );
+
+    $self->xml_empty_tag( 'v:f', @attributes );
+}
 
 1;
 
@@ -21,7 +21,7 @@ use Carp;
 use IO::File;
 
 our @ISA     = qw(Exporter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 #
 # NOTE: this module is a light weight re-implementation of XML::Writer. See
@@ -20,7 +20,7 @@ use Carp;
 use Exporter;
 
 our @ISA     = qw(Exporter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 our $AUTOLOAD;
 
 ###############################################################################
@@ -21,7 +21,7 @@ use warnings;
 use autouse 'Date::Calc'  => qw(Delta_DHMS Decode_Date_EU Decode_Date_US);
 use autouse 'Date::Manip' => qw(ParseDate Date_Init);
 
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 # Row and column functions
 my @rowcol = qw(
@@ -49,7 +49,7 @@ my @dates = qw(
 
 our @ISA         = qw(Exporter);
 our @EXPORT_OK   = ();
-our @EXPORT      = ( @rowcol, @dates );
+our @EXPORT      = ( @rowcol, @dates, 'quote_sheetname' );
 our %EXPORT_TAGS = (
     rowcol => \@rowcol,
     dates  => \@dates
@@ -172,16 +172,34 @@ sub xl_range_formula {
 
     my ( $sheetname, $row_1, $row_2, $col_1, $col_2 ) = @_;
 
+    $sheetname = quote_sheetname( $sheetname );
+
+    my $range = xl_range( $row_1, $row_2, $col_1, $col_2, 1, 1,1, 1 );
+
+    return '=' . $sheetname . '!' . $range
+}
+
+
+###############################################################################
+#
+# quote_sheetname()
+#
+# Sheetnames used in references should be quoted if they contain any spaces,
+# special characters or if they look like something that isn't a sheet name.
+#
+sub quote_sheetname {
+
+    my $sheetname = $_[0];
+
     # Use Excel's conventions and quote the sheet name if it contains any
     # non-word character or if it isn't already quoted.
     if ( $sheetname =~ /\W/ && $sheetname !~ /^'/ ) {
+        # Double quote any single quotes.
+        $sheetname =~ s/'/''/g;
         $sheetname = q(') . $sheetname . q(');
     }
 
-    my $range1 = xl_rowcol_to_cell( $row_1, $col_1, 1, 1 );
-    my $range2 = xl_rowcol_to_cell( $row_2, $col_2, 1, 1 );
-
-    return '=' . $sheetname . '!' . $range1 . ':' . $range2;
+    return $sheetname;
 }
 
 
@@ -33,7 +33,7 @@ use Excel::Writer::XLSX::Package::XMLwriter;
 use Excel::Writer::XLSX::Utility qw(xl_cell_to_rowcol xl_rowcol_to_cell);
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -54,8 +54,8 @@ sub new {
     my $class = shift;
     my $self  = Excel::Writer::XLSX::Package::XMLwriter->new();
 
-    $self->{_filename}           = $_[0] || '';
-    my $options                  = $_[1] || {};
+    $self->{_filename} = $_[0] || '';
+    my $options = $_[1] || {};
 
     $self->{_tempdir}            = undef;
     $self->{_date_1904}          = 0;
@@ -523,7 +523,7 @@ sub add_format {
     }
 
     # Add the default format properties.
-    push @init_data, %{$self->{_default_format_properties}};
+    push @init_data, %{ $self->{_default_format_properties} };
 
     # Add the user defined properties.
     push @init_data, @_;
@@ -845,7 +845,7 @@ sub set_properties {
 #
 sub add_vba_project {
 
-    my $self = shift;
+    my $self        = shift;
     my $vba_project = shift;
 
     croak "No vbaProject.bin specified in add_vba_project()"
@@ -1516,34 +1516,91 @@ sub _prepare_drawings {
         my $chart_count = scalar @{ $sheet->{_charts} };
         my $image_count = scalar @{ $sheet->{_images} };
         my $shape_count = scalar @{ $sheet->{_shapes} };
-        next unless ( $chart_count + $image_count + $shape_count );
 
-        $drawing_id++;
+        my $header_image_count = scalar @{ $sheet->{_header_images} };
+        my $footer_image_count = scalar @{ $sheet->{_footer_images} };
+        my $has_drawing        = 0;
+
+
+        # Check that some image or drawing needs to be processed.
+        if (   !$chart_count
+            && !$image_count
+            && !$shape_count
+            && !$header_image_count
+            && !$footer_image_count )
+        {
+            next;
+        }
+
+        # Don't increase the drawing_id header/footer images.
+        if ( $chart_count || $image_count || $shape_count ) {
+            $drawing_id++;
+            $has_drawing = 1;
+        }
 
+        # Prepare the worksheet charts.
         for my $index ( 0 .. $chart_count - 1 ) {
             $chart_ref_id++;
             $sheet->_prepare_chart( $index, $chart_ref_id, $drawing_id );
         }
 
+        # Prepare the worksheet images.
         for my $index ( 0 .. $image_count - 1 ) {
 
             my $filename = $sheet->{_images}->[$index]->[2];
 
-            my ( $image_id, $type, $width, $height, $name ) =
+            my ( $type, $width, $height, $name, $x_dpi, $y_dpi ) =
               $self->_get_image_properties( $filename );
 
             $image_ref_id++;
 
-            $sheet->_prepare_image( $index, $image_ref_id, $drawing_id, $width,
-                $height, $name, $type );
+            $sheet->_prepare_image(
+                $index, $image_ref_id, $drawing_id,
+                $width, $height,       $name,
+                $type,  $x_dpi,        $y_dpi
+            );
         }
 
+        # Prepare the worksheet shapes.
         for my $index ( 0 .. $shape_count - 1 ) {
             $sheet->_prepare_shape( $index, $drawing_id );
         }
 
-        my $drawing = $sheet->{_drawing};
-        push @{ $self->{_drawings} }, $drawing;
+        # Prepare the header images.
+        for my $index ( 0 .. $header_image_count - 1 ) {
+
+            my $filename = $sheet->{_header_images}->[$index]->[0];
+            my $position = $sheet->{_header_images}->[$index]->[1];
+
+            my ( $type, $width, $height, $name, $x_dpi, $y_dpi ) =
+              $self->_get_image_properties( $filename );
+
+            $image_ref_id++;
+
+            $sheet->_prepare_header_image( $image_ref_id, $width, $height,
+                $name, $type, $position, $x_dpi, $y_dpi );
+        }
+
+        # Prepare the footer images.
+        for my $index ( 0 .. $footer_image_count - 1 ) {
+
+            my $filename = $sheet->{_footer_images}->[$index]->[0];
+            my $position = $sheet->{_footer_images}->[$index]->[1];
+
+            my ( $type, $width, $height, $name, $x_dpi, $y_dpi ) =
+              $self->_get_image_properties( $filename );
+
+            $image_ref_id++;
+
+            $sheet->_prepare_header_image( $image_ref_id, $width, $height,
+                $name, $type, $position, $x_dpi, $y_dpi );
+        }
+
+
+        if ( $has_drawing ) {
+            my $drawing = $sheet->{_drawing};
+            push @{ $self->{_drawings} }, $drawing;
+        }
     }
 
     # Sort the workbook charts references into the order that the were
@@ -1571,25 +1628,39 @@ sub _prepare_vml_objects {
     my $comment_id     = 0;
     my $vml_drawing_id = 0;
     my $vml_data_id    = 1;
+    my $vml_header_id  = 0;
     my $vml_shape_id   = 1024;
     my $vml_files      = 0;
     my $comment_files  = 0;
 
     for my $sheet ( @{ $self->{_worksheets} } ) {
 
-        next unless $sheet->{_has_vml};
-        $vml_files++;
-        $comment_files++ if $sheet->{_has_comments};
-        $comment_id++    if $sheet->{_has_comments};
-        $vml_drawing_id++;
+        next if !$sheet->{_has_vml} and !$sheet->{_has_header_vml};
+        $vml_files = 1;
+
+
+        if ( $sheet->{_has_vml} ) {
+
+            $comment_files++ if $sheet->{_has_comments};
+            $comment_id++    if $sheet->{_has_comments};
+            $vml_drawing_id++;
 
-        my $count =
-          $sheet->_prepare_vml_objects( $vml_data_id, $vml_shape_id,
-            $vml_drawing_id, $comment_id );
+            my $count =
+              $sheet->_prepare_vml_objects( $vml_data_id, $vml_shape_id,
+                $vml_drawing_id, $comment_id );
 
-        # Each VML file should start with a shape id incremented by 1024.
-        $vml_data_id  += 1 * int(    ( 1024 + $count ) / 1024 );
-        $vml_shape_id += 1024 * int( ( 1024 + $count ) / 1024 );
+            # Each VML file should start with a shape id incremented by 1024.
+            $vml_data_id  += 1 * int(    ( 1024 + $count ) / 1024 );
+            $vml_shape_id += 1024 * int( ( 1024 + $count ) / 1024 );
+
+        }
+
+        if ( $sheet->{_has_header_vml} ) {
+            $vml_header_id++;
+            $vml_drawing_id++;
+            $sheet->_prepare_header_vml_objects( $vml_header_id,
+                $vml_drawing_id );
+        }
     }
 
     $self->{_num_vml_files}     = $vml_files;
@@ -1840,80 +1911,59 @@ sub _get_image_properties {
     my $self     = shift;
     my $filename = shift;
 
-    my %images_seen;
-    my @image_data;
-    my @previous_images;
-    my $image_id = 1;
     my $type;
     my $width;
     my $height;
+    my $x_dpi = 96;
+    my $y_dpi = 96;
     my $image_name;
 
-    if ( not exists $images_seen{$filename} ) {
 
-        ( $image_name ) = fileparse( $filename );
+    ( $image_name ) = fileparse( $filename );
 
-        # TODO should also match seen images based on checksum.
+    # Open the image file and import the data.
+    my $fh = FileHandle->new( $filename );
+    croak "Couldn't import $filename: $!" unless defined $fh;
+    binmode $fh;
 
-        # Open the image file and import the data.
-        my $fh = FileHandle->new( $filename );
-        croak "Couldn't import $filename: $!" unless defined $fh;
-        binmode $fh;
+    # Slurp the file into a string and do some size calcs.
+    my $data = do { local $/; <$fh> };
+    my $size = length $data;
 
-        # Slurp the file into a string and do some size calcs.
-        my $data = do { local $/; <$fh> };
-        my $size = length $data;
 
-        #my $checksum   = TODO.
+    if ( unpack( 'x A3', $data ) eq 'PNG' ) {
 
-        if ( unpack( 'x A3', $data ) eq 'PNG' ) {
+        # Test for PNGs.
+        ( $type, $width, $height, $x_dpi, $y_dpi ) =
+          $self->_process_png( $data, $filename );
 
-            # Test for PNGs.
-            ( $type, $width, $height ) = $self->_process_png( $data );
-            $self->{_image_types}->{png} = 1;
-        }
-        elsif ( unpack( 'n', $data ) == 0xFFD8 ) {
-
-            # Test for JPEG files.
-            ( $type, $width, $height ) =
-              $self->_process_jpg( $data, $filename );
-
-            $self->{_image_types}->{jpeg} = 1;
-
-        }
-        elsif ( unpack( 'A2', $data ) eq 'BM' ) {
-
-            # Test for BMPs.
-            ( $type, $width, $height ) =
-              $self->_process_bmp( $data, $filename );
-
-            $self->{_image_types}->{bmp} = 1;
-        }
-        else {
+        $self->{_image_types}->{png} = 1;
+    }
+    elsif ( unpack( 'n', $data ) == 0xFFD8 ) {
 
-            # TODO. Add Image::Size to support other types.
-            croak "Unsupported image format for file: $filename\n";
-        }
+        # Test for JPEG files.
+        ( $type, $width, $height, $x_dpi, $y_dpi ) =
+          $self->_process_jpg( $data, $filename );
 
-        push @{ $self->{_images} }, [ $filename, $type ];
+        $self->{_image_types}->{jpeg} = 1;
+    }
+    elsif ( unpack( 'A2', $data ) eq 'BM' ) {
 
-        # Also store new data for use in duplicate images.
-        push @previous_images, [ $image_id, $type, $width, $height ];
-        $images_seen{$filename} = $image_id++;
+        # Test for BMPs.
+        ( $type, $width, $height ) = $self->_process_bmp( $data, $filename );
 
-        $fh->close;
+        $self->{_image_types}->{bmp} = 1;
     }
     else {
+        croak "Unsupported image format for file: $filename\n";
+    }
 
-        # We've processed this file already.
-        my $index = $images_seen{$filename} - 1;
+    push @{ $self->{_images} }, [ $filename, $type ];
 
-        # Increase image reference count.
-        $image_data[$index]->[0]++;
 
-    }
+    $fh->close;
 
-    return ( $image_id, $type, $width, $height, $image_name );
+    return ( $type, $width, $height, $image_name, $x_dpi, $y_dpi );
 }
 
 
@@ -1925,13 +1975,52 @@ sub _get_image_properties {
 #
 sub _process_png {
 
-    my $self = shift;
+    my $self     = shift;
+    my $data     = $_[0];
+    my $filename = $_[1];
 
     my $type   = 'png';
-    my $width  = unpack "N", substr $_[0], 16, 4;
-    my $height = unpack "N", substr $_[0], 20, 4;
+    my $width  = 0;
+    my $height = 0;
+    my $x_dpi  = 96;
+    my $y_dpi  = 96;
 
-    return ( $type, $width, $height );
+    my $offset      = 8;
+    my $data_length = length $data;
+
+    # Search through the image data to read the height and width in the
+    # IHDR element. Also read the DPI in the pHYs element.
+    while ( $offset < $data_length ) {
+
+        my $length = unpack "N",  substr $data, $offset + 0, 4;
+        my $type   = unpack "A4", substr $data, $offset + 4, 4;
+
+        if ( $type eq "IHDR" ) {
+            $width  = unpack "N", substr $data, $offset + 8,  4;
+            $height = unpack "N", substr $data, $offset + 12, 4;
+        }
+
+        if ( $type eq "pHYs" ) {
+            my $x_ppu = unpack "N", substr $data, $offset + 8,  4;
+            my $y_ppu = unpack "N", substr $data, $offset + 12, 4;
+            my $units = unpack "C", substr $data, $offset + 16, 1;
+
+            if ( $units == 1 ) {
+                $x_dpi = $x_ppu * 0.0254;
+                $y_dpi = $y_ppu * 0.0254;
+            }
+        }
+
+        $offset = $offset + $length + 12;
+
+        last if $type eq "IEND";
+    }
+
+    if ( not defined $height ) {
+        croak "$filename: no size data found in png image.\n";
+    }
+
+    return ( $type, $width, $height, $x_dpi, $y_dpi );
 }
 
 
@@ -2003,23 +2092,40 @@ sub _process_jpg {
     my $data     = $_[0];
     my $filename = $_[1];
     my $type     = 'jpeg';
+    my $x_dpi    = 96;
+    my $y_dpi    = 96;
     my $width;
     my $height;
 
     my $offset      = 2;
     my $data_length = length $data;
 
-    # Search through the image data to find the 0xFFC0 marker. The height and
-    # width are contained in the data for that sub element.
+    # Search through the image data to read the height and width in the
+    # 0xFFC0/C2 element. Also read the DPI in the 0xFFE0 element.
     while ( $offset < $data_length ) {
 
-        my $marker = unpack "n", substr $data, $offset, 2;
+        my $marker = unpack "n", substr $data, $offset + 0, 2;
         my $length = unpack "n", substr $data, $offset + 2, 2;
 
         if ( $marker == 0xFFC0 || $marker == 0xFFC2 ) {
             $height = unpack "n", substr $data, $offset + 5, 2;
             $width  = unpack "n", substr $data, $offset + 7, 2;
-            last;
+        }
+
+        if ( $marker == 0xFFE0 ) {
+            my $units     = unpack "C", substr $data, $offset + 11, 1;
+            my $x_density = unpack "n", substr $data, $offset + 12, 2;
+            my $y_density = unpack "n", substr $data, $offset + 14, 2;
+
+            if ( $units == 1 ) {
+                $x_dpi = $x_density;
+                $y_dpi = $y_density;
+            }
+
+            if ( $units == 2 ) {
+                $x_dpi = $x_density * 2.54;
+                $y_dpi = $y_density * 2.54;
+            }
         }
 
         $offset = $offset + $length + 2;
@@ -2030,7 +2136,7 @@ sub _process_jpg {
         croak "$filename: no size data found in jpeg image.\n";
     }
 
-    return ( $type, $width, $height );
+    return ( $type, $width, $height, $x_dpi, $y_dpi );
 }
 
 
@@ -2214,7 +2320,7 @@ sub _write_workbook_view {
     push @attributes, ( tabRatio => $tab_ratio ) if $tab_ratio != 500;
 
     # Store the firstSheet attribute when it isn't the default.
-    push @attributes, ( firstSheet => $first_sheet +1 ) if $first_sheet > 0;
+    push @attributes, ( firstSheet => $first_sheet + 1 ) if $first_sheet > 0;
 
     # Store the activeTab attribute when it isn't the first sheet.
     push @attributes, ( activeTab => $active_tab ) if $active_tab > 0;
@@ -23,11 +23,14 @@ use List::Util qw(max min);
 use Excel::Writer::XLSX::Format;
 use Excel::Writer::XLSX::Drawing;
 use Excel::Writer::XLSX::Package::XMLwriter;
-use Excel::Writer::XLSX::Utility
-  qw(xl_cell_to_rowcol xl_rowcol_to_cell xl_col_to_name xl_range);
+use Excel::Writer::XLSX::Utility qw(xl_cell_to_rowcol
+                                    xl_rowcol_to_cell
+                                    xl_col_to_name
+                                    xl_range
+                                    quote_sheetname);
 
 our @ISA     = qw(Excel::Writer::XLSX::Package::XMLwriter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -101,7 +104,10 @@ sub new {
     $self->{_header_footer_changed} = 0;
     $self->{_header}                = '';
     $self->{_footer}                = '';
-    $self->{_header_footer_aligns}  = 0;
+    $self->{_header_footer_aligns}  = 1;
+    $self->{_header_footer_scales}  = 1;
+    $self->{_header_images}         = [];
+    $self->{_footer_images}         = [];
 
     $self->{_margin_left}   = 0.7;
     $self->{_margin_right}  = 0.7;
@@ -162,14 +168,16 @@ sub new {
     $self->{_table} = {};
     $self->{_merge} = [];
 
-    $self->{_has_vml}          = 0;
-    $self->{_has_comments}     = 0;
-    $self->{_comments}         = {};
-    $self->{_comments_array}   = [];
-    $self->{_comments_author}  = '';
-    $self->{_comments_visible} = 0;
-    $self->{_vml_shape_id}     = 1024;
-    $self->{_buttons_array}    = [];
+    $self->{_has_vml}             = 0;
+    $self->{_has_header_vml}      = 0;
+    $self->{_has_comments}        = 0;
+    $self->{_comments}            = {};
+    $self->{_comments_array}      = [];
+    $self->{_comments_author}     = '';
+    $self->{_comments_visible}    = 0;
+    $self->{_vml_shape_id}        = 1024;
+    $self->{_buttons_array}       = [];
+    $self->{_header_images_array} = [];
 
     $self->{_autofilter}   = '';
     $self->{_filter_on}    = 0;
@@ -192,6 +200,7 @@ sub new {
     $self->{_external_vml_links}     = [];
     $self->{_external_table_links}   = [];
     $self->{_drawing_links}          = [];
+    $self->{_vml_drawing_links}      = [];
     $self->{_charts}                 = [];
     $self->{_images}                 = [];
     $self->{_tables}                 = [];
@@ -226,7 +235,7 @@ sub new {
         $self->{_margin_bottom}        = 1;
         $self->{_margin_header}        = 0.5;
         $self->{_margin_footer}        = 0.5;
-        $self->{_header_footer_aligns} = 1;
+        $self->{_header_footer_aligns} = 0;
     }
 
     bless $self, $class;
@@ -341,6 +350,9 @@ sub _assemble_xml_file {
     # Write the legacyDrawing element.
     $self->_write_legacy_drawing();
 
+    # Write the legacyDrawingHF element.
+    $self->_write_legacy_drawing_hf();
+
     # Write the tableParts element.
     $self->_write_table_parts();
 
@@ -827,16 +839,59 @@ sub set_paper {
 #
 sub set_header {
 
-    my $self = shift;
-    my $string = $_[0] || '';
+    my $self    = shift;
+    my $string  = $_[0] || '';
+    my $margin  = $_[1] || 0.3;
+    my $options = $_[2] || {};
+
+
+    # Replace the Excel placeholder &[Picture] with the internal &G.
+    $string =~ s/&\[Picture\]/&G/g;
 
     if ( length $string >= 255 ) {
         carp 'Header string must be less than 255 characters';
         return;
     }
 
+    if ( defined $options->{align_with_margins} ) {
+        $self->{_header_footer_aligns} = $options->{align_with_margins};
+    }
+
+    if ( defined $options->{scale_with_doc} ) {
+        $self->{_header_footer_scales} = $options->{scale_with_doc};
+    }
+
+    # Reset the array in case the function is called more than once.
+    $self->{_header_images} = [];
+
+    if ( $options->{image_left} ) {
+        push @{ $self->{_header_images} }, [ $options->{image_left}, 'LH' ];
+    }
+
+    if ( $options->{image_center} ) {
+        push @{ $self->{_header_images} }, [ $options->{image_center}, 'CH' ];
+    }
+
+    if ( $options->{image_right} ) {
+        push @{ $self->{_header_images} }, [ $options->{image_right}, 'RH' ];
+    }
+
+    my $placeholder_count = () = $string =~ /&G/g;
+    my $image_count = @{ $self->{_header_images} };
+
+    if ( $image_count != $placeholder_count ) {
+        warn "Number of header images ($image_count) doesn't match placeholder "
+          . "count ($placeholder_count) in string: $string\n";
+        $self->{_header_images} = [];
+        return;
+    }
+
+    if ( $image_count ) {
+        $self->{_has_header_vml} = 1;
+    }
+
     $self->{_header}                = $string;
-    $self->{_margin_header}         = $_[1] || 0.3;
+    $self->{_margin_header}         = $margin;
     $self->{_header_footer_changed} = 1;
 }
 
@@ -849,16 +904,59 @@ sub set_header {
 #
 sub set_footer {
 
-    my $self = shift;
-    my $string = $_[0] || '';
+    my $self    = shift;
+    my $string  = $_[0] || '';
+    my $margin  = $_[1] || 0.3;
+    my $options = $_[2] || {};
+
+
+    # Replace the Excel placeholder &[Picture] with the internal &G.
+    $string =~ s/&\[Picture\]/&G/g;
 
     if ( length $string >= 255 ) {
         carp 'Footer string must be less than 255 characters';
         return;
     }
 
+    if ( defined $options->{align_with_margins} ) {
+        $self->{_header_footer_aligns} = $options->{align_with_margins};
+    }
+
+    if ( defined $options->{scale_with_doc} ) {
+        $self->{_header_footer_scales} = $options->{scale_with_doc};
+    }
+
+    # Reset the array in case the function is called more than once.
+    $self->{_footer_images} = [];
+
+    if ( $options->{image_left} ) {
+        push @{ $self->{_footer_images} }, [ $options->{image_left}, 'LF' ];
+    }
+
+    if ( $options->{image_center} ) {
+        push @{ $self->{_footer_images} }, [ $options->{image_center}, 'CF' ];
+    }
+
+    if ( $options->{image_right} ) {
+        push @{ $self->{_footer_images} }, [ $options->{image_right}, 'RF' ];
+    }
+
+    my $placeholder_count = () = $string =~ /&G/g;
+    my $image_count = @{ $self->{_footer_images} };
+
+    if ( $image_count != $placeholder_count ) {
+        warn "Number of footer images ($image_count) doesn't match placeholder "
+          . "count ($placeholder_count) in string: $string\n";
+        $self->{_footer_images} = [];
+        return;
+    }
+
+    if ( $image_count ) {
+        $self->{_has_header_vml} = 1;
+    }
+
     $self->{_footer}                = $string;
-    $self->{_margin_footer}         = $_[1] || 0.3;
+    $self->{_margin_footer}         = $margin;
     $self->{_header_footer_changed} = 1;
 }
 
@@ -1042,7 +1140,7 @@ sub repeat_rows {
     my $area = '$' . $row_min . ':' . '$' . $row_max;
 
     # Build up the print titles "Sheet1!$1:$2"
-    my $sheetname = $self->_quote_sheetname( $self->{_name} );
+    my $sheetname = quote_sheetname( $self->{_name} );
     $area = $sheetname . "!" . $area;
 
     $self->{_repeat_rows} = $area;
@@ -1079,7 +1177,7 @@ sub repeat_columns {
     my $area = $col_min . ':' . $col_max;
 
     # Build up the print area range "=Sheet2!C1:C2"
-    my $sheetname = $self->_quote_sheetname( $self->{_name} );
+    my $sheetname = quote_sheetname( $self->{_name} );
     $area = $sheetname . "!" . $area;
 
     $self->{_repeat_cols} = $area;
@@ -1519,7 +1617,7 @@ sub _convert_name_area {
     }
 
     # Build up the print area range "Sheet1!$A$1:$C$13".
-    my $sheetname = $self->_quote_sheetname( $self->{_name} );
+    my $sheetname = quote_sheetname( $self->{_name} );
     $area = $sheetname . "!" . $area;
 
     return $area;
@@ -2039,7 +2137,7 @@ sub write_comment {
     # Check that row and col are valid and store max and min values
     return -2 if $self->_check_dimensions( $row, $col );
 
-    $self->{_has_vml}     = 1;
+    $self->{_has_vml}      = 1;
     $self->{_has_comments} = 1;
 
     # Process the properties of the cell comment.
@@ -4195,7 +4293,7 @@ sub add_sparkline {
 
 
     # Get the worksheet name for the range conversion below.
-    my $sheetname = $self->_quote_sheetname( $self->{_name} );
+    my $sheetname = quote_sheetname( $self->{_name} );
 
     # Cleanup the input ranges.
     for my $range ( @{ $sparkline->{_ranges} } ) {
@@ -4398,28 +4496,6 @@ sub _get_palette_color {
 
 ###############################################################################
 #
-# _quote_sheetname()
-#
-# Sheetnames used in references should be quoted if they contain any spaces,
-# special characters or if the look like something that isn't a sheet name.
-# TODO. We need to handle more special cases.
-#
-sub _quote_sheetname {
-
-    my $self      = shift;
-    my $sheetname = $_[0];
-
-    if ( $sheetname =~ /^Sheet\d+$/ ) {
-        return $sheetname;
-    }
-    else {
-        return qq('$sheetname');
-    }
-}
-
-
-###############################################################################
-#
 # _substitute_cellref()
 #
 # Substitute an Excel cell reference in A1 notation for  zero based row and
@@ -4624,7 +4700,7 @@ sub _check_dimensions {
 #   |  1  |(A1)._______|______      |
 #   |     |    |              |     |
 #   |     |    |              |     |
-#   +-----+----|    BITMAP    |-----+
+#   +-----+----|    Object    |-----+
 #   |     |    |              |     |
 #   |  2  |    |______________.     |
 #   |     |            |        (B2)|
@@ -5082,7 +5158,7 @@ sub _prepare_chart {
 
     my @dimensions =
       $self->_position_object_emus( $col, $row, $x_offset, $y_offset, $width,
-        $height );
+        $height);
 
     # Set the chart name for the embedded object if it has been specified.
     my $name = $chart->{_chart_name};
@@ -5239,6 +5315,8 @@ sub _prepare_image {
     my $height       = shift;
     my $name         = shift;
     my $image_type   = shift;
+    my $x_dpi        = shift;
+    my $y_dpi        = shift;
     my $drawing_type = 2;
     my $drawing;
 
@@ -5248,9 +5326,12 @@ sub _prepare_image {
     $width  *= $x_scale;
     $height *= $y_scale;
 
+    $width  *= 96 / $x_dpi;
+    $height *= 96 / $y_dpi;
+
     my @dimensions =
       $self->_position_object_emus( $col, $row, $x_offset, $y_offset, $width,
-        $height );
+        $height);
 
     # Convert from pixels to emus.
     $width  = int( 0.5 + ( $width * 9_525 ) );
@@ -5282,6 +5363,35 @@ sub _prepare_image {
 
 ###############################################################################
 #
+# _prepare_header_image()
+#
+# Set up an image without a drawing object for header/footer images.
+#
+sub _prepare_header_image {
+
+    my $self       = shift;
+    my $image_id   = shift;
+    my $width      = shift;
+    my $height     = shift;
+    my $name       = shift;
+    my $image_type = shift;
+    my $position   = shift;
+    my $x_dpi      = shift;
+    my $y_dpi      = shift;
+
+    # Strip the extension from the filename.
+    $name =~ s/\.[^\.]+$//;
+
+    push @{ $self->{_header_images_array} },
+      [ $width, $height, $name, $position, $x_dpi, $y_dpi ];
+
+    push @{ $self->{_vml_drawing_links} },
+      [ '/image', '../media/image' . $image_id . '.' . $image_type ];
+}
+
+
+###############################################################################
+#
 # insert_shape( $row, $col, $shape, $x, $y, $x_scale, $y_scale )
 #
 # Insert a shape into the worksheet.
@@ -5605,11 +5715,9 @@ sub _prepare_vml_objects {
         }
     }
 
-
     push @{ $self->{_external_vml_links} },
       [ '/vmlDrawing', '../drawings/vmlDrawing' . $vml_drawing_id . '.vml' ];
 
-
     if ( $self->{_has_comments} ) {
 
         $self->{_comments_array} = \@comments;
@@ -5633,6 +5741,26 @@ sub _prepare_vml_objects {
     return $count;
 }
 
+
+###############################################################################
+#
+# _prepare_header_vml_objects()
+#
+# Set up external linkage for VML header/footer images.
+#
+sub _prepare_header_vml_objects {
+
+    my $self           = shift;
+    my $vml_header_id  = shift;
+    my $vml_drawing_id = shift;
+
+    $self->{_vml_header_id} = $vml_header_id;
+
+    push @{ $self->{_external_vml_links} },
+      [ '/vmlDrawing', '../drawings/vmlDrawing' . $vml_drawing_id . '.vml' ];
+}
+
+
 ###############################################################################
 #
 # _prepare_tables()
@@ -7183,13 +7311,16 @@ sub _write_print_options {
 #
 sub _write_header_footer {
 
-    my $self = shift;
+    my $self       = shift;
     my @attributes = ();
 
-    if ($self->{_header_footer_aligns}) {
-        push @attributes,( 'alignWithMargins' => 0 );
+    if ( !$self->{_header_footer_scales} ) {
+        push @attributes, ( 'scaleWithDoc' => 0 );
     }
 
+    if ( !$self->{_header_footer_aligns} ) {
+        push @attributes, ( 'alignWithMargins' => 0 );
+    }
 
     if ( $self->{_header_footer_changed} ) {
         $self->xml_start_tag( 'headerFooter', @attributes );
@@ -8046,6 +8177,29 @@ sub _write_legacy_drawing {
 }
 
 
+
+##############################################################################
+#
+# _write_legacy_drawing_hf()
+#
+# Write the <legacyDrawingHF> element.
+#
+sub _write_legacy_drawing_hf {
+
+    my $self = shift;
+    my $id;
+
+    return unless $self->{_has_header_vml};
+
+    # Increment the relationship id for any drawings or comments.
+    $id = ++$self->{_rel_count};
+
+    my @attributes = ( 'r:id' => 'rId' . $id );
+
+    $self->xml_empty_tag( 'legacyDrawingHF', @attributes );
+}
+
+
 #
 # Note, the following font methods are, more or less, duplicated from the
 # Excel::Writer::XLSX::Package::Styles class. I will look at implementing
@@ -18,7 +18,7 @@ use strict;
 use Excel::Writer::XLSX::Workbook;
 
 our @ISA     = qw(Excel::Writer::XLSX::Workbook Exporter);
-our $VERSION = '0.78';
+our $VERSION = '0.81';
 
 
 ###############################################################################
@@ -50,7 +50,7 @@ Excel::Writer::XLSX - Create a new file in the Excel 2007+ XLSX format.
 
 =head1 VERSION
 
-This document refers to version 0.78 of Excel::Writer::XLSX, released September 28, 2014.
+This document refers to version 0.81 of Excel::Writer::XLSX, released November 1, 2014.
 
 
 
@@ -2583,6 +2583,9 @@ The available control character are:
     &X                                      Superscript
     &Y                                      Subscript
 
+    &[Picture]          Images              Image placeholder
+    &G                                      Same as &[Picture]
+
     &&                  Miscellaneous       Literal ampersand &
 
 
@@ -2652,6 +2655,11 @@ The information control characters act as variables that Excel will update as th
     |                                                               |
 
 
+Images can be inserted using the options shown below. Each image must have a placeholder in header string using the C<&[Picture]> or C<&G> control characters:
+
+    $worksheet->set_header( '&L&G', 0.3, { image_left => 'logo.jpg' });
+
+
 
 You can specify the font size of a section of the text by prefixing it with the control character C<&n> where C<n> is the font size:
 
@@ -2681,6 +2689,36 @@ As stated above the margin parameter is optional. As with the other margins the
 
 The header and footer margins are independent of the top and bottom margins.
 
+The available optons are:
+
+=over
+
+=item * C<image_left> The path to the image. Requires a C<&G> or C<&[Picture]> placeholder.
+
+=item * C<image_center> Same as above.
+
+=item * C<image_right> Same as above.
+
+=item * C<scale_with_doc> Scale header with document. Defaults to true.
+
+=item * C<align_with_margins> Align header to margins. Defaults to true.
+
+=back
+
+The image options must have an accompanying C<&[Picture]> or C<&G> control
+character in the header string:
+
+    $worksheet->set_header(
+        '&L&[Picture]&C&[Picture]&R&[Picture]',
+        undef, # If you don't want to change the margin.
+        {
+            image_left   => 'red.jpg',
+            image_center => 'blue.jpg',
+            image_right  => 'yellow.jpg'
+        }
+      );
+
+
 Note, the header or footer string must be less than 255 characters. Strings longer than this will not be written and a warning will be generated.
 
 The C<set_header()> method can also handle Unicode strings in C<UTF-8> format.
@@ -105,6 +105,14 @@ $expected = '<c:dLbls><c:dLblPos val="ctr"/><c:showVal val="1"/></c:dLbls>';
 $arg{data_labels} = { value => 1, position => 'center' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -122,6 +130,14 @@ $expected = '<c:dLbls><c:dLblPos val="l"/><c:showVal val="1"/></c:dLbls>';
 $arg{data_labels} = { value => 1, position => 'left' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -140,6 +156,14 @@ $expected = '<c:dLbls><c:dLblPos val="r"/><c:showVal val="1"/></c:dLbls>';
 $arg{data_labels} = { value => 1, position => 'right' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -149,14 +173,22 @@ is( $got, $expected, $caption );
 
 ###############################################################################
 #
-# Test the _write_d_lbls() method. Position = top.
+# Test the _write_d_lbls() method. Position = above.
 #
 $caption  = " \tChart: _write_d_lbls()";
 $expected = '<c:dLbls><c:dLblPos val="t"/><c:showVal val="1"/></c:dLbls>';
 
-$arg{data_labels} = { value => 1, position => 'top' };
+$arg{data_labels} = { value => 1, position => 'above' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -166,14 +198,23 @@ is( $got, $expected, $caption );
 
 ###############################################################################
 #
-# Test the _write_d_lbls() method. Position = above.
+# Test the _write_d_lbls() method. Position = top.
 #
 $caption  = " \tChart: _write_d_lbls()";
 $expected = '<c:dLbls><c:dLblPos val="t"/><c:showVal val="1"/></c:dLbls>';
 
-$arg{data_labels} = { value => 1, position => 'above' };
+$arg{data_labels} = { value => 1, position => 'top' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    top         => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -183,14 +224,22 @@ is( $got, $expected, $caption );
 
 ###############################################################################
 #
-# Test the _write_d_lbls() method. Position = bottom.
+# Test the _write_d_lbls() method. Position = below.
 #
 $caption  = " \tChart: _write_d_lbls()";
 $expected = '<c:dLbls><c:dLblPos val="b"/><c:showVal val="1"/></c:dLbls>';
 
-$arg{data_labels} = { value => 1, position => 'bottom' };
+$arg{data_labels} = { value => 1, position => 'below' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -200,14 +249,23 @@ is( $got, $expected, $caption );
 
 ###############################################################################
 #
-# Test the _write_d_lbls() method. Position = below.
+# Test the _write_d_lbls() method. Position = bottom.
 #
 $caption  = " \tChart: _write_d_lbls()";
 $expected = '<c:dLbls><c:dLblPos val="b"/><c:showVal val="1"/></c:dLbls>';
 
-$arg{data_labels} = { value => 1, position => 'below' };
+$arg{data_labels} = { value => 1, position => 'bottom' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+    bottom      => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -225,6 +283,14 @@ $expected = '<c:dLbls><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>
 $arg{data_labels} = { value => 1, leader_lines => 1 };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -242,6 +308,14 @@ $expected = '<c:dLbls><c:showVal val="1"/><c:showLeaderLines val="1"/></c:dLbls>
 $arg{data_labels} = { value => 1, leader_lines => 1, position => '' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -259,6 +333,15 @@ $expected = '<c:dLbls><c:dLblPos val="ctr"/><c:showVal val="1"/><c:showLeaderLin
 $arg{data_labels} = { value => 1, leader_lines => 1, position => 'center' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    right       => 'r',
+    left        => 'l',
+    above       => 't',
+    below       => 'b',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -276,6 +359,13 @@ $expected = '<c:dLbls><c:dLblPos val="inEnd"/><c:showVal val="1"/><c:showLeaderL
 $arg{data_labels} = { value => 1, leader_lines => 1, position => 'inside_end' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    inside_base => 'inBase',
+    inside_end  => 'inEnd',
+    outside_end => 'outEnd',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -293,6 +383,13 @@ $expected = '<c:dLbls><c:dLblPos val="outEnd"/><c:showVal val="1"/><c:showLeader
 $arg{data_labels} = { value => 1, leader_lines => 1, position => 'outside_end' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    inside_base => 'inBase',
+    inside_end  => 'inEnd',
+    outside_end => 'outEnd',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -310,6 +407,14 @@ $expected = '<c:dLbls><c:dLblPos val="bestFit"/><c:showVal val="1"/><c:showLeade
 $arg{data_labels} = { value => 1, leader_lines => 1, position => 'best_fit' };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+$chart->{_label_positions} = {
+    center      => 'ctr',
+    inside_base => 'inBase',
+    inside_end  => 'inEnd',
+    outside_end => 'outEnd',
+    best_fit    => 'bestFit',
+};
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -327,6 +432,7 @@ $expected = '<c:dLbls><c:showPercent val="1"/><c:showLeaderLines val="1"/></c:dL
 $arg{data_labels} = { leader_lines => 1, percentage => 1 };
 
 $chart  = _new_object( \$got, 'Excel::Writer::XLSX::Chart' );
+
 $labels = $chart->_get_labels_properties( $arg{data_labels} );
 
 $chart->_write_d_lbls( $labels );
@@ -242,7 +242,7 @@ sub _compare_xlsx_files {
         if ( $filename =~ m(xl/worksheets/sheet\d.xml) ) {
             $exp_xml_str =~ s/horizontalDpi="200" //;
             $exp_xml_str =~ s/verticalDpi="200" //;
-            $exp_xml_str =~ s/(<pageSetup.*) r:id="rId1"/$1/;
+            $exp_xml_str =~ s/(<pageSetup[^>]*) r:id="rId1"/$1/;
         }
 
         # Remove Chart pageMargin dimensions which are almost always different.
@@ -29,7 +29,15 @@ my $vml = _new_object( \$got, 'Excel::Writer::XLSX::Package::VML' );
 #
 $caption = " \tVML: _assemble_xml_file()";
 
-$vml->_assemble_xml_file( 1, 1024, [ [ 1, 1, 'Some text', '', undef, '#ffffe1', [ 2, 0, 15, 10, 4, 4, 15, 4, 143, 10, 128, 74 ] ] ] );
+$vml->_assemble_xml_file(
+    1, 1024,
+    [
+        [
+            1, 1, 'Some text', '', undef, '#ffffe1',
+            [ 2, 0, 15, 10, 4, 4, 15, 4, 143, 10, 128, 74 ]
+        ]
+    ]
+);
 
 $expected = _expected_vml_to_aref();
 $got      = _got_to_aref( $got );
@@ -0,0 +1,70 @@
+###############################################################################
+#
+# Tests for Excel::Writer::XLSX::Package::VML methods.
+#
+# reverse ('(c)'), September 2011, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_expected_vml_to_aref _got_to_aref _is_deep_diff _new_object);
+use strict;
+use warnings;
+use Excel::Writer::XLSX::Package::VML;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $expected;
+my $caption;
+my $got;
+my $vml = _new_object( \$got, 'Excel::Writer::XLSX::Package::VML' );
+
+
+###############################################################################
+#
+# Test the _assemble_xml_file() method.
+#
+$caption = " \tVML: _assemble_xml_file()";
+
+$vml->_assemble_xml_file(
+    1, 1024, undef, undef,
+    [ [ 32, 32, 'red', 'CH', 96, 96 ] ]
+);
+
+$expected = _expected_vml_to_aref();
+$got      = _got_to_aref( $got );
+
+_is_deep_diff( $got, $expected, $caption );
+
+__DATA__
+<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">
+  <o:shapelayout v:ext="edit">
+    <o:idmap v:ext="edit" data="1"/>
+  </o:shapelayout>
+  <v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
+    <v:stroke joinstyle="miter"/>
+    <v:formulas>
+      <v:f eqn="if lineDrawn pixelLineWidth 0"/>
+      <v:f eqn="sum @0 1 0"/>
+      <v:f eqn="sum 0 0 @1"/>
+      <v:f eqn="prod @2 1 2"/>
+      <v:f eqn="prod @3 21600 pixelWidth"/>
+      <v:f eqn="prod @3 21600 pixelHeight"/>
+      <v:f eqn="sum @0 0 1"/>
+      <v:f eqn="prod @6 1 2"/>
+      <v:f eqn="prod @7 21600 pixelWidth"/>
+      <v:f eqn="sum @8 21600 0"/>
+      <v:f eqn="prod @7 21600 pixelHeight"/>
+      <v:f eqn="sum @10 21600 0"/>
+    </v:formulas>
+    <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
+    <o:lock v:ext="edit" aspectratio="t"/>
+  </v:shapetype>
+  <v:shape id="CH" o:spid="_x0000_s1025" type="#_x0000_t75" style="position:absolute;margin-left:0;margin-top:0;width:24pt;height:24pt;z-index:1">
+    <v:imagedata o:relid="rId1" o:title="red"/>
+    <o:lock v:ext="edit" rotation="t"/>
+  </v:shape>
+</xml>
@@ -0,0 +1,87 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), November 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_axis35.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = { 'xl/charts/chart1.xml' => ['<c:pageMargins'] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 63008128, 62522496 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series( values => '=Sheet1!$A$1:$A$5' );
+$chart->add_series( values => '=Sheet1!$B$1:$B$5' );
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$chart->set_y_axis( line => { none => 1 });
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,87 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), November 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_axis36.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = { 'xl/charts/chart1.xml' => ['<c:pageMargins'] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45501056, 47505792 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series( values => '=Sheet1!$A$1:$A$5' );
+$chart->add_series( values => '=Sheet1!$B$1:$B$5' );
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$chart->set_x_axis( line => { none => 1 });
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,88 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), November 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_axis37.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = { 'xl/charts/chart1.xml' => ['<c:pageMargins'] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 46032384, 48088960 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series( values => '=Sheet1!$A$1:$A$5' );
+$chart->add_series( values => '=Sheet1!$B$1:$B$5' );
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$chart->set_x_axis( line => { color => 'yellow' });
+$chart->set_y_axis( line => { color => 'red'    });
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,85 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), November 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_axis38.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = { 'xl/charts/chart1.xml' => ['<c:pageMargins'] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45642496, 45644416 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series( values => '=Sheet1!$A$1:$A$5' );
+$chart->add_series( values => '=Sheet1!$B$1:$B$5' );
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$chart->set_y_axis( line => { color => 'yellow' },
+                    fill => { color => 'red'    });
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,91 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), November 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_axis39.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = { 'xl/charts/chart1.xml' => ['<c:pageMargins'] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'scatter', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45884928, 45883392 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$B$1:$B$5',
+);
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$C$1:$C$5',
+);
+
+$chart->set_x_axis( line => { none => 1 });
+$chart->set_y_axis( line => { none => 1 });
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,90 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels01.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45848832, 47718784 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'outside_end' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'inside_base' },
+);
+
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,90 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels02.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 47721856, 53641216 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'inside_end' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'center' },
+);
+
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,90 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels03.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'bar', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45693952, 45762816 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'outside_end' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'inside_base' },
+);
+
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,90 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels04.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'bar', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 47719168, 47720704 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'inside_end' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'center' },
+);
+
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,93 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels05.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'line', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45678592, 45680128 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'right' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'top' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$C$1:$C$5',
+    data_labels => { value => 1, position => 'bottom' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,93 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels06.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'line', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45678592, 45680128 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'right' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'left' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$C$1:$C$5',
+    data_labels => { value => 1, position => 'center' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,83 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels07.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'area', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45703168, 45705472 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'center' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,89 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels08.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'scatter', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45740416, 45705856 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'right' },
+);
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$C$1:$C$5',
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,90 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels09.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'scatter', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45740416, 45705856 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'above' },
+);
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$C$1:$C$5',
+    data_labels => { value => 1, position => 'below' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,90 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels10.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'scatter', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45740416, 45705856 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'left' },
+);
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$C$1:$C$5',
+    data_labels => { value => 1, position => 'center' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,80 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels11.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, leader_lines => 1, position => 'best_fit' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,80 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels12.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, leader_lines => 1, position => 'outside_end' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,80 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels13.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, leader_lines => 1, position => 'inside_end' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,80 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels14.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, leader_lines => 1, position => 'center' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,80 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels15.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'doughnut', embedded => 1 );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, leader_lines => 1 , position => 'best_fit'},
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,83 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels16.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'radar', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45858816, 45860352 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, position => 'center' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,106 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels17.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = { 'xl/charts/chart1.xml' => [ '<c:formatCode' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook    = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet   = $workbook->add_worksheet();
+my $chart       = $workbook->add_chart( type => 'stock', embedded => 1 );
+my $date_format = $workbook->add_format( num_format => 14 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45740032, 45747200 ];
+
+my $data = [
+
+    [ '2007-01-01T', '2007-01-02T', '2007-01-03T', '2007-01-04T', '2007-01-05T' ],
+    [ 27.2,  25.03, 19.05, 20.34, 18.5 ],
+    [ 23.49, 19.55, 15.12, 17.84, 16.34 ],
+    [ 25.45, 23.05, 17.32, 20.45, 17.34 ],
+
+];
+
+for my $row ( 0 .. 4 ) {
+    $worksheet->write_date_time( $row, 0, $data->[0]->[$row], $date_format );
+    $worksheet->write( $row, 1, $data->[1]->[$row] );
+    $worksheet->write( $row, 2, $data->[2]->[$row] );
+    $worksheet->write( $row, 3, $data->[3]->[$row] );
+
+}
+
+$worksheet->set_column( 'A:D', 11 );
+
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$B$1:$B$5',
+);
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$C$1:$C$5',
+);
+
+$chart->add_series(
+    categories => '=Sheet1!$A$1:$A$5',
+    values     => '=Sheet1!$D$1:$D$5',
+    data_labels => { value => 1, position => 'right' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,93 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels18.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45740416, 45747584 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, category => 1 },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, category => 1, separator => ';' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$C$1:$C$5',
+    data_labels => { value => 1, category => 1, separator => '.' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,93 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels19.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45740416, 45747584 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, category => 1 },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, category => 1, separator => "\n" },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$C$1:$C$5',
+    data_labels => { value => 1, category => 1, separator => ' ' },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,87 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels20.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45740032, 45743104 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, legend_key => 1 },
+);
+
+$chart->add_series( values => '=Sheet1!$B$1:$B$5' );
+
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,91 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels21.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => {
+        value        => 1,
+        category     => 1,
+        series_name  => 1,
+        percentage   => 1,
+        separator    => ';',
+        leader_lines => 1,
+        position     => 'inside_end',
+        legend_key   => 1,
+        num_format   => '#,##0.00',
+        font         => { name => 'Consolas', baseline => -1, pitch_family => 49, charset => 0 }
+    },
+);
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,90 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels22.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45705856, 45740416 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => { value => 1, num_format => '#,##0.00' },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'inside_base', num_format => '0.00' },
+);
+
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,93 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_data_labels23.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'column', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 45705856, 45740416 ];
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    values      => '=Sheet1!$A$1:$A$5',
+    data_labels => {
+        value => 1,
+        font  => { name => 'Consolas', baseline => -1, pitch_family => 49, charset => 0 }
+    },
+);
+
+$chart->add_series(
+    values      => '=Sheet1!$B$1:$B$5',
+    data_labels => { value => 1, position => 'inside_base' },
+);
+
+$chart->add_series( values => '=Sheet1!$C$1:$C$5' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,86 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'chart_scatter15.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+my $chart     = $workbook->add_chart( type => 'scatter', embedded => 1 );
+
+# For testing, copy the randomly generated axis ids in the target xlsx file.
+$chart->{_axis_ids} = [ 58843520, 58845440 ];
+
+my $data = [
+    [ 'X', 1,  3  ],
+    [ 'Y', 10, 30 ],
+
+];
+
+$worksheet->write( 'A1', $data );
+
+$chart->add_series(
+    categories => '=Sheet1!$A$2:$A$3',
+    values     => '=Sheet1!$B$2:$B$3',
+);
+
+$chart->set_x_axis( name => '=Sheet1!$A$1',
+                    name_font => { italic => 1, baseline => -1 });
+$chart->set_y_axis( name => '=Sheet1!$B$1' );
+
+$worksheet->insert_chart( 'E9', $chart );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,69 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header01.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements =
+  { 'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header( '&L&P', undef, { scale_with_doc => 0 } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,69 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header02.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements =
+  { 'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header( '&L&P', undef, { align_with_margins => 0 } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,69 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header03.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements =
+  { 'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_footer( '&L&P', undef, { scale_with_doc => 0, align_with_margins => 0 } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,69 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image01.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements =
+  { 'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header( '&L&G', undef, { image_left => $dir . 'images/red.jpg' } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,75 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image02.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {'xl/worksheets/sheet1.xml' => ['<pageMargins', '<pageSetup']};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header(
+    '&L&G&C&G',
+    undef,
+    {
+        image_left   => $dir . 'images/red.jpg',
+        image_center => $dir . 'images/blue.jpg'
+    }
+);
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,76 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image03.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {'xl/worksheets/sheet1.xml' => ['<pageMargins', '<pageSetup']};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header(
+    '&L&[Picture]&C&G&R&[Picture]',
+    undef,
+    {
+        image_left   => $dir . 'images/red.jpg',
+        image_center => $dir . 'images/blue.jpg',
+        image_right  => $dir . 'images/yellow.jpg',
+    }
+);
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,76 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image04.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {'xl/worksheets/sheet1.xml' => ['<pageMargins', '<pageSetup']};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_footer(
+    '&L&G&C&G&R&G',
+    undef,
+    {
+        image_left   => $dir . 'images/red.jpg',
+        image_center => $dir . 'images/blue.jpg',
+        image_right  => $dir . 'images/yellow.jpg',
+    }
+);
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,73 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image05.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {'xl/worksheets/sheet1.xml' => ['<pageMargins', '<pageSetup']};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header( '&L&G', undef,
+    { image_left => $dir . 'images/red.jpg' } );
+
+$worksheet->set_footer( '&L&G', undef,
+    { image_left => $dir . 'images/blue.jpg', } );
+
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,77 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image06.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {
+    'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ],
+    'xl/worksheets/sheet2.xml' => [ '<pageMargins', '<pageSetup' ]
+};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook   = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet1 = $workbook->add_worksheet();
+my $worksheet2 = $workbook->add_worksheet();
+
+
+$worksheet1->set_header( '&L&G', undef,
+    { image_left => $dir . 'images/red.jpg' } );
+
+$worksheet2->set_header( '&L&G', undef,
+    { image_left => $dir . 'images/blue.jpg', } );
+
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,70 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image07.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {'xl/worksheets/sheet1.xml' => ['<pageMargins', '<pageSetup']};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+$worksheet->insert_image('B3',  $dir . 'images/red.jpg' );
+
+$worksheet->set_header( '&L&G', undef,
+    { image_left => $dir . 'images/blue.jpg' } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,76 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image08.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements =
+  { 'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->write( 'A1', 'Foo' );
+$worksheet->write_comment( 'B2', 'Some text' );
+
+# Set the author to match the target XLSX file.
+$worksheet->set_comments_author( 'John' );
+
+$worksheet->set_header( '&L&G', undef,
+    { image_left => $dir . 'images/red.jpg' } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,79 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image09.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {
+    'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ],
+    'xl/worksheets/sheet2.xml' => [ '<pageMargins', '<pageSetup' ]
+};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook   = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet1 = $workbook->add_worksheet();
+my $worksheet2 = $workbook->add_worksheet();
+
+
+$worksheet1->write( 'A1', 'Foo' );
+$worksheet1->write_comment( 'B2', 'Some text' );
+
+# Set the author to match the target XLSX file.
+$worksheet1->set_comments_author( 'John' );
+
+$worksheet2->set_header( '&L&G', undef,
+    { image_left => $dir . 'images/red.jpg' } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,79 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image10.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {
+    'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ],
+    'xl/worksheets/sheet2.xml' => [ '<pageMargins', '<pageSetup' ]
+};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook   = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet1 = $workbook->add_worksheet();
+my $worksheet2 = $workbook->add_worksheet();
+
+
+$worksheet1->set_header( '&L&G', undef,
+    { image_left => $dir . 'images/red.jpg' } );
+
+$worksheet2->write( 'A1', 'Foo' );
+$worksheet2->write_comment( 'B2', 'Some text' );
+
+# Set the author to match the target XLSX file.
+$worksheet2->set_comments_author( 'John' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,69 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image11.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements =
+  { 'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header( '&L&G', undef, { image_left => $dir . 'images/black_300.jpg' } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,69 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image12.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements =
+  { 'xl/worksheets/sheet1.xml' => [ '<pageMargins', '<pageSetup' ] };
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header( '&L&G', undef, { image_left => $dir . 'images/black_300e.png' } );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,76 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image13.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {'xl/worksheets/sheet1.xml' => ['<pageMargins', '<pageSetup']};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header(
+    '&L&G&C&G&R&G',
+    undef,
+    {
+        image_left   => $dir . 'images/black_72.jpg',
+        image_center => $dir . 'images/black_150.jpg',
+        image_right  => $dir . 'images/black_300.jpg',
+    }
+);
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,76 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'header_image14.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {'xl/worksheets/sheet1.xml' => ['<pageMargins', '<pageSetup']};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->set_header(
+    '&L&G&C&G&R&G',
+    undef,
+    {
+        image_left   => $dir . 'images/black_72e.png',
+        image_center => $dir . 'images/black_150e.png',
+        image_right  => $dir . 'images/black_300e.png',
+    }
+);
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,68 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), April 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'image22.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->insert_image( 'B2', $dir . 'images/black_300.jpg' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,70 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), April 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'image23.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+$worksheet->insert_image( 'B2',  $dir . 'images/black_72.jpg'  );
+$worksheet->insert_image( 'B8',  $dir . 'images/black_96.jpg'  );
+$worksheet->insert_image( 'B13', $dir . 'images/black_150.jpg' );
+$worksheet->insert_image( 'B17', $dir . 'images/black_300.jpg' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,68 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), April 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'image24.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->insert_image( 'B2', $dir . 'images/black_300.png' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,68 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), April 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'image25.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->insert_image( 'B2', $dir . 'images/black_150.png' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,70 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), April 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'image26.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+$worksheet->insert_image( 'B2',  $dir . 'images/black_72.png'  );
+$worksheet->insert_image( 'B8',  $dir . 'images/black_96.png'  );
+$worksheet->insert_image( 'B13', $dir . 'images/black_150.png' );
+$worksheet->insert_image( 'B17', $dir . 'images/black_300.png' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
@@ -0,0 +1,68 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), April 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'image27.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file with image(s).
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+my $worksheet = $workbook->add_worksheet();
+
+
+$worksheet->insert_image( 'B2', $dir . 'images/mylogo.png' );
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
+
+
+
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150.jpg b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150.jpg
new file mode 100644
index 00000000..52101397
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150.jpg differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150.png b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150.png
new file mode 100644
index 00000000..68a3a3f0
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150.png differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150e.png b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150e.png
new file mode 100644
index 00000000..b30176c3
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_150e.png differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300.jpg b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300.jpg
new file mode 100644
index 00000000..01796a08
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300.jpg differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300.png b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300.png
new file mode 100644
index 00000000..838d2c5f
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300.png differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300e.png b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300e.png
new file mode 100644
index 00000000..62b58325
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_300e.png differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72.jpg b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72.jpg
new file mode 100644
index 00000000..c2b3a2c3
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72.jpg differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72.png b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72.png
new file mode 100644
index 00000000..b48f348a
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72.png differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72e.png b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72e.png
new file mode 100644
index 00000000..89302ff6
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_72e.png differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_96.jpg b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_96.jpg
new file mode 100644
index 00000000..17d96a52
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_96.jpg differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_96.png b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_96.png
new file mode 100644
index 00000000..d22c6161
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/images/black_96.png differ
@@ -0,0 +1,94 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'quote_name01.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+
+# Test quoted/non-quoted sheet names.
+my $worksheet = $workbook->add_worksheet( 'Sheet 1' );
+my $chart = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+$worksheet->write( 'A1', $data );
+$chart->add_series(values => [ "'Sheet 1'", 0, 4, 0, 0 ]);
+$worksheet->insert_chart( 'E6', $chart, 26, 17 );
+
+my @sheetnames = (
+    'Sheet 2', "Sheet!3", 'Sheet"4',
+    'Sheet#5', 'Sheet$6', 'Sheet%7', 'Sheet&8'
+);
+
+for my $sheetname ( @sheetnames ) {
+
+    my $worksheet = $workbook->add_worksheet( $sheetname );
+    my $chart = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+    $worksheet->write( 'A1', $data );
+    $chart->add_series(values => [$sheetname, 0, 4, 0, 0]);
+    $worksheet->insert_chart( 'E6', $chart, 26, 17 );
+
+}
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,87 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'quote_name02.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+
+# Test quoted/non-quoted sheet names.
+my @sheetnames = (
+    "Sheet'1", "S'heet'2", 'Sheet(3', 'Sheet)4',
+    'Sheet+5', 'Sheet,6',  'Sheet-7', 'Sheet;8'
+);
+
+for my $sheetname ( @sheetnames ) {
+
+    my $worksheet = $workbook->add_worksheet( $sheetname );
+    my $chart = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+    $worksheet->write( 'A1', $data );
+    $chart->add_series(values => [$sheetname, 0, 4, 0, 0]);
+    $worksheet->insert_chart( 'E6', $chart, 26, 17 );
+
+}
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
@@ -0,0 +1,87 @@
+###############################################################################
+#
+# Tests the output of Excel::Writer::XLSX against Excel generated files.
+#
+# reverse ('(c)'), October 2014, John McNamara, jmcnamara@cpan.org
+#
+
+use lib 't/lib';
+use TestFunctions qw(_compare_xlsx_files _is_deep_diff);
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+###############################################################################
+#
+# Tests setup.
+#
+my $filename     = 'quote_name03.xlsx';
+my $dir          = 't/regression/';
+my $got_filename = $dir . "ewx_$filename";
+my $exp_filename = $dir . 'xlsx_files/' . $filename;
+
+my $ignore_members  = [];
+
+my $ignore_elements = {};
+
+
+###############################################################################
+#
+# Test the creation of a simple Excel::Writer::XLSX file.
+#
+use Excel::Writer::XLSX;
+
+my $workbook  = Excel::Writer::XLSX->new( $got_filename );
+
+my $data = [
+    [ 1, 2, 3, 4,  5 ],
+    [ 2, 4, 6, 8,  10 ],
+    [ 3, 6, 9, 12, 15 ],
+
+];
+
+
+# Test quoted/non-quoted sheet names.
+my @sheetnames = (
+    'Sheet<1', 'Sheet>2', 'Sheet=3', 'Sheet@4',
+    'Sheet^5', 'Sheet`6', 'Sheet_7', 'Sheet~8'
+);
+
+for my $sheetname ( @sheetnames ) {
+
+    my $worksheet = $workbook->add_worksheet( $sheetname );
+    my $chart = $workbook->add_chart( type => 'pie', embedded => 1 );
+
+    $worksheet->write( 'A1', $data );
+    $chart->add_series(values => [$sheetname, 0, 4, 0, 0]);
+    $worksheet->insert_chart( 'E6', $chart, 26, 17 );
+
+}
+
+$workbook->close();
+
+
+###############################################################################
+#
+# Compare the generated and existing Excel files.
+#
+
+my ( $got, $expected, $caption ) = _compare_xlsx_files(
+
+    $got_filename,
+    $exp_filename,
+    $ignore_members,
+    $ignore_elements,
+);
+
+_is_deep_diff( $got, $expected, $caption );
+
+
+###############################################################################
+#
+# Cleanup.
+#
+unlink $got_filename;
+
+__END__
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis35.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis35.xlsx
new file mode 100644
index 00000000..419cf694
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis35.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis36.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis36.xlsx
new file mode 100644
index 00000000..84574de5
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis36.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis37.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis37.xlsx
new file mode 100644
index 00000000..9377406a
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis37.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis38.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis38.xlsx
new file mode 100644
index 00000000..a01a2cef
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis38.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis39.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis39.xlsx
new file mode 100644
index 00000000..101a8710
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_axis39.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels01.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels01.xlsx
new file mode 100644
index 00000000..6b0e2fca
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels01.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels02.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels02.xlsx
new file mode 100644
index 00000000..52b78bcf
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels02.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels03.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels03.xlsx
new file mode 100644
index 00000000..c9ca73d8
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels03.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels04.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels04.xlsx
new file mode 100644
index 00000000..4a1a26e4
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels04.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels05.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels05.xlsx
new file mode 100644
index 00000000..dcd260a7
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels05.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels06.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels06.xlsx
new file mode 100644
index 00000000..d445d5d8
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels06.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels07.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels07.xlsx
new file mode 100644
index 00000000..950288b8
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels07.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels08.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels08.xlsx
new file mode 100644
index 00000000..09b91fd4
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels08.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels09.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels09.xlsx
new file mode 100644
index 00000000..2c22cb0e
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels09.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels10.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels10.xlsx
new file mode 100644
index 00000000..e531de15
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels10.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels11.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels11.xlsx
new file mode 100644
index 00000000..d9692804
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels11.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels12.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels12.xlsx
new file mode 100644
index 00000000..f7330ddf
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels12.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels13.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels13.xlsx
new file mode 100644
index 00000000..b722e36f
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels13.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels14.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels14.xlsx
new file mode 100644
index 00000000..a594d8a1
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels14.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels15.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels15.xlsx
new file mode 100644
index 00000000..e0060b35
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels15.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels16.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels16.xlsx
new file mode 100644
index 00000000..740d1423
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels16.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels17.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels17.xlsx
new file mode 100644
index 00000000..ac29344a
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels17.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels18.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels18.xlsx
new file mode 100644
index 00000000..fe691f3e
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels18.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels19.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels19.xlsx
new file mode 100644
index 00000000..50d338a5
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels19.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels20.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels20.xlsx
new file mode 100644
index 00000000..0bcb1336
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels20.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels21.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels21.xlsx
new file mode 100644
index 00000000..96de31de
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels21.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels22.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels22.xlsx
new file mode 100644
index 00000000..ce009aee
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels22.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels23.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels23.xlsx
new file mode 100644
index 00000000..f2b2faa2
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_data_labels23.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_scatter15.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_scatter15.xlsx
new file mode 100644
index 00000000..958174e9
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/chart_scatter15.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header01.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header01.xlsx
new file mode 100644
index 00000000..bf57bb90
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header01.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header02.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header02.xlsx
new file mode 100644
index 00000000..edd12cfe
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header02.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header03.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header03.xlsx
new file mode 100644
index 00000000..5d195ab8
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header03.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image01.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image01.xlsx
new file mode 100644
index 00000000..64df3f1b
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image01.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image02.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image02.xlsx
new file mode 100644
index 00000000..62af382d
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image02.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image03.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image03.xlsx
new file mode 100644
index 00000000..dfa974b2
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image03.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image04.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image04.xlsx
new file mode 100644
index 00000000..0b923ce4
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image04.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image05.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image05.xlsx
new file mode 100644
index 00000000..69d9e860
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image05.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image06.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image06.xlsx
new file mode 100644
index 00000000..65776125
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image06.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image07.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image07.xlsx
new file mode 100644
index 00000000..6af8e2cc
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image07.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image08.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image08.xlsx
new file mode 100644
index 00000000..17d8ba2b
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image08.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image09.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image09.xlsx
new file mode 100644
index 00000000..4d5e6873
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image09.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image10.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image10.xlsx
new file mode 100644
index 00000000..1cee71c3
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image10.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image11.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image11.xlsx
new file mode 100644
index 00000000..47e447f4
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image11.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image12.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image12.xlsx
new file mode 100644
index 00000000..727a8627
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image12.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image13.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image13.xlsx
new file mode 100644
index 00000000..4a5627ec
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image13.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image14.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image14.xlsx
new file mode 100644
index 00000000..5791035c
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/header_image14.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image22.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image22.xlsx
new file mode 100644
index 00000000..cc89a5b1
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image22.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image23.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image23.xlsx
new file mode 100644
index 00000000..df349f34
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image23.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image24.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image24.xlsx
new file mode 100644
index 00000000..f3bf36cf
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image24.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image25.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image25.xlsx
new file mode 100644
index 00000000..fc910f16
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image25.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image26.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image26.xlsx
new file mode 100644
index 00000000..d9a90e4a
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image26.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image27.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image27.xlsx
new file mode 100644
index 00000000..1aa4cbbd
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/image27.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name01.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name01.xlsx
new file mode 100644
index 00000000..64e56fb6
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name01.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name02.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name02.xlsx
new file mode 100644
index 00000000..3dd02ce9
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name02.xlsx differ
diff --git a/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name03.xlsx b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name03.xlsx
new file mode 100644
index 00000000..cee466b8
Binary files /dev/null and b/var/tmp/source/JMCNAMARA/Excel-Writer-XLSX-0.81/Excel-Writer-XLSX-0.81/t/regression/xlsx_files/quote_name03.xlsx differ
@@ -18,7 +18,7 @@ my $number;
 my $result;
 my $worksheet = _new_worksheet( \$got );
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 # Set float difference limit to half of an Excel millisecond
 my $flt_delta = 0.5 / ( 24 * 60 * 60 * 1000 );
@@ -20,7 +20,7 @@ my $number;
 my $result;
 my $worksheet = _new_worksheet( \$got );
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 # Set float difference limit to half of an Excel millisecond
 my $flt_delta = 0.5 / ( 24 * 60 * 60 * 1000 );
@@ -189,7 +189,7 @@ $caption  = " \tWorksheet: _write_sheet_views()";
 $expected = '<dataValidations count="1"><dataValidation type="date" allowBlank="1" showInputMessage="1" showErrorMessage="1" sqref="A6"><formula1>39448</formula1><formula2>39794</formula2></dataValidation></dataValidations>';
 
 $worksheet = _new_worksheet(\$got);
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->data_validation(
     'A6',
@@ -678,7 +678,7 @@ _is_deep_diff( $got, $expected, $caption );
 # Test 32 Date = 2008-07-24T
 #
 $worksheet = _new_worksheet( \$got );
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->data_validation(
     'B5',
@@ -705,7 +705,7 @@ _is_deep_diff( $got, $expected, $caption );
 # Test 33 Date between ranges.
 #
 $worksheet = _new_worksheet( \$got );
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->data_validation(
     'B5',
@@ -757,7 +757,7 @@ _is_deep_diff( $got, $expected, $caption );
 # Test 35 Time = T12:00:00
 #
 $worksheet = _new_worksheet( \$got );
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->data_validation(
     'B5',
@@ -32,7 +32,7 @@ $caption = " \tWorksheet: _assemble_xml_file()";
 
 $worksheet = _new_worksheet(\$got);
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->select();
 
@@ -32,7 +32,7 @@ $caption = " \tWorksheet: _assemble_xml_file()";
 
 $worksheet = _new_worksheet(\$got);
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->select();
 
@@ -32,7 +32,7 @@ $caption = " \tWorksheet: _assemble_xml_file()";
 
 $worksheet = _new_worksheet(\$got);
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->select();
 
@@ -32,7 +32,7 @@ $caption = " \tWorksheet: _assemble_xml_file()";
 
 $worksheet = _new_worksheet(\$got);
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->select();
 
@@ -32,7 +32,7 @@ $caption = " \tWorksheet: _assemble_xml_file()";
 
 $worksheet = _new_worksheet(\$got);
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->select();
 
@@ -32,7 +32,7 @@ $caption = " \tWorksheet: _assemble_xml_file()";
 
 $worksheet = _new_worksheet(\$got);
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->select();
 
@@ -32,7 +32,7 @@ $caption = " \tWorksheet: _assemble_xml_file()";
 
 $worksheet = _new_worksheet(\$got);
 
-$worksheet->{_1904} = 0;
+$worksheet->{_date_1904} = 0;
 
 $worksheet->select();