write_xlsx 0.85.9 → 1.09.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1390) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +53 -1
  4. data/Changes +242 -0
  5. data/LICENSE.txt +1 -1
  6. data/README.md +5 -5
  7. data/examples/a_simple.rb +2 -7
  8. data/examples/add_vba_project.rb +1 -1
  9. data/examples/array_formula.rb +1 -1
  10. data/examples/background.rb +19 -0
  11. data/examples/chart_area.rb +5 -2
  12. data/examples/chart_bar.rb +5 -2
  13. data/examples/chart_clustered.rb +1 -1
  14. data/examples/chart_column.rb +5 -2
  15. data/examples/chart_combined.rb +4 -2
  16. data/examples/chart_data_labels.rb +320 -0
  17. data/examples/chart_data_table.rb +9 -3
  18. data/examples/chart_data_tools.rb +25 -7
  19. data/examples/chart_doughnut.rb +17 -5
  20. data/examples/chart_gauge.rb +73 -0
  21. data/examples/chart_line.rb +90 -12
  22. data/examples/chart_pareto.rb +1 -1
  23. data/examples/chart_pie.rb +9 -3
  24. data/examples/chart_radar.rb +13 -4
  25. data/examples/chart_scatter.rb +5 -2
  26. data/examples/chart_secondary_axis.rb +5 -2
  27. data/examples/chart_stock.rb +1 -1
  28. data/examples/chart_styles.rb +1 -1
  29. data/examples/colors.rb +48 -1
  30. data/examples/comments2.rb +1 -1
  31. data/examples/conditional_format.rb +79 -1
  32. data/examples/data_validate.rb +8 -8
  33. data/examples/date_time.rb +1 -1
  34. data/examples/demo.rb +5 -8
  35. data/examples/formats.rb +1 -1
  36. data/examples/headers.rb +1 -1
  37. data/examples/hide_row_col.rb +1 -1
  38. data/examples/hide_sheet.rb +1 -1
  39. data/examples/hyperlink1.rb +5 -12
  40. data/examples/ignore_errors.rb +39 -0
  41. data/examples/indent.rb +1 -1
  42. data/examples/keep_leading_zeros.rb +17 -0
  43. data/examples/macros.rb +1 -1
  44. data/examples/merge1.rb +1 -1
  45. data/examples/merge2.rb +1 -1
  46. data/examples/merge3.rb +1 -1
  47. data/examples/merge4.rb +1 -1
  48. data/examples/merge5.rb +1 -1
  49. data/examples/merge6.rb +1 -1
  50. data/examples/outline.rb +1 -1
  51. data/examples/outline_collapsed.rb +1 -1
  52. data/examples/panes.rb +2 -2
  53. data/examples/properties.rb +1 -1
  54. data/examples/regions.rb +1 -1
  55. data/examples/rich_strings.rb +1 -1
  56. data/examples/right_to_left.rb +1 -1
  57. data/examples/shape1.rb +1 -1
  58. data/examples/shape2.rb +1 -1
  59. data/examples/shape3.rb +1 -1
  60. data/examples/shape4.rb +1 -1
  61. data/examples/shape5.rb +1 -1
  62. data/examples/shape6.rb +1 -1
  63. data/examples/shape7.rb +1 -1
  64. data/examples/shape8.rb +1 -1
  65. data/examples/shape_all.rb +1 -1
  66. data/examples/sparklines1.rb +1 -1
  67. data/examples/sparklines2.rb +1 -1
  68. data/examples/stats.rb +1 -1
  69. data/examples/stats_ext.rb +1 -1
  70. data/examples/stocks.rb +1 -1
  71. data/examples/tab_colors.rb +2 -2
  72. data/examples/tables.rb +78 -43
  73. data/examples/update_range_format_with_params.rb +33 -0
  74. data/lib/write_xlsx/chart/area.rb +1 -1
  75. data/lib/write_xlsx/chart/axis.rb +37 -12
  76. data/lib/write_xlsx/chart/bar.rb +1 -1
  77. data/lib/write_xlsx/chart/caption.rb +3 -1
  78. data/lib/write_xlsx/chart/column.rb +1 -1
  79. data/lib/write_xlsx/chart/doughnut.rb +1 -1
  80. data/lib/write_xlsx/chart/legend.rb +14 -0
  81. data/lib/write_xlsx/chart/line.rb +16 -2
  82. data/lib/write_xlsx/chart/pie.rb +32 -15
  83. data/lib/write_xlsx/chart/radar.rb +1 -1
  84. data/lib/write_xlsx/chart/scatter.rb +1 -16
  85. data/lib/write_xlsx/chart/series.rb +138 -18
  86. data/lib/write_xlsx/chart/stock.rb +1 -1
  87. data/lib/write_xlsx/chart.rb +365 -277
  88. data/lib/write_xlsx/chartsheet.rb +38 -10
  89. data/lib/write_xlsx/drawing.rb +190 -71
  90. data/lib/write_xlsx/format.rb +41 -201
  91. data/lib/write_xlsx/package/app.rb +17 -5
  92. data/lib/write_xlsx/package/button.rb +8 -8
  93. data/lib/write_xlsx/package/comments.rb +73 -68
  94. data/lib/write_xlsx/package/conditional_format.rb +367 -46
  95. data/lib/write_xlsx/package/content_types.rb +28 -9
  96. data/lib/write_xlsx/package/core.rb +13 -11
  97. data/lib/write_xlsx/package/custom.rb +125 -0
  98. data/lib/write_xlsx/package/metadata.rb +159 -0
  99. data/lib/write_xlsx/package/packager.rb +48 -0
  100. data/lib/write_xlsx/package/relationships.rb +4 -4
  101. data/lib/write_xlsx/package/shared_strings.rb +6 -6
  102. data/lib/write_xlsx/package/styles.rb +102 -39
  103. data/lib/write_xlsx/package/table.rb +83 -36
  104. data/lib/write_xlsx/package/theme.rb +1 -1
  105. data/lib/write_xlsx/package/vml.rb +63 -62
  106. data/lib/write_xlsx/package/xml_writer_simple.rb +3 -2
  107. data/lib/write_xlsx/shape.rb +21 -18
  108. data/lib/write_xlsx/sheets.rb +18 -16
  109. data/lib/write_xlsx/sparkline.rb +341 -341
  110. data/lib/write_xlsx/utility.rb +414 -53
  111. data/lib/write_xlsx/version.rb +1 -1
  112. data/lib/write_xlsx/workbook.rb +396 -699
  113. data/lib/write_xlsx/worksheet/cell_data.rb +46 -3
  114. data/lib/write_xlsx/worksheet/data_validation.rb +53 -50
  115. data/lib/write_xlsx/worksheet/hyperlink.rb +29 -50
  116. data/lib/write_xlsx/worksheet/page_setup.rb +12 -12
  117. data/lib/write_xlsx/worksheet.rb +1043 -4366
  118. data/test/chart/test_add_series.rb +11 -1
  119. data/test/chart/test_process_names.rb +1 -1
  120. data/test/chart/test_write_a_latin.rb +1 -1
  121. data/test/chart/test_write_auto.rb +1 -1
  122. data/test/chart/test_write_ax_id.rb +1 -1
  123. data/test/chart/test_write_ax_pos.rb +1 -1
  124. data/test/chart/test_write_cross_ax.rb +1 -1
  125. data/test/chart/test_write_crosses.rb +1 -1
  126. data/test/chart/test_write_d_lbls.rb +1 -1
  127. data/test/chart/test_write_format_code.rb +1 -1
  128. data/test/chart/test_write_idx.rb +1 -1
  129. data/test/chart/test_write_label_align.rb +1 -1
  130. data/test/chart/test_write_label_offset.rb +1 -1
  131. data/test/chart/test_write_lang.rb +1 -1
  132. data/test/chart/test_write_layout.rb +1 -1
  133. data/test/chart/test_write_legend.rb +1 -1
  134. data/test/chart/test_write_legend_pos.rb +10 -2
  135. data/test/chart/test_write_major_gridlines.rb +1 -1
  136. data/test/chart/test_write_marker.rb +1 -1
  137. data/test/chart/test_write_marker_size.rb +1 -1
  138. data/test/chart/test_write_marker_value.rb +1 -1
  139. data/test/chart/test_write_num_cache.rb +1 -1
  140. data/test/chart/test_write_number_format.rb +2 -3
  141. data/test/chart/test_write_order.rb +1 -1
  142. data/test/chart/test_write_orientation.rb +1 -1
  143. data/test/chart/test_write_page_margins.rb +1 -1
  144. data/test/chart/test_write_page_setup.rb +1 -1
  145. data/test/chart/test_write_plot_vis_only.rb +1 -1
  146. data/test/chart/test_write_pt.rb +1 -1
  147. data/test/chart/test_write_pt_count.rb +1 -1
  148. data/test/chart/test_write_series_formula.rb +1 -1
  149. data/test/chart/test_write_style.rb +1 -1
  150. data/test/chart/test_write_symbol.rb +1 -1
  151. data/test/chart/test_write_tick_lbl_pos.rb +1 -1
  152. data/test/chart/test_write_v.rb +1 -1
  153. data/test/chartsheet/test_chartsheet01.rb +1 -1
  154. data/test/chartsheet/test_write_sheet_protection.rb +91 -0
  155. data/test/drawing/test_drawing_chart_01.rb +7 -3
  156. data/test/drawing/test_drawing_image_01.rb +13 -4
  157. data/test/drawing/test_drawing_shape_01.rb +9 -6
  158. data/test/drawing/test_drawing_shape_02.rb +13 -6
  159. data/test/drawing/test_drawing_shape_03.rb +9 -6
  160. data/test/drawing/test_drawing_shape_04.rb +9 -25
  161. data/test/drawing/test_drawing_shape_05.rb +9 -6
  162. data/test/drawing/test_drawing_shape_06.rb +12 -7
  163. data/test/drawing/test_drawing_shape_07.rb +12 -7
  164. data/test/drawing/test_write_a_graphic_frame_locks.rb +2 -2
  165. data/test/drawing/test_write_c_chart.rb +2 -2
  166. data/test/drawing/test_write_c_nv_graphic_frame_pr.rb +2 -2
  167. data/test/drawing/test_write_c_nv_pr.rb +2 -2
  168. data/test/drawing/test_write_col.rb +2 -2
  169. data/test/drawing/test_write_col_off.rb +2 -2
  170. data/test/drawing/test_write_pos.rb +2 -2
  171. data/test/drawing/test_write_row.rb +2 -2
  172. data/test/drawing/test_write_row_off.rb +2 -2
  173. data/test/drawing/{test_write_ext.rb → test_write_xdr_ext.rb} +3 -3
  174. data/test/drawing/test_write_xfrm_extension.rb +2 -2
  175. data/test/drawing/test_write_xfrm_offset.rb +2 -2
  176. data/test/helper.rb +8 -3
  177. data/test/package/app/test_app01.rb +1 -1
  178. data/test/package/app/test_app02.rb +1 -1
  179. data/test/package/app/test_app03.rb +1 -1
  180. data/test/package/comments/test_comments_01.rb +54 -0
  181. data/test/package/comments/test_comments_02.rb +54 -0
  182. data/test/package/content_types/test_content_types.rb +1 -1
  183. data/test/package/content_types/test_write_default.rb +1 -1
  184. data/test/package/content_types/test_write_override.rb +1 -1
  185. data/test/package/core/test_core01.rb +1 -1
  186. data/test/package/core/test_core02.rb +1 -1
  187. data/test/package/relationships/test_relationships.rb +1 -1
  188. data/test/package/relationships/test_sheet_rels.rb +1 -1
  189. data/test/package/shared_strings/test_shared_strings01.rb +1 -1
  190. data/test/package/shared_strings/test_shared_strings02.rb +1 -1
  191. data/test/package/shared_strings/test_write_si.rb +1 -7
  192. data/test/package/styles/test_styles_01.rb +1 -1
  193. data/test/package/styles/test_styles_02.rb +1 -1
  194. data/test/package/styles/test_styles_03.rb +1 -1
  195. data/test/package/styles/test_styles_04.rb +1 -1
  196. data/test/package/styles/test_styles_05.rb +1 -1
  197. data/test/package/styles/test_styles_06.rb +1 -1
  198. data/test/package/styles/test_styles_07.rb +1 -1
  199. data/test/package/styles/test_styles_08.rb +1 -1
  200. data/test/package/styles/test_styles_09.rb +1 -1
  201. data/test/package/table/test_table01.rb +3 -3
  202. data/test/package/table/test_table02.rb +2 -2
  203. data/test/package/table/test_table03.rb +2 -2
  204. data/test/package/table/test_table04.rb +2 -2
  205. data/test/package/table/test_table05.rb +2 -2
  206. data/test/package/table/test_table06.rb +2 -2
  207. data/test/package/table/test_table07.rb +2 -2
  208. data/test/package/table/test_table08.rb +2 -2
  209. data/test/package/table/test_table09.rb +2 -2
  210. data/test/package/table/test_table10.rb +2 -2
  211. data/test/package/table/test_table11.rb +2 -2
  212. data/test/package/table/test_table12.rb +2 -2
  213. data/test/package/table/test_table13.rb +1 -1
  214. data/test/package/table/test_write_auto_filter.rb +1 -1
  215. data/test/package/table/test_write_table_column.rb +1 -1
  216. data/test/package/table/test_write_table_style_info.rb +1 -1
  217. data/test/package/vml/test_write_auto_fill.rb +1 -1
  218. data/test/package/vml/test_write_div.rb +1 -1
  219. data/test/package/vml/test_write_idmap.rb +1 -1
  220. data/test/package/vml/test_write_path.rb +1 -1
  221. data/test/package/vml/test_write_shapelayout.rb +1 -1
  222. data/test/package/vml/test_write_shapetype.rb +1 -1
  223. data/test/package/vml/test_write_stroke.rb +1 -1
  224. data/test/perl_output/background.xlsx +0 -0
  225. data/test/perl_output/chart_data_labels.xlsx +0 -0
  226. data/test/perl_output/chart_gauge.xlsx +0 -0
  227. data/test/perl_output/chart_line.xlsx +0 -0
  228. data/test/perl_output/comments2.xlsx +0 -0
  229. data/test/perl_output/formats.xlsx +0 -0
  230. data/test/perl_output/ignore_errors.xlsx +0 -0
  231. data/test/perl_output/keep_leading_zeros.xlsx +0 -0
  232. data/test/perl_output/multi_line.xlsx +0 -0
  233. data/test/perl_output/tables.xlsx +0 -0
  234. data/test/regression/_test_hyperlink31.rb +26 -0
  235. data/test/regression/disabled_test_vml04.rb +1 -1
  236. data/test/regression/images/happy.jpg +0 -0
  237. data/test/regression/images/logo.gif +0 -0
  238. data/test/regression/images/logo.jpg +0 -0
  239. data/test/regression/images/red.gif +0 -0
  240. data/test/regression/images/red2.png +0 -0
  241. data/test/regression/images/red_208.png +0 -0
  242. data/test/regression/images/zero_dpi.jpg +0 -0
  243. data/test/regression/test_array_formula01.rb +1 -1
  244. data/test/regression/test_array_formula02.rb +1 -1
  245. data/test/regression/test_array_formula03.rb +36 -0
  246. data/test/regression/test_array_formula04.rb +31 -0
  247. data/test/regression/test_autofilter00.rb +1 -1
  248. data/test/regression/test_autofilter01.rb +1 -1
  249. data/test/regression/test_autofilter02.rb +1 -1
  250. data/test/regression/test_autofilter03.rb +1 -1
  251. data/test/regression/test_autofilter04.rb +1 -1
  252. data/test/regression/test_autofilter05.rb +1 -1
  253. data/test/regression/test_autofilter06.rb +1 -1
  254. data/test/regression/test_autofilter07.rb +1 -1
  255. data/test/regression/test_autofilter08.rb +110 -0
  256. data/test/regression/test_autofilter09.rb +110 -0
  257. data/test/regression/test_autofilter10.rb +110 -0
  258. data/test/regression/test_background01.rb +23 -0
  259. data/test/regression/test_background02.rb +23 -0
  260. data/test/regression/test_background03.rb +24 -0
  261. data/test/regression/test_background04.rb +25 -0
  262. data/test/regression/test_background05.rb +25 -0
  263. data/test/regression/test_background06.rb +31 -0
  264. data/test/regression/test_background07.rb +37 -0
  265. data/test/regression/test_button01.rb +1 -1
  266. data/test/regression/test_button02.rb +1 -1
  267. data/test/regression/test_button03.rb +1 -1
  268. data/test/regression/test_button04.rb +1 -1
  269. data/test/regression/test_button05.rb +1 -1
  270. data/test/regression/test_button06.rb +1 -1
  271. data/test/regression/test_button07.rb +1 -1
  272. data/test/regression/test_button08.rb +1 -1
  273. data/test/regression/test_button13.rb +1 -1
  274. data/test/regression/test_button14.rb +1 -1
  275. data/test/regression/test_chart_area01.rb +1 -1
  276. data/test/regression/test_chart_area02.rb +1 -1
  277. data/test/regression/test_chart_area03.rb +1 -1
  278. data/test/regression/test_chart_area04.rb +1 -1
  279. data/test/regression/test_chart_axis01.rb +1 -1
  280. data/test/regression/test_chart_axis02.rb +1 -1
  281. data/test/regression/test_chart_axis03.rb +1 -1
  282. data/test/regression/test_chart_axis04.rb +1 -1
  283. data/test/regression/test_chart_axis05.rb +1 -1
  284. data/test/regression/test_chart_axis06.rb +1 -1
  285. data/test/regression/test_chart_axis07.rb +1 -1
  286. data/test/regression/test_chart_axis08.rb +1 -1
  287. data/test/regression/test_chart_axis09.rb +1 -1
  288. data/test/regression/test_chart_axis10.rb +1 -1
  289. data/test/regression/test_chart_axis11.rb +1 -1
  290. data/test/regression/test_chart_axis12.rb +1 -1
  291. data/test/regression/test_chart_axis13.rb +1 -1
  292. data/test/regression/test_chart_axis14.rb +1 -1
  293. data/test/regression/test_chart_axis15.rb +1 -1
  294. data/test/regression/test_chart_axis16.rb +1 -1
  295. data/test/regression/test_chart_axis17.rb +1 -1
  296. data/test/regression/test_chart_axis18.rb +1 -1
  297. data/test/regression/test_chart_axis19.rb +1 -1
  298. data/test/regression/test_chart_axis20.rb +1 -1
  299. data/test/regression/test_chart_axis21.rb +1 -1
  300. data/test/regression/test_chart_axis22.rb +1 -1
  301. data/test/regression/test_chart_axis23.rb +1 -1
  302. data/test/regression/test_chart_axis24.rb +1 -1
  303. data/test/regression/test_chart_axis25.rb +1 -1
  304. data/test/regression/test_chart_axis26.rb +11 -9
  305. data/test/regression/test_chart_axis27.rb +2 -2
  306. data/test/regression/test_chart_axis28.rb +2 -2
  307. data/test/regression/test_chart_axis29.rb +2 -2
  308. data/test/regression/test_chart_axis30.rb +1 -1
  309. data/test/regression/test_chart_axis31.rb +1 -1
  310. data/test/regression/test_chart_axis32.rb +1 -1
  311. data/test/regression/test_chart_axis33.rb +2 -2
  312. data/test/regression/test_chart_axis34.rb +1 -1
  313. data/test/regression/test_chart_axis35.rb +1 -1
  314. data/test/regression/test_chart_axis36.rb +1 -1
  315. data/test/regression/test_chart_axis37.rb +1 -1
  316. data/test/regression/test_chart_axis38.rb +1 -1
  317. data/test/regression/test_chart_axis39.rb +1 -1
  318. data/test/regression/test_chart_axis40.rb +44 -0
  319. data/test/regression/test_chart_axis41.rb +48 -0
  320. data/test/regression/test_chart_axis42.rb +44 -0
  321. data/test/regression/test_chart_axis43.rb +44 -0
  322. data/test/regression/test_chart_axis44.rb +54 -0
  323. data/test/regression/test_chart_axis45.rb +54 -0
  324. data/test/regression/test_chart_axis46.rb +54 -0
  325. data/test/regression/test_chart_axis47.rb +52 -0
  326. data/test/regression/test_chart_axis48.rb +53 -0
  327. data/test/regression/test_chart_bar01.rb +1 -1
  328. data/test/regression/test_chart_bar02.rb +1 -1
  329. data/test/regression/test_chart_bar03.rb +1 -1
  330. data/test/regression/test_chart_bar04.rb +1 -1
  331. data/test/regression/test_chart_bar05.rb +1 -1
  332. data/test/regression/test_chart_bar06.rb +1 -1
  333. data/test/regression/test_chart_bar07.rb +1 -1
  334. data/test/regression/test_chart_bar08.rb +4 -1
  335. data/test/regression/test_chart_bar09.rb +1 -1
  336. data/test/regression/test_chart_bar10.rb +1 -1
  337. data/test/regression/test_chart_bar11.rb +4 -1
  338. data/test/regression/test_chart_bar12.rb +1 -1
  339. data/test/regression/test_chart_bar13.rb +1 -1
  340. data/test/regression/test_chart_bar14.rb +4 -1
  341. data/test/regression/test_chart_bar15.rb +1 -1
  342. data/test/regression/test_chart_bar16.rb +1 -1
  343. data/test/regression/test_chart_bar17.rb +1 -1
  344. data/test/regression/test_chart_bar18.rb +1 -1
  345. data/test/regression/test_chart_bar19.rb +1 -1
  346. data/test/regression/test_chart_bar20.rb +1 -1
  347. data/test/regression/test_chart_bar21.rb +1 -1
  348. data/test/regression/test_chart_bar22.rb +1 -1
  349. data/test/regression/test_chart_bar23.rb +1 -1
  350. data/test/regression/test_chart_bar24.rb +1 -1
  351. data/test/regression/test_chart_blank01.rb +1 -1
  352. data/test/regression/test_chart_blank02.rb +1 -1
  353. data/test/regression/test_chart_blank03.rb +1 -1
  354. data/test/regression/test_chart_blank04.rb +1 -1
  355. data/test/regression/test_chart_blank05.rb +1 -1
  356. data/test/regression/test_chart_blank06.rb +1 -1
  357. data/test/regression/test_chart_chartarea01.rb +1 -1
  358. data/test/regression/test_chart_chartarea02.rb +1 -1
  359. data/test/regression/test_chart_chartarea03.rb +1 -1
  360. data/test/regression/test_chart_chartarea04.rb +1 -1
  361. data/test/regression/test_chart_chartarea05.rb +17 -18
  362. data/test/regression/test_chart_chartarea06.rb +49 -0
  363. data/test/regression/test_chart_clustered01.rb +1 -1
  364. data/test/regression/test_chart_column01.rb +1 -1
  365. data/test/regression/test_chart_column02.rb +1 -1
  366. data/test/regression/test_chart_column03.rb +1 -1
  367. data/test/regression/test_chart_column04.rb +1 -1
  368. data/test/regression/test_chart_column05.rb +1 -1
  369. data/test/regression/test_chart_column06.rb +1 -1
  370. data/test/regression/test_chart_column07.rb +1 -1
  371. data/test/regression/test_chart_column08.rb +1 -1
  372. data/test/regression/test_chart_column09.rb +1 -1
  373. data/test/regression/test_chart_column10.rb +1 -1
  374. data/test/regression/test_chart_column11.rb +1 -1
  375. data/test/regression/test_chart_column12.rb +1 -1
  376. data/test/regression/test_chart_combined01.rb +1 -1
  377. data/test/regression/test_chart_combined02.rb +1 -1
  378. data/test/regression/test_chart_combined03.rb +1 -1
  379. data/test/regression/test_chart_combined04.rb +1 -1
  380. data/test/regression/test_chart_combined05.rb +1 -1
  381. data/test/regression/test_chart_combined06.rb +1 -1
  382. data/test/regression/test_chart_combined07.rb +1 -1
  383. data/test/regression/test_chart_combined08.rb +1 -1
  384. data/test/regression/test_chart_combined09.rb +50 -0
  385. data/test/regression/test_chart_combined10.rb +43 -0
  386. data/test/regression/test_chart_combined11.rb +63 -0
  387. data/test/regression/test_chart_crossing01.rb +2 -2
  388. data/test/regression/test_chart_crossing02.rb +1 -1
  389. data/test/regression/test_chart_crossing03.rb +1 -1
  390. data/test/regression/test_chart_crossing04.rb +1 -1
  391. data/test/regression/test_chart_crossing05.rb +46 -0
  392. data/test/regression/test_chart_crossing06.rb +46 -0
  393. data/test/regression/test_chart_data_labels01.rb +1 -1
  394. data/test/regression/test_chart_data_labels02.rb +1 -1
  395. data/test/regression/test_chart_data_labels03.rb +1 -1
  396. data/test/regression/test_chart_data_labels04.rb +1 -1
  397. data/test/regression/test_chart_data_labels05.rb +1 -1
  398. data/test/regression/test_chart_data_labels06.rb +1 -1
  399. data/test/regression/test_chart_data_labels07.rb +1 -1
  400. data/test/regression/test_chart_data_labels08.rb +1 -1
  401. data/test/regression/test_chart_data_labels09.rb +1 -1
  402. data/test/regression/test_chart_data_labels10.rb +1 -1
  403. data/test/regression/test_chart_data_labels11.rb +1 -1
  404. data/test/regression/test_chart_data_labels12.rb +1 -1
  405. data/test/regression/test_chart_data_labels13.rb +1 -1
  406. data/test/regression/test_chart_data_labels14.rb +1 -1
  407. data/test/regression/test_chart_data_labels15.rb +1 -1
  408. data/test/regression/test_chart_data_labels16.rb +1 -1
  409. data/test/regression/test_chart_data_labels17.rb +1 -1
  410. data/test/regression/test_chart_data_labels18.rb +1 -1
  411. data/test/regression/test_chart_data_labels19.rb +1 -1
  412. data/test/regression/test_chart_data_labels20.rb +1 -1
  413. data/test/regression/test_chart_data_labels21.rb +1 -1
  414. data/test/regression/test_chart_data_labels22.rb +1 -1
  415. data/test/regression/test_chart_data_labels23.rb +1 -1
  416. data/test/regression/test_chart_data_labels24.rb +1 -1
  417. data/test/regression/test_chart_data_labels25.rb +61 -0
  418. data/test/regression/test_chart_data_labels26.rb +44 -0
  419. data/test/regression/test_chart_data_labels27.rb +44 -0
  420. data/test/regression/test_chart_data_labels28.rb +52 -0
  421. data/test/regression/test_chart_data_labels29.rb +43 -0
  422. data/test/regression/test_chart_data_labels30.rb +46 -0
  423. data/test/regression/test_chart_data_labels31.rb +49 -0
  424. data/test/regression/test_chart_data_labels32.rb +54 -0
  425. data/test/regression/test_chart_data_labels33.rb +52 -0
  426. data/test/regression/test_chart_data_labels34.rb +54 -0
  427. data/test/regression/test_chart_data_labels35.rb +46 -0
  428. data/test/regression/test_chart_data_labels36.rb +54 -0
  429. data/test/regression/test_chart_data_labels37.rb +51 -0
  430. data/test/regression/test_chart_data_labels38.rb +54 -0
  431. data/test/regression/test_chart_data_labels39.rb +53 -0
  432. data/test/regression/test_chart_data_labels40.rb +53 -0
  433. data/test/regression/test_chart_data_labels41.rb +54 -0
  434. data/test/regression/test_chart_data_labels42.rb +58 -0
  435. data/test/regression/test_chart_data_labels43.rb +58 -0
  436. data/test/regression/test_chart_data_labels44.rb +56 -0
  437. data/test/regression/test_chart_data_labels45.rb +57 -0
  438. data/test/regression/test_chart_data_labels46.rb +61 -0
  439. data/test/regression/test_chart_data_labels47.rb +61 -0
  440. data/test/regression/test_chart_data_labels48.rb +55 -0
  441. data/test/regression/test_chart_data_labels49.rb +55 -0
  442. data/test/regression/test_chart_data_labels50.rb +57 -0
  443. data/test/regression/test_chart_date01.rb +1 -1
  444. data/test/regression/test_chart_date02.rb +1 -1
  445. data/test/regression/test_chart_date03.rb +1 -1
  446. data/test/regression/test_chart_date04.rb +1 -1
  447. data/test/regression/test_chart_date05.rb +1 -1
  448. data/test/regression/test_chart_display_units01.rb +1 -1
  449. data/test/regression/test_chart_display_units02.rb +1 -1
  450. data/test/regression/test_chart_display_units03.rb +1 -1
  451. data/test/regression/test_chart_display_units04.rb +1 -1
  452. data/test/regression/test_chart_display_units05.rb +1 -1
  453. data/test/regression/test_chart_display_units06.rb +1 -1
  454. data/test/regression/test_chart_display_units07.rb +1 -1
  455. data/test/regression/test_chart_display_units08.rb +1 -1
  456. data/test/regression/test_chart_display_units09.rb +1 -1
  457. data/test/regression/test_chart_display_units10.rb +1 -1
  458. data/test/regression/test_chart_display_units11.rb +1 -1
  459. data/test/regression/test_chart_display_units12.rb +1 -1
  460. data/test/regression/test_chart_doughnut01.rb +1 -1
  461. data/test/regression/test_chart_doughnut02.rb +1 -1
  462. data/test/regression/test_chart_doughnut03.rb +1 -1
  463. data/test/regression/test_chart_doughnut04.rb +1 -1
  464. data/test/regression/test_chart_doughnut05.rb +1 -1
  465. data/test/regression/test_chart_doughnut06.rb +1 -1
  466. data/test/regression/test_chart_doughnut07.rb +37 -0
  467. data/test/regression/test_chart_drop_lines01.rb +1 -1
  468. data/test/regression/test_chart_drop_lines02.rb +1 -1
  469. data/test/regression/test_chart_drop_lines03.rb +1 -1
  470. data/test/regression/test_chart_drop_lines04.rb +1 -1
  471. data/test/regression/test_chart_errorbars01.rb +1 -1
  472. data/test/regression/test_chart_errorbars02.rb +1 -1
  473. data/test/regression/test_chart_errorbars03.rb +1 -1
  474. data/test/regression/test_chart_errorbars04.rb +1 -1
  475. data/test/regression/test_chart_errorbars05.rb +1 -1
  476. data/test/regression/test_chart_errorbars06.rb +1 -1
  477. data/test/regression/test_chart_errorbars07.rb +1 -1
  478. data/test/regression/test_chart_errorbars08.rb +1 -1
  479. data/test/regression/test_chart_errorbars09.rb +1 -1
  480. data/test/regression/test_chart_errorbars10.rb +1 -1
  481. data/test/regression/test_chart_font01.rb +1 -1
  482. data/test/regression/test_chart_font02.rb +1 -1
  483. data/test/regression/test_chart_font03.rb +1 -1
  484. data/test/regression/test_chart_font04.rb +1 -1
  485. data/test/regression/test_chart_font05.rb +1 -1
  486. data/test/regression/test_chart_font06.rb +1 -1
  487. data/test/regression/test_chart_font07.rb +1 -1
  488. data/test/regression/test_chart_font08.rb +1 -1
  489. data/test/regression/test_chart_font09.rb +2 -2
  490. data/test/regression/test_chart_format01.rb +1 -1
  491. data/test/regression/test_chart_format02.rb +1 -1
  492. data/test/regression/test_chart_format03.rb +1 -1
  493. data/test/regression/test_chart_format04.rb +1 -1
  494. data/test/regression/test_chart_format05.rb +1 -1
  495. data/test/regression/test_chart_format06.rb +1 -1
  496. data/test/regression/test_chart_format07.rb +1 -1
  497. data/test/regression/test_chart_format08.rb +1 -1
  498. data/test/regression/test_chart_format09.rb +1 -1
  499. data/test/regression/test_chart_format10.rb +1 -1
  500. data/test/regression/test_chart_format11.rb +1 -1
  501. data/test/regression/test_chart_format12.rb +1 -1
  502. data/test/regression/test_chart_format13.rb +1 -1
  503. data/test/regression/test_chart_format14.rb +1 -1
  504. data/test/regression/test_chart_format15.rb +1 -1
  505. data/test/regression/test_chart_format16.rb +1 -1
  506. data/test/regression/test_chart_format17.rb +1 -1
  507. data/test/regression/test_chart_format18.rb +1 -1
  508. data/test/regression/test_chart_format19.rb +1 -1
  509. data/test/regression/test_chart_format20.rb +1 -1
  510. data/test/regression/test_chart_format21.rb +47 -0
  511. data/test/regression/test_chart_format22.rb +47 -0
  512. data/test/regression/test_chart_format23.rb +47 -0
  513. data/test/regression/test_chart_format24.rb +52 -0
  514. data/test/regression/test_chart_format25.rb +46 -0
  515. data/test/regression/test_chart_format26.rb +48 -0
  516. data/test/regression/test_chart_format27.rb +58 -0
  517. data/test/regression/test_chart_format28.rb +52 -0
  518. data/test/regression/test_chart_format29.rb +59 -0
  519. data/test/regression/test_chart_format30.rb +53 -0
  520. data/test/regression/test_chart_format31.rb +60 -0
  521. data/test/regression/test_chart_gap01.rb +1 -1
  522. data/test/regression/test_chart_gap02.rb +1 -1
  523. data/test/regression/test_chart_gap03.rb +1 -1
  524. data/test/regression/test_chart_gap04.rb +1 -1
  525. data/test/regression/test_chart_gap05.rb +1 -1
  526. data/test/regression/test_chart_gradient01.rb +1 -1
  527. data/test/regression/test_chart_gradient02.rb +1 -1
  528. data/test/regression/test_chart_gradient03.rb +1 -1
  529. data/test/regression/test_chart_gradient04.rb +1 -1
  530. data/test/regression/test_chart_gradient05.rb +1 -1
  531. data/test/regression/test_chart_gradient06.rb +1 -1
  532. data/test/regression/test_chart_gradient07.rb +1 -1
  533. data/test/regression/test_chart_gradient08.rb +1 -1
  534. data/test/regression/test_chart_gradient09.rb +1 -1
  535. data/test/regression/test_chart_gradient10.rb +1 -1
  536. data/test/regression/test_chart_gradient11.rb +1 -1
  537. data/test/regression/test_chart_gradient12.rb +1 -1
  538. data/test/regression/test_chart_gradient13.rb +1 -1
  539. data/test/regression/test_chart_gridlines01.rb +1 -1
  540. data/test/regression/test_chart_gridlines02.rb +1 -1
  541. data/test/regression/test_chart_gridlines03.rb +1 -1
  542. data/test/regression/test_chart_gridlines04.rb +5 -4
  543. data/test/regression/test_chart_gridlines05.rb +1 -1
  544. data/test/regression/test_chart_gridlines06.rb +1 -1
  545. data/test/regression/test_chart_gridlines07.rb +1 -1
  546. data/test/regression/test_chart_gridlines08.rb +9 -12
  547. data/test/regression/test_chart_gridlines09.rb +1 -1
  548. data/test/regression/test_chart_layout01.rb +1 -1
  549. data/test/regression/test_chart_layout02.rb +1 -1
  550. data/test/regression/test_chart_layout03.rb +1 -1
  551. data/test/regression/test_chart_layout04.rb +1 -1
  552. data/test/regression/test_chart_layout05.rb +1 -1
  553. data/test/regression/test_chart_layout06.rb +1 -1
  554. data/test/regression/test_chart_layout07.rb +1 -1
  555. data/test/regression/test_chart_layout08.rb +1 -1
  556. data/test/regression/test_chart_legend01.rb +1 -1
  557. data/test/regression/test_chart_legend02.rb +1 -1
  558. data/test/regression/test_chart_legend03.rb +41 -0
  559. data/test/regression/test_chart_legend04.rb +41 -0
  560. data/test/regression/test_chart_legend05.rb +41 -0
  561. data/test/regression/test_chart_legend06.rb +41 -0
  562. data/test/regression/test_chart_legend07.rb +38 -0
  563. data/test/regression/test_chart_line01.rb +1 -1
  564. data/test/regression/test_chart_line02.rb +1 -1
  565. data/test/regression/test_chart_line03.rb +1 -1
  566. data/test/regression/test_chart_line04.rb +1 -1
  567. data/test/regression/test_chart_line05.rb +43 -0
  568. data/test/regression/test_chart_line06.rb +43 -0
  569. data/test/regression/test_chart_name01.rb +1 -1
  570. data/test/regression/test_chart_name02.rb +1 -1
  571. data/test/regression/test_chart_name03.rb +1 -1
  572. data/test/regression/test_chart_order01.rb +1 -1
  573. data/test/regression/test_chart_order02.rb +1 -1
  574. data/test/regression/test_chart_order03.rb +1 -1
  575. data/test/regression/test_chart_pattern01.rb +49 -0
  576. data/test/regression/test_chart_pattern02.rb +106 -0
  577. data/test/regression/test_chart_pattern03.rb +105 -0
  578. data/test/regression/test_chart_pattern04.rb +105 -0
  579. data/test/regression/test_chart_pattern05.rb +105 -0
  580. data/test/regression/test_chart_pattern06.rb +105 -0
  581. data/test/regression/test_chart_pattern07.rb +105 -0
  582. data/test/regression/test_chart_pattern08.rb +105 -0
  583. data/test/regression/test_chart_pattern09.rb +57 -0
  584. data/test/regression/test_chart_pattern10.rb +57 -0
  585. data/test/regression/test_chart_pie01.rb +1 -1
  586. data/test/regression/test_chart_pie02.rb +1 -1
  587. data/test/regression/test_chart_pie03.rb +1 -1
  588. data/test/regression/test_chart_pie04.rb +1 -1
  589. data/test/regression/test_chart_pie05.rb +1 -1
  590. data/test/regression/test_chart_points01.rb +1 -1
  591. data/test/regression/test_chart_points02.rb +1 -1
  592. data/test/regression/test_chart_points03.rb +1 -1
  593. data/test/regression/test_chart_points04.rb +1 -1
  594. data/test/regression/test_chart_points05.rb +1 -1
  595. data/test/regression/test_chart_points06.rb +1 -1
  596. data/test/regression/test_chart_radar01.rb +1 -1
  597. data/test/regression/test_chart_radar02.rb +1 -1
  598. data/test/regression/test_chart_radar03.rb +1 -1
  599. data/test/regression/test_chart_scatter01.rb +1 -1
  600. data/test/regression/test_chart_scatter02.rb +1 -1
  601. data/test/regression/test_chart_scatter03.rb +1 -1
  602. data/test/regression/test_chart_scatter04.rb +1 -1
  603. data/test/regression/test_chart_scatter05.rb +1 -1
  604. data/test/regression/test_chart_scatter06.rb +1 -1
  605. data/test/regression/test_chart_scatter07.rb +1 -1
  606. data/test/regression/test_chart_scatter08.rb +1 -1
  607. data/test/regression/test_chart_scatter09.rb +1 -1
  608. data/test/regression/test_chart_scatter10.rb +1 -1
  609. data/test/regression/test_chart_scatter11.rb +1 -1
  610. data/test/regression/test_chart_scatter12.rb +1 -1
  611. data/test/regression/test_chart_scatter13.rb +1 -1
  612. data/test/regression/test_chart_scatter14.rb +1 -1
  613. data/test/regression/test_chart_scatter15.rb +1 -1
  614. data/test/regression/test_chart_size01.rb +1 -1
  615. data/test/regression/test_chart_size02.rb +1 -1
  616. data/test/regression/test_chart_size03.rb +5 -2
  617. data/test/regression/test_chart_size04.rb +1 -1
  618. data/test/regression/test_chart_size05.rb +1 -1
  619. data/test/regression/test_chart_sparse01.rb +1 -1
  620. data/test/regression/test_chart_stock01.rb +1 -1
  621. data/test/regression/test_chart_stock02.rb +1 -1
  622. data/test/regression/test_chart_str01.rb +1 -1
  623. data/test/regression/test_chart_str02.rb +1 -1
  624. data/test/regression/test_chart_table01.rb +1 -1
  625. data/test/regression/test_chart_table02.rb +1 -1
  626. data/test/regression/test_chart_table03.rb +56 -0
  627. data/test/regression/test_chart_title01.rb +1 -1
  628. data/test/regression/test_chart_title02.rb +1 -1
  629. data/test/regression/test_chartsheet01.rb +1 -1
  630. data/test/regression/test_chartsheet02.rb +1 -1
  631. data/test/regression/test_chartsheet03.rb +1 -1
  632. data/test/regression/test_chartsheet04.rb +1 -1
  633. data/test/regression/test_chartsheet05.rb +1 -1
  634. data/test/regression/test_chartsheet06.rb +1 -1
  635. data/test/regression/test_chartsheet07.rb +1 -1
  636. data/test/regression/test_chartsheet08.rb +1 -1
  637. data/test/regression/test_chartsheet09.rb +1 -1
  638. data/test/regression/test_comment01.rb +1 -1
  639. data/test/regression/test_comment02.rb +1 -1
  640. data/test/regression/test_comment03.rb +1 -1
  641. data/test/regression/test_comment04.rb +1 -1
  642. data/test/regression/test_comment06.rb +1 -1
  643. data/test/regression/test_comment07.rb +1 -1
  644. data/test/regression/test_comment08.rb +1 -1
  645. data/test/regression/test_comment09.rb +1 -1
  646. data/test/regression/test_comment10.rb +1 -1
  647. data/test/regression/test_comment11.rb +1 -1
  648. data/test/regression/test_comment12.rb +1 -1
  649. data/test/regression/test_comment13.rb +36 -0
  650. data/test/regression/test_comment14.rb +29 -0
  651. data/test/regression/test_comment15.rb +28 -0
  652. data/test/regression/test_comment16.rb +34 -0
  653. data/test/regression/test_cond_format01.rb +1 -1
  654. data/test/regression/test_cond_format02.rb +1 -1
  655. data/test/regression/test_cond_format03.rb +1 -1
  656. data/test/regression/test_cond_format04.rb +1 -1
  657. data/test/regression/test_cond_format05.rb +1 -1
  658. data/test/regression/test_cond_format06.rb +1 -1
  659. data/test/regression/test_cond_format07.rb +1 -1
  660. data/test/regression/test_cond_format08.rb +1 -1
  661. data/test/regression/test_cond_format10.rb +1 -1
  662. data/test/regression/test_cond_format11.rb +1 -1
  663. data/test/regression/test_cond_format12.rb +1 -1
  664. data/test/regression/test_cond_format13.rb +1 -1
  665. data/test/regression/test_cond_format14.rb +42 -0
  666. data/test/regression/test_cond_format15.rb +53 -0
  667. data/test/regression/test_cond_format16.rb +53 -0
  668. data/test/regression/test_cond_format17.rb +37 -0
  669. data/test/regression/test_cond_format18.rb +136 -0
  670. data/test/regression/test_cond_format19.rb +64 -0
  671. data/test/regression/test_cond_format20.rb +43 -0
  672. data/test/regression/test_custom_colors01.rb +1 -1
  673. data/test/regression/test_data_validation01.rb +1 -1
  674. data/test/regression/test_data_validation02.rb +1 -1
  675. data/test/regression/test_data_validation03.rb +1 -1
  676. data/test/regression/test_data_validation04.rb +2 -2
  677. data/test/regression/test_data_validation05.rb +2 -2
  678. data/test/regression/test_data_validation08.rb +24 -0
  679. data/test/regression/test_date_1904_01.rb +2 -2
  680. data/test/regression/test_date_1904_02.rb +1 -1
  681. data/test/regression/test_date_examples01.rb +1 -1
  682. data/test/regression/test_default_format01.rb +1 -1
  683. data/test/regression/test_default_row01.rb +1 -1
  684. data/test/regression/test_default_row02.rb +1 -1
  685. data/test/regression/test_default_row03.rb +1 -1
  686. data/test/regression/test_default_row04.rb +1 -1
  687. data/test/regression/test_default_row05.rb +32 -0
  688. data/test/regression/test_defined_name01.rb +1 -1
  689. data/test/regression/test_defined_name02.rb +1 -1
  690. data/test/regression/test_defined_name03.rb +1 -1
  691. data/test/regression/test_defined_name04.rb +15 -15
  692. data/test/regression/test_dynamic_array01.rb +25 -0
  693. data/test/regression/test_escapes01.rb +1 -1
  694. data/test/regression/test_escapes02.rb +1 -1
  695. data/test/regression/test_escapes03.rb +1 -1
  696. data/test/regression/test_escapes04.rb +4 -1
  697. data/test/regression/test_escapes05.rb +4 -1
  698. data/test/regression/test_escapes06.rb +1 -1
  699. data/test/regression/test_escapes07.rb +4 -1
  700. data/test/regression/test_escapes08.rb +4 -1
  701. data/test/regression/test_excel2003_style01.rb +1 -1
  702. data/test/regression/test_excel2003_style02.rb +1 -1
  703. data/test/regression/test_excel2003_style03.rb +1 -1
  704. data/test/regression/test_excel2003_style04.rb +1 -1
  705. data/test/regression/test_excel2003_style05.rb +1 -1
  706. data/test/regression/test_excel2003_style06.rb +1 -1
  707. data/test/regression/test_excel2003_style07.rb +1 -1
  708. data/test/regression/test_excel2003_style08.rb +1 -1
  709. data/test/regression/test_firstsheet01.rb +1 -1
  710. data/test/regression/test_fit_to_pages01.rb +1 -1
  711. data/test/regression/test_fit_to_pages02.rb +1 -1
  712. data/test/regression/test_fit_to_pages03.rb +1 -1
  713. data/test/regression/test_fit_to_pages04.rb +1 -1
  714. data/test/regression/test_fit_to_pages05.rb +1 -1
  715. data/test/regression/test_format01.rb +1 -1
  716. data/test/regression/test_format02.rb +1 -1
  717. data/test/regression/test_format03.rb +1 -1
  718. data/test/regression/test_format04.rb +1 -1
  719. data/test/regression/test_format05.rb +1 -1
  720. data/test/regression/test_format11.rb +1 -1
  721. data/test/regression/test_format12.rb +1 -1
  722. data/test/regression/test_format13.rb +31 -0
  723. data/test/regression/test_format14.rb +26 -0
  724. data/test/regression/test_format15.rb +26 -0
  725. data/test/regression/test_format16.rb +24 -0
  726. data/test/regression/test_format17.rb +24 -0
  727. data/test/regression/test_formula_results01.rb +1 -1
  728. data/test/regression/test_gridlines01.rb +1 -1
  729. data/test/regression/test_header01.rb +1 -1
  730. data/test/regression/test_header02.rb +1 -1
  731. data/test/regression/test_header03.rb +1 -1
  732. data/test/regression/test_header04.rb +30 -0
  733. data/test/regression/test_header_image01.rb +1 -1
  734. data/test/regression/test_header_image02.rb +1 -1
  735. data/test/regression/test_header_image03.rb +1 -1
  736. data/test/regression/test_header_image04.rb +1 -1
  737. data/test/regression/test_header_image05.rb +1 -1
  738. data/test/regression/test_header_image06.rb +1 -1
  739. data/test/regression/test_header_image07.rb +1 -1
  740. data/test/regression/test_header_image08.rb +1 -1
  741. data/test/regression/test_header_image09.rb +1 -1
  742. data/test/regression/test_header_image10.rb +1 -1
  743. data/test/regression/test_header_image11.rb +1 -1
  744. data/test/regression/test_header_image12.rb +1 -1
  745. data/test/regression/test_header_image13.rb +1 -1
  746. data/test/regression/test_header_image14.rb +1 -1
  747. data/test/regression/test_header_image15.rb +36 -0
  748. data/test/regression/test_header_image16.rb +42 -0
  749. data/test/regression/test_header_image17.rb +46 -0
  750. data/test/regression/test_header_image18.rb +48 -0
  751. data/test/regression/test_header_image19.rb +36 -0
  752. data/test/regression/test_hide01.rb +1 -1
  753. data/test/regression/test_hyperlink01.rb +4 -1
  754. data/test/regression/test_hyperlink02.rb +4 -1
  755. data/test/regression/test_hyperlink03.rb +5 -1
  756. data/test/regression/test_hyperlink04.rb +4 -1
  757. data/test/regression/test_hyperlink05.rb +4 -1
  758. data/test/regression/test_hyperlink06.rb +4 -1
  759. data/test/regression/test_hyperlink07.rb +4 -1
  760. data/test/regression/test_hyperlink08.rb +4 -1
  761. data/test/regression/test_hyperlink09.rb +4 -1
  762. data/test/regression/test_hyperlink10.rb +4 -1
  763. data/test/regression/test_hyperlink11.rb +4 -1
  764. data/test/regression/test_hyperlink12.rb +4 -1
  765. data/test/regression/test_hyperlink13.rb +4 -1
  766. data/test/regression/test_hyperlink14.rb +4 -1
  767. data/test/regression/test_hyperlink15.rb +4 -1
  768. data/test/regression/test_hyperlink16.rb +4 -1
  769. data/test/regression/test_hyperlink17.rb +4 -1
  770. data/test/regression/test_hyperlink18.rb +4 -1
  771. data/test/regression/test_hyperlink20.rb +4 -1
  772. data/test/regression/test_hyperlink21.rb +4 -1
  773. data/test/regression/test_hyperlink22.rb +27 -0
  774. data/test/regression/test_hyperlink23.rb +27 -0
  775. data/test/regression/test_hyperlink24.rb +27 -0
  776. data/test/regression/test_hyperlink25.rb +30 -0
  777. data/test/regression/test_hyperlink26.rb +30 -0
  778. data/test/regression/test_hyperlink27.rb +27 -0
  779. data/test/regression/test_hyperlink28.rb +50 -0
  780. data/test/regression/test_hyperlink29.rb +27 -0
  781. data/test/regression/test_hyperlink30.rb +36 -0
  782. data/test/regression/test_hyperlink32.rb +27 -0
  783. data/test/regression/test_hyperlink33.rb +28 -0
  784. data/test/regression/test_hyperlink34.rb +33 -0
  785. data/test/regression/test_hyperlink35.rb +39 -0
  786. data/test/regression/test_hyperlink36.rb +34 -0
  787. data/test/regression/test_hyperlink37.rb +33 -0
  788. data/test/regression/test_hyperlink38.rb +27 -0
  789. data/test/regression/test_hyperlink39.rb +27 -0
  790. data/test/regression/test_hyperlink40.rb +27 -0
  791. data/test/regression/test_hyperlink41.rb +27 -0
  792. data/test/regression/test_hyperlink42.rb +27 -0
  793. data/test/regression/test_hyperlink43.rb +27 -0
  794. data/test/regression/test_hyperlink44.rb +27 -0
  795. data/test/regression/test_hyperlink45.rb +27 -0
  796. data/test/regression/test_hyperlink47.rb +27 -0
  797. data/test/regression/test_hyperlink48.rb +31 -0
  798. data/test/regression/test_hyperlink49.rb +29 -0
  799. data/test/regression/test_hyperlink50.rb +27 -0
  800. data/test/regression/test_hyperlink51.rb +27 -0
  801. data/test/regression/test_ignore_error01.rb +23 -0
  802. data/test/regression/test_ignore_error02.rb +24 -0
  803. data/test/regression/test_ignore_error03.rb +26 -0
  804. data/test/regression/test_ignore_error04.rb +26 -0
  805. data/test/regression/test_ignore_error05.rb +32 -0
  806. data/test/regression/test_ignore_error06.rb +32 -0
  807. data/test/regression/test_image01.rb +1 -1
  808. data/test/regression/test_image02.rb +1 -1
  809. data/test/regression/test_image03.rb +1 -1
  810. data/test/regression/test_image04.rb +1 -1
  811. data/test/regression/test_image05.rb +1 -1
  812. data/test/regression/test_image06.rb +6 -6
  813. data/test/regression/test_image07.rb +1 -1
  814. data/test/regression/test_image08.rb +6 -5
  815. data/test/regression/test_image09.rb +1 -1
  816. data/test/regression/test_image10.rb +1 -1
  817. data/test/regression/test_image11.rb +1 -1
  818. data/test/regression/test_image12.rb +1 -1
  819. data/test/regression/test_image13.rb +1 -1
  820. data/test/regression/test_image14.rb +1 -1
  821. data/test/regression/test_image15.rb +5 -3
  822. data/test/regression/test_image16.rb +1 -1
  823. data/test/regression/test_image17.rb +1 -1
  824. data/test/regression/test_image18.rb +1 -1
  825. data/test/regression/test_image19.rb +1 -1
  826. data/test/regression/test_image22.rb +1 -1
  827. data/test/regression/test_image23.rb +1 -1
  828. data/test/regression/test_image24.rb +1 -1
  829. data/test/regression/test_image25.rb +1 -1
  830. data/test/regression/test_image26.rb +1 -1
  831. data/test/regression/test_image27.rb +1 -1
  832. data/test/regression/test_image28.rb +27 -0
  833. data/test/regression/test_image29.rb +27 -0
  834. data/test/regression/test_image30.rb +27 -0
  835. data/test/regression/test_image31.rb +30 -0
  836. data/test/regression/test_image32.rb +28 -0
  837. data/test/regression/test_image33.rb +32 -0
  838. data/test/regression/test_image35.rb +26 -0
  839. data/test/regression/test_image36.rb +26 -0
  840. data/test/regression/test_image44.rb +28 -0
  841. data/test/regression/test_image45.rb +29 -0
  842. data/test/regression/test_image46.rb +29 -0
  843. data/test/regression/test_image47.rb +28 -0
  844. data/test/regression/test_image48.rb +32 -0
  845. data/test/regression/test_image49.rb +38 -0
  846. data/test/regression/test_image50.rb +24 -0
  847. data/test/regression/test_image51.rb +30 -0
  848. data/test/regression/test_image52.rb +26 -0
  849. data/test/regression/test_image53.rb +26 -0
  850. data/test/regression/test_image54.rb +26 -0
  851. data/test/regression/test_image55.rb +27 -0
  852. data/test/regression/test_image56.rb +23 -0
  853. data/test/regression/test_image57.rb +23 -0
  854. data/test/regression/test_landscape01.rb +1 -1
  855. data/test/regression/test_macro01.rb +1 -1
  856. data/test/regression/test_merge_cells01.rb +1 -1
  857. data/test/regression/test_merge_range01.rb +1 -1
  858. data/test/regression/test_merge_range02.rb +1 -1
  859. data/test/regression/test_merge_range03.rb +1 -1
  860. data/test/regression/test_merge_range04.rb +1 -1
  861. data/test/regression/test_merge_range05.rb +1 -1
  862. data/test/regression/test_object_position01.rb +26 -0
  863. data/test/regression/test_object_position02.rb +26 -0
  864. data/test/regression/test_object_position03.rb +26 -0
  865. data/test/regression/test_object_position04.rb +44 -0
  866. data/test/regression/test_object_position06.rb +28 -0
  867. data/test/regression/test_object_position07.rb +28 -0
  868. data/test/regression/test_object_position08.rb +47 -0
  869. data/test/regression/test_object_position09.rb +50 -0
  870. data/test/regression/test_object_position10.rb +28 -0
  871. data/test/regression/test_object_position12.rb +25 -0
  872. data/test/regression/test_object_position13.rb +25 -0
  873. data/test/regression/test_object_position14.rb +25 -0
  874. data/test/regression/test_object_position15.rb +29 -0
  875. data/test/regression/test_object_position16.rb +29 -0
  876. data/test/regression/test_object_position17.rb +29 -0
  877. data/test/regression/test_object_position18.rb +29 -0
  878. data/test/regression/test_object_position19.rb +29 -0
  879. data/test/regression/test_object_position20.rb +29 -0
  880. data/test/regression/test_outline01.rb +1 -1
  881. data/test/regression/test_outline02.rb +1 -1
  882. data/test/regression/test_outline03.rb +1 -1
  883. data/test/regression/test_outline04.rb +1 -1
  884. data/test/regression/test_outline05.rb +1 -1
  885. data/test/regression/test_outline06.rb +1 -1
  886. data/test/regression/test_page_breaks01.rb +1 -1
  887. data/test/regression/test_page_breaks02.rb +1 -1
  888. data/test/regression/test_page_breaks03.rb +1 -1
  889. data/test/regression/test_page_breaks04.rb +1 -1
  890. data/test/regression/test_page_breaks05.rb +1 -1
  891. data/test/regression/test_page_breaks06.rb +1 -1
  892. data/test/regression/test_page_view01.rb +1 -1
  893. data/test/regression/test_panes01.rb +1 -1
  894. data/test/regression/test_print_across01.rb +1 -1
  895. data/test/regression/test_print_area01.rb +1 -1
  896. data/test/regression/test_print_area02.rb +1 -1
  897. data/test/regression/test_print_area03.rb +1 -1
  898. data/test/regression/test_print_area04.rb +1 -1
  899. data/test/regression/test_print_area05.rb +1 -1
  900. data/test/regression/test_print_area06.rb +1 -1
  901. data/test/regression/test_print_area07.rb +1 -1
  902. data/test/regression/test_print_options01.rb +1 -1
  903. data/test/regression/test_print_options02.rb +1 -1
  904. data/test/regression/test_print_options03.rb +1 -1
  905. data/test/regression/test_print_options04.rb +1 -1
  906. data/test/regression/test_print_options05.rb +1 -1
  907. data/test/regression/test_print_options06.rb +1 -1
  908. data/test/regression/test_print_options07.rb +1 -1
  909. data/test/regression/test_print_scale01.rb +1 -1
  910. data/test/regression/test_print_scale02.rb +1 -1
  911. data/test/regression/test_properties01.rb +2 -5
  912. data/test/regression/test_properties02.rb +25 -0
  913. data/test/regression/test_properties03.rb +26 -0
  914. data/test/regression/test_properties04.rb +61 -0
  915. data/test/regression/test_properties05.rb +30 -0
  916. data/test/regression/test_protect01.rb +1 -1
  917. data/test/regression/test_protect02.rb +1 -1
  918. data/test/regression/test_protect03.rb +1 -1
  919. data/test/regression/test_protect04.rb +32 -0
  920. data/test/regression/test_protect05.rb +35 -0
  921. data/test/regression/test_protect06.rb +35 -0
  922. data/test/regression/test_protect07.rb +23 -0
  923. data/test/regression/test_quote_name01.rb +1 -1
  924. data/test/regression/test_quote_name03.rb +1 -1
  925. data/test/regression/test_quote_name04.rb +1 -1
  926. data/test/regression/test_repeat01.rb +1 -1
  927. data/test/regression/test_repeat02.rb +1 -1
  928. data/test/regression/test_repeat03.rb +1 -1
  929. data/test/regression/test_repeat04.rb +1 -1
  930. data/test/regression/test_repeat05.rb +1 -1
  931. data/test/regression/test_rich_string01.rb +1 -1
  932. data/test/regression/test_rich_string02.rb +1 -1
  933. data/test/regression/test_rich_string03.rb +1 -1
  934. data/test/regression/test_rich_string04.rb +1 -1
  935. data/test/regression/test_rich_string05.rb +1 -1
  936. data/test/regression/test_rich_string06.rb +1 -1
  937. data/test/regression/test_rich_string07.rb +1 -1
  938. data/test/regression/test_rich_string08.rb +1 -1
  939. data/test/regression/test_rich_string09.rb +1 -1
  940. data/test/regression/test_rich_string10.rb +1 -1
  941. data/test/regression/test_rich_string11.rb +1 -1
  942. data/test/regression/test_rich_string12.rb +1 -1
  943. data/test/regression/test_row_col_format01.rb +1 -1
  944. data/test/regression/test_row_col_format02.rb +1 -1
  945. data/test/regression/test_row_col_format03.rb +1 -1
  946. data/test/regression/test_row_col_format04.rb +1 -1
  947. data/test/regression/test_row_col_format05.rb +1 -1
  948. data/test/regression/test_row_col_format06.rb +1 -1
  949. data/test/regression/test_row_col_format07.rb +1 -1
  950. data/test/regression/test_row_col_format08.rb +1 -1
  951. data/test/regression/test_row_col_format09.rb +1 -1
  952. data/test/regression/test_row_col_format10.rb +1 -1
  953. data/test/regression/test_row_col_format11.rb +1 -1
  954. data/test/regression/test_row_col_format12.rb +1 -1
  955. data/test/regression/test_row_col_format13.rb +1 -1
  956. data/test/regression/test_row_col_format14.rb +1 -1
  957. data/test/regression/test_selection01.rb +1 -1
  958. data/test/regression/test_selection02.rb +1 -1
  959. data/test/regression/test_set_column01.rb +1 -1
  960. data/test/regression/test_set_column02.rb +1 -1
  961. data/test/regression/test_set_column03.rb +1 -1
  962. data/test/regression/test_set_column04.rb +1 -1
  963. data/test/regression/test_set_column05.rb +1 -1
  964. data/test/regression/test_set_column06.rb +1 -1
  965. data/test/regression/test_set_column07.rb +1 -1
  966. data/test/regression/test_set_column08.rb +1 -1
  967. data/test/regression/test_set_column09.rb +1 -1
  968. data/test/regression/test_set_column10.rb +55 -0
  969. data/test/regression/test_set_column11.rb +48 -0
  970. data/test/regression/test_set_print_scale01.rb +1 -1
  971. data/test/regression/test_set_row01.rb +35 -0
  972. data/test/regression/test_set_row02.rb +35 -0
  973. data/test/regression/test_set_row03.rb +35 -0
  974. data/test/regression/test_set_row04.rb +35 -0
  975. data/test/regression/test_set_start_page01.rb +1 -1
  976. data/test/regression/test_set_start_page02.rb +1 -1
  977. data/test/regression/test_set_start_page03.rb +1 -1
  978. data/test/regression/test_shape01.rb +1 -1
  979. data/test/regression/test_shape02.rb +1 -1
  980. data/test/regression/test_shape03.rb +1 -1
  981. data/test/regression/test_shape04.rb +1 -1
  982. data/test/regression/test_shape_connect01.rb +5 -3
  983. data/test/regression/test_shape_connect02.rb +1 -1
  984. data/test/regression/test_shape_connect03.rb +1 -1
  985. data/test/regression/test_shape_connect04.rb +1 -1
  986. data/test/regression/test_shape_scale01.rb +1 -1
  987. data/test/regression/test_shape_stencil01.rb +1 -1
  988. data/test/regression/test_shared_strings01.rb +1 -1
  989. data/test/regression/test_shared_strings02.rb +1 -1
  990. data/test/regression/test_simple01.rb +1 -1
  991. data/test/regression/test_simple02.rb +1 -1
  992. data/test/regression/test_simple03.rb +1 -1
  993. data/test/regression/test_simple04.rb +1 -1
  994. data/test/regression/test_simple05.rb +1 -1
  995. data/test/regression/test_tab_color01.rb +1 -1
  996. data/test/regression/test_table01.rb +1 -1
  997. data/test/regression/test_table02.rb +1 -1
  998. data/test/regression/test_table03.rb +4 -1
  999. data/test/regression/test_table04.rb +4 -1
  1000. data/test/regression/test_table05.rb +4 -1
  1001. data/test/regression/test_table06.rb +4 -1
  1002. data/test/regression/test_table07.rb +1 -1
  1003. data/test/regression/test_table08.rb +1 -1
  1004. data/test/regression/test_table09.rb +1 -1
  1005. data/test/regression/test_table10.rb +1 -1
  1006. data/test/regression/test_table11.rb +1 -1
  1007. data/test/regression/test_table12.rb +1 -1
  1008. data/test/regression/test_table13.rb +1 -1
  1009. data/test/regression/test_table14.rb +1 -1
  1010. data/test/regression/test_table15.rb +1 -1
  1011. data/test/regression/test_table16.rb +1 -1
  1012. data/test/regression/test_table17.rb +1 -1
  1013. data/test/regression/test_table20.rb +34 -0
  1014. data/test/regression/test_table21.rb +36 -0
  1015. data/test/regression/test_table22.rb +32 -0
  1016. data/test/regression/test_table23.rb +56 -0
  1017. data/test/regression/test_table24.rb +27 -0
  1018. data/test/regression/test_table25.rb +27 -0
  1019. data/test/regression/test_table26.rb +38 -0
  1020. data/test/regression/test_tutorial01.rb +1 -1
  1021. data/test/regression/test_tutorial02.rb +1 -1
  1022. data/test/regression/test_tutorial03.rb +1 -1
  1023. data/test/regression/test_types02.rb +25 -0
  1024. data/test/regression/test_types08.rb +31 -0
  1025. data/test/regression/test_update_range_format_with_params.rb +42 -0
  1026. data/test/regression/test_urls_as_strings.rb +1 -1
  1027. data/test/regression/test_utf8_01.rb +1 -1
  1028. data/test/regression/test_utf8_03.rb +1 -1
  1029. data/test/regression/test_utf8_04.rb +1 -1
  1030. data/test/regression/test_utf8_05.rb +1 -1
  1031. data/test/regression/test_utf8_06.rb +1 -1
  1032. data/test/regression/test_utf8_07.rb +1 -1
  1033. data/test/regression/test_utf8_08.rb +1 -1
  1034. data/test/regression/test_utf8_09.rb +1 -1
  1035. data/test/regression/test_utf8_10.rb +1 -1
  1036. data/test/regression/test_utf8_11.rb +23 -0
  1037. data/test/regression/test_vml01.rb +1 -1
  1038. data/test/regression/test_vml02.rb +1 -1
  1039. data/test/regression/test_vml03.rb +1 -1
  1040. data/test/regression/xlsx_files/array_formula03.xlsx +0 -0
  1041. data/test/regression/xlsx_files/array_formula04.xlsx +0 -0
  1042. data/test/regression/xlsx_files/autofilter08.xlsx +0 -0
  1043. data/test/regression/xlsx_files/autofilter09.xlsx +0 -0
  1044. data/test/regression/xlsx_files/autofilter10.xlsx +0 -0
  1045. data/test/regression/xlsx_files/background01.xlsx +0 -0
  1046. data/test/regression/xlsx_files/background02.xlsx +0 -0
  1047. data/test/regression/xlsx_files/background03.xlsx +0 -0
  1048. data/test/regression/xlsx_files/background04.xlsx +0 -0
  1049. data/test/regression/xlsx_files/background05.xlsx +0 -0
  1050. data/test/regression/xlsx_files/background06.xlsx +0 -0
  1051. data/test/regression/xlsx_files/background07.xlsx +0 -0
  1052. data/test/regression/xlsx_files/chart_axis26.xlsx +0 -0
  1053. data/test/regression/xlsx_files/chart_axis27.xlsx +0 -0
  1054. data/test/regression/xlsx_files/chart_axis28.xlsx +0 -0
  1055. data/test/regression/xlsx_files/chart_axis29.xlsx +0 -0
  1056. data/test/regression/xlsx_files/chart_axis33.xlsx +0 -0
  1057. data/test/regression/xlsx_files/chart_axis40.xlsx +0 -0
  1058. data/test/regression/xlsx_files/chart_axis41.xlsx +0 -0
  1059. data/test/regression/xlsx_files/chart_axis42.xlsx +0 -0
  1060. data/test/regression/xlsx_files/chart_axis43.xlsx +0 -0
  1061. data/test/regression/xlsx_files/chart_axis44.xlsx +0 -0
  1062. data/test/regression/xlsx_files/chart_axis45.xlsx +0 -0
  1063. data/test/regression/xlsx_files/chart_axis46.xlsx +0 -0
  1064. data/test/regression/xlsx_files/chart_axis47.xlsx +0 -0
  1065. data/test/regression/xlsx_files/chart_axis48.xlsx +0 -0
  1066. data/test/regression/xlsx_files/chart_chartarea05.xlsx +0 -0
  1067. data/test/regression/xlsx_files/chart_chartarea06.xlsx +0 -0
  1068. data/test/regression/xlsx_files/chart_combined09.xlsx +0 -0
  1069. data/test/regression/xlsx_files/chart_combined10.xlsx +0 -0
  1070. data/test/regression/xlsx_files/chart_combined11.xlsx +0 -0
  1071. data/test/regression/xlsx_files/chart_crossing05.xlsx +0 -0
  1072. data/test/regression/xlsx_files/chart_crossing06.xlsx +0 -0
  1073. data/test/regression/xlsx_files/chart_data_labels25.xlsx +0 -0
  1074. data/test/regression/xlsx_files/chart_data_labels26.xlsx +0 -0
  1075. data/test/regression/xlsx_files/chart_data_labels27.xlsx +0 -0
  1076. data/test/regression/xlsx_files/chart_data_labels28.xlsx +0 -0
  1077. data/test/regression/xlsx_files/chart_data_labels29.xlsx +0 -0
  1078. data/test/regression/xlsx_files/chart_data_labels30.xlsx +0 -0
  1079. data/test/regression/xlsx_files/chart_data_labels31.xlsx +0 -0
  1080. data/test/regression/xlsx_files/chart_data_labels32.xlsx +0 -0
  1081. data/test/regression/xlsx_files/chart_data_labels33.xlsx +0 -0
  1082. data/test/regression/xlsx_files/chart_data_labels34.xlsx +0 -0
  1083. data/test/regression/xlsx_files/chart_data_labels35.xlsx +0 -0
  1084. data/test/regression/xlsx_files/chart_data_labels36.xlsx +0 -0
  1085. data/test/regression/xlsx_files/chart_data_labels37.xlsx +0 -0
  1086. data/test/regression/xlsx_files/chart_data_labels38.xlsx +0 -0
  1087. data/test/regression/xlsx_files/chart_data_labels39.xlsx +0 -0
  1088. data/test/regression/xlsx_files/chart_data_labels40.xlsx +0 -0
  1089. data/test/regression/xlsx_files/chart_data_labels41.xlsx +0 -0
  1090. data/test/regression/xlsx_files/chart_data_labels42.xlsx +0 -0
  1091. data/test/regression/xlsx_files/chart_data_labels43.xlsx +0 -0
  1092. data/test/regression/xlsx_files/chart_data_labels44.xlsx +0 -0
  1093. data/test/regression/xlsx_files/chart_data_labels45.xlsx +0 -0
  1094. data/test/regression/xlsx_files/chart_data_labels46.xlsx +0 -0
  1095. data/test/regression/xlsx_files/chart_data_labels47.xlsx +0 -0
  1096. data/test/regression/xlsx_files/chart_data_labels48.xlsx +0 -0
  1097. data/test/regression/xlsx_files/chart_data_labels49.xlsx +0 -0
  1098. data/test/regression/xlsx_files/chart_data_labels50.xlsx +0 -0
  1099. data/test/regression/xlsx_files/chart_doughnut07.xlsx +0 -0
  1100. data/test/regression/xlsx_files/chart_font09.xlsx +0 -0
  1101. data/test/regression/xlsx_files/chart_format21.xlsx +0 -0
  1102. data/test/regression/xlsx_files/chart_format22.xlsx +0 -0
  1103. data/test/regression/xlsx_files/chart_format23.xlsx +0 -0
  1104. data/test/regression/xlsx_files/chart_format24.xlsx +0 -0
  1105. data/test/regression/xlsx_files/chart_format25.xlsx +0 -0
  1106. data/test/regression/xlsx_files/chart_format26.xlsx +0 -0
  1107. data/test/regression/xlsx_files/chart_format27.xlsx +0 -0
  1108. data/test/regression/xlsx_files/chart_format28.xlsx +0 -0
  1109. data/test/regression/xlsx_files/chart_format29.xlsx +0 -0
  1110. data/test/regression/xlsx_files/chart_format30.xlsx +0 -0
  1111. data/test/regression/xlsx_files/chart_format31.xlsx +0 -0
  1112. data/test/regression/xlsx_files/chart_legend03.xlsx +0 -0
  1113. data/test/regression/xlsx_files/chart_legend04.xlsx +0 -0
  1114. data/test/regression/xlsx_files/chart_legend05.xlsx +0 -0
  1115. data/test/regression/xlsx_files/chart_legend06.xlsx +0 -0
  1116. data/test/regression/xlsx_files/chart_legend07.xlsx +0 -0
  1117. data/test/regression/xlsx_files/chart_line05.xlsx +0 -0
  1118. data/test/regression/xlsx_files/chart_line06.xlsx +0 -0
  1119. data/test/regression/xlsx_files/chart_pattern01.xlsx +0 -0
  1120. data/test/regression/xlsx_files/chart_pattern02.xlsx +0 -0
  1121. data/test/regression/xlsx_files/chart_pattern03.xlsx +0 -0
  1122. data/test/regression/xlsx_files/chart_pattern04.xlsx +0 -0
  1123. data/test/regression/xlsx_files/chart_pattern05.xlsx +0 -0
  1124. data/test/regression/xlsx_files/chart_pattern06.xlsx +0 -0
  1125. data/test/regression/xlsx_files/chart_pattern07.xlsx +0 -0
  1126. data/test/regression/xlsx_files/chart_pattern08.xlsx +0 -0
  1127. data/test/regression/xlsx_files/chart_pattern09.xlsx +0 -0
  1128. data/test/regression/xlsx_files/chart_pattern10.xlsx +0 -0
  1129. data/test/regression/xlsx_files/chart_table03.xlsx +0 -0
  1130. data/test/regression/xlsx_files/comment13.xlsx +0 -0
  1131. data/test/regression/xlsx_files/comment14.xlsx +0 -0
  1132. data/test/regression/xlsx_files/comment15.xlsx +0 -0
  1133. data/test/regression/xlsx_files/comment16.xlsx +0 -0
  1134. data/test/regression/xlsx_files/cond_format14.xlsx +0 -0
  1135. data/test/regression/xlsx_files/cond_format15.xlsx +0 -0
  1136. data/test/regression/xlsx_files/cond_format16.xlsx +0 -0
  1137. data/test/regression/xlsx_files/cond_format17.xlsx +0 -0
  1138. data/test/regression/xlsx_files/cond_format18.xlsx +0 -0
  1139. data/test/regression/xlsx_files/cond_format19.xlsx +0 -0
  1140. data/test/regression/xlsx_files/cond_format20.xlsx +0 -0
  1141. data/test/regression/xlsx_files/data_validation08.xlsx +0 -0
  1142. data/test/regression/xlsx_files/date_1904_01.xlsx +0 -0
  1143. data/test/regression/xlsx_files/default_row05.xlsx +0 -0
  1144. data/test/regression/xlsx_files/dynamic_array01.xlsx +0 -0
  1145. data/test/regression/xlsx_files/format13.xlsx +0 -0
  1146. data/test/regression/xlsx_files/format14.xlsx +0 -0
  1147. data/test/regression/xlsx_files/format15.xlsx +0 -0
  1148. data/test/regression/xlsx_files/format16.xlsx +0 -0
  1149. data/test/regression/xlsx_files/format17.xlsx +0 -0
  1150. data/test/regression/xlsx_files/header04.xlsx +0 -0
  1151. data/test/regression/xlsx_files/header_image15.xlsx +0 -0
  1152. data/test/regression/xlsx_files/header_image16.xlsx +0 -0
  1153. data/test/regression/xlsx_files/header_image17.xlsx +0 -0
  1154. data/test/regression/xlsx_files/header_image18.xlsx +0 -0
  1155. data/test/regression/xlsx_files/header_image19.xlsx +0 -0
  1156. data/test/regression/xlsx_files/hyperlink22.xlsx +0 -0
  1157. data/test/regression/xlsx_files/hyperlink23.xlsx +0 -0
  1158. data/test/regression/xlsx_files/hyperlink24.xlsx +0 -0
  1159. data/test/regression/xlsx_files/hyperlink25.xlsx +0 -0
  1160. data/test/regression/xlsx_files/hyperlink26.xlsx +0 -0
  1161. data/test/regression/xlsx_files/hyperlink27.xlsx +0 -0
  1162. data/test/regression/xlsx_files/hyperlink28.xlsx +0 -0
  1163. data/test/regression/xlsx_files/hyperlink29.xlsx +0 -0
  1164. data/test/regression/xlsx_files/hyperlink30.xlsx +0 -0
  1165. data/test/regression/xlsx_files/hyperlink31.xlsx +0 -0
  1166. data/test/regression/xlsx_files/hyperlink32.xlsx +0 -0
  1167. data/test/regression/xlsx_files/hyperlink33.xlsx +0 -0
  1168. data/test/regression/xlsx_files/hyperlink34.xlsx +0 -0
  1169. data/test/regression/xlsx_files/hyperlink35.xlsx +0 -0
  1170. data/test/regression/xlsx_files/hyperlink36.xlsx +0 -0
  1171. data/test/regression/xlsx_files/hyperlink37.xlsx +0 -0
  1172. data/test/regression/xlsx_files/hyperlink38.xlsx +0 -0
  1173. data/test/regression/xlsx_files/hyperlink39.xlsx +0 -0
  1174. data/test/regression/xlsx_files/hyperlink40.xlsx +0 -0
  1175. data/test/regression/xlsx_files/hyperlink41.xlsx +0 -0
  1176. data/test/regression/xlsx_files/hyperlink42.xlsx +0 -0
  1177. data/test/regression/xlsx_files/hyperlink43.xlsx +0 -0
  1178. data/test/regression/xlsx_files/hyperlink44.xlsx +0 -0
  1179. data/test/regression/xlsx_files/hyperlink45.xlsx +0 -0
  1180. data/test/regression/xlsx_files/hyperlink46.xlsx +0 -0
  1181. data/test/regression/xlsx_files/hyperlink47.xlsx +0 -0
  1182. data/test/regression/xlsx_files/hyperlink48.xlsx +0 -0
  1183. data/test/regression/xlsx_files/hyperlink49.xlsx +0 -0
  1184. data/test/regression/xlsx_files/hyperlink50.xlsx +0 -0
  1185. data/test/regression/xlsx_files/hyperlink51.xlsx +0 -0
  1186. data/test/regression/xlsx_files/ignore_error01.xlsx +0 -0
  1187. data/test/regression/xlsx_files/ignore_error02.xlsx +0 -0
  1188. data/test/regression/xlsx_files/ignore_error03.xlsx +0 -0
  1189. data/test/regression/xlsx_files/ignore_error04.xlsx +0 -0
  1190. data/test/regression/xlsx_files/ignore_error05.xlsx +0 -0
  1191. data/test/regression/xlsx_files/ignore_error06.xlsx +0 -0
  1192. data/test/regression/xlsx_files/image06.xlsx +0 -0
  1193. data/test/regression/xlsx_files/image28.xlsx +0 -0
  1194. data/test/regression/xlsx_files/image29.xlsx +0 -0
  1195. data/test/regression/xlsx_files/image30.xlsx +0 -0
  1196. data/test/regression/xlsx_files/image31.xlsx +0 -0
  1197. data/test/regression/xlsx_files/image32.xlsx +0 -0
  1198. data/test/regression/xlsx_files/image33.xlsx +0 -0
  1199. data/test/regression/xlsx_files/image35.xlsx +0 -0
  1200. data/test/regression/xlsx_files/image36.xlsx +0 -0
  1201. data/test/regression/xlsx_files/image44.xlsx +0 -0
  1202. data/test/regression/xlsx_files/image45.xlsx +0 -0
  1203. data/test/regression/xlsx_files/image46.xlsx +0 -0
  1204. data/test/regression/xlsx_files/image47.xlsx +0 -0
  1205. data/test/regression/xlsx_files/image48.xlsx +0 -0
  1206. data/test/regression/xlsx_files/image49.xlsx +0 -0
  1207. data/test/regression/xlsx_files/image50.xlsx +0 -0
  1208. data/test/regression/xlsx_files/image51.xlsx +0 -0
  1209. data/test/regression/xlsx_files/image52.xlsx +0 -0
  1210. data/test/regression/xlsx_files/image53.xlsx +0 -0
  1211. data/test/regression/xlsx_files/image54.xlsx +0 -0
  1212. data/test/regression/xlsx_files/image55.xlsx +0 -0
  1213. data/test/regression/xlsx_files/image56.xlsx +0 -0
  1214. data/test/regression/xlsx_files/image57.xlsx +0 -0
  1215. data/test/regression/xlsx_files/object_position01.xlsx +0 -0
  1216. data/test/regression/xlsx_files/object_position02.xlsx +0 -0
  1217. data/test/regression/xlsx_files/object_position03.xlsx +0 -0
  1218. data/test/regression/xlsx_files/object_position04.xlsx +0 -0
  1219. data/test/regression/xlsx_files/object_position06.xlsx +0 -0
  1220. data/test/regression/xlsx_files/object_position07.xlsx +0 -0
  1221. data/test/regression/xlsx_files/object_position08.xlsx +0 -0
  1222. data/test/regression/xlsx_files/object_position09.xlsx +0 -0
  1223. data/test/regression/xlsx_files/object_position10.xlsx +0 -0
  1224. data/test/regression/xlsx_files/object_position12.xlsx +0 -0
  1225. data/test/regression/xlsx_files/object_position13.xlsx +0 -0
  1226. data/test/regression/xlsx_files/object_position14.xlsx +0 -0
  1227. data/test/regression/xlsx_files/object_position15.xlsx +0 -0
  1228. data/test/regression/xlsx_files/object_position16.xlsx +0 -0
  1229. data/test/regression/xlsx_files/object_position17.xlsx +0 -0
  1230. data/test/regression/xlsx_files/object_position18.xlsx +0 -0
  1231. data/test/regression/xlsx_files/object_position19.xlsx +0 -0
  1232. data/test/regression/xlsx_files/object_position20.xlsx +0 -0
  1233. data/test/regression/xlsx_files/properties02.xlsx +0 -0
  1234. data/test/regression/xlsx_files/properties03.xlsx +0 -0
  1235. data/test/regression/xlsx_files/properties04.xlsx +0 -0
  1236. data/test/regression/xlsx_files/properties05.xlsx +0 -0
  1237. data/test/regression/xlsx_files/protect04.xlsx +0 -0
  1238. data/test/regression/xlsx_files/protect05.xlsx +0 -0
  1239. data/test/regression/xlsx_files/protect06.xlsx +0 -0
  1240. data/test/regression/xlsx_files/protect07.xlsx +0 -0
  1241. data/test/regression/xlsx_files/set_row01.xlsx +0 -0
  1242. data/test/regression/xlsx_files/set_row03.xlsx +0 -0
  1243. data/test/regression/xlsx_files/table18.xlsx +0 -0
  1244. data/test/regression/xlsx_files/table19.xlsx +0 -0
  1245. data/test/regression/xlsx_files/table21.xlsx +0 -0
  1246. data/test/regression/xlsx_files/table22.xlsx +0 -0
  1247. data/test/regression/xlsx_files/table23.xlsx +0 -0
  1248. data/test/regression/xlsx_files/table24.xlsx +0 -0
  1249. data/test/regression/xlsx_files/table25.xlsx +0 -0
  1250. data/test/regression/xlsx_files/table26.xlsx +0 -0
  1251. data/test/regression/xlsx_files/types02.xlsx +0 -0
  1252. data/test/regression/xlsx_files/types08.xlsx +0 -0
  1253. data/test/regression/xlsx_files/update_range_format_with_params.xlsx +0 -0
  1254. data/test/regression/xlsx_files/utf8_11.xlsx +0 -0
  1255. data/test/test_delete_files.rb +3 -3
  1256. data/test/test_example_match.rb +1342 -781
  1257. data/test/test_option_hash_for_workbook.rb +1 -1
  1258. data/test/test_xml_writer_simple.rb +1 -1
  1259. data/test/utility/test_range.rb +20 -0
  1260. data/test/workbook/test_check_sheetname.rb +51 -0
  1261. data/test/workbook/test_define_name.rb +1 -1
  1262. data/test/workbook/test_get_chart_range.rb +3 -5
  1263. data/test/workbook/test_sort_defined_names.rb +1 -1
  1264. data/test/workbook/test_workbook_01.rb +1 -1
  1265. data/test/workbook/test_workbook_02.rb +1 -1
  1266. data/test/workbook/test_workbook_03.rb +1 -1
  1267. data/test/workbook/test_worksheet_by_name.rb +35 -0
  1268. data/test/workbook/test_write_calc_pr.rb +1 -1
  1269. data/test/workbook/test_write_defined_name.rb +1 -1
  1270. data/test/workbook/test_write_defined_names.rb +1 -1
  1271. data/test/workbook/test_write_workbook_view.rb +117 -0
  1272. data/test/worksheet/test_calculate_spans.rb +1 -1
  1273. data/test/worksheet/test_cond_format_01.rb +1 -1
  1274. data/test/worksheet/test_cond_format_02.rb +1 -1
  1275. data/test/worksheet/test_cond_format_03.rb +1 -1
  1276. data/test/worksheet/test_cond_format_04.rb +1 -1
  1277. data/test/worksheet/test_cond_format_05.rb +1 -1
  1278. data/test/worksheet/test_cond_format_06.rb +1 -1
  1279. data/test/worksheet/test_cond_format_07.rb +1 -1
  1280. data/test/worksheet/test_cond_format_08.rb +1 -1
  1281. data/test/worksheet/test_cond_format_09.rb +1 -1
  1282. data/test/worksheet/test_cond_format_10.rb +1 -1
  1283. data/test/worksheet/test_cond_format_11.rb +1 -1
  1284. data/test/worksheet/test_cond_format_12.rb +1 -1
  1285. data/test/worksheet/test_cond_format_13.rb +1 -1
  1286. data/test/worksheet/test_cond_format_14.rb +1 -1
  1287. data/test/worksheet/test_cond_format_15.rb +1 -1
  1288. data/test/worksheet/test_cond_format_16.rb +1 -1
  1289. data/test/worksheet/test_cond_format_17.rb +1 -1
  1290. data/test/worksheet/test_cond_format_18.rb +1 -1
  1291. data/test/worksheet/test_cond_format_19.rb +1 -1
  1292. data/test/worksheet/test_cond_format_20.rb +1 -1
  1293. data/test/worksheet/test_cond_format_21.rb +90 -0
  1294. data/test/worksheet/test_cond_format_22.rb +266 -0
  1295. data/test/worksheet/test_cond_format_23.rb +242 -0
  1296. data/test/worksheet/test_cond_format_24.rb +303 -0
  1297. data/test/worksheet/test_convert_date_time_01.rb +1 -1
  1298. data/test/worksheet/test_convert_date_time_02.rb +1 -1
  1299. data/test/worksheet/test_convert_date_time_03.rb +1 -1
  1300. data/test/worksheet/test_convert_date_time_04.rb +1 -1
  1301. data/test/worksheet/test_data_bar_01.rb +53 -0
  1302. data/test/worksheet/test_data_bar_02.rb +79 -0
  1303. data/test/worksheet/test_data_bar_03.rb +147 -0
  1304. data/test/worksheet/test_data_bar_04.rb +145 -0
  1305. data/test/worksheet/test_data_bar_05.rb +147 -0
  1306. data/test/worksheet/test_data_bar_06.rb +145 -0
  1307. data/test/worksheet/test_data_bar_07.rb +146 -0
  1308. data/test/worksheet/test_data_bar_08.rb +54 -0
  1309. data/test/worksheet/test_data_bar_09.rb +80 -0
  1310. data/test/worksheet/test_data_bar_10.rb +165 -0
  1311. data/test/worksheet/test_data_bar_11.rb +167 -0
  1312. data/test/worksheet/test_data_bar_12.rb +104 -0
  1313. data/test/worksheet/test_extract_filter_tokens.rb +1 -1
  1314. data/test/worksheet/test_parse_filter_expression.rb +1 -1
  1315. data/test/worksheet/test_pixels_to_row_col.rb +46 -0
  1316. data/test/worksheet/test_position_object.rb +1 -1
  1317. data/test/worksheet/test_repeat_formula.rb +1 -1
  1318. data/test/worksheet/test_sparkline_01.rb +1 -1
  1319. data/test/worksheet/test_sparkline_02.rb +1 -1
  1320. data/test/worksheet/test_sparkline_03.rb +1 -1
  1321. data/test/worksheet/test_sparkline_04.rb +1 -1
  1322. data/test/worksheet/test_sparkline_05.rb +1 -1
  1323. data/test/worksheet/test_sparkline_06.rb +1 -1
  1324. data/test/worksheet/test_sparkline_07.rb +1 -1
  1325. data/test/worksheet/test_sparkline_08.rb +1 -1
  1326. data/test/worksheet/test_sparkline_09.rb +1 -1
  1327. data/test/worksheet/test_sparkline_10.rb +1 -1
  1328. data/test/worksheet/test_sparkline_11.rb +1 -1
  1329. data/test/worksheet/test_sparkline_12.rb +94 -0
  1330. data/test/worksheet/test_update_format_methods.rb +91 -0
  1331. data/test/worksheet/test_worksheet_01.rb +1 -1
  1332. data/test/worksheet/test_worksheet_02.rb +1 -1
  1333. data/test/worksheet/test_worksheet_03.rb +1 -1
  1334. data/test/worksheet/test_worksheet_04.rb +1 -1
  1335. data/test/worksheet/test_write_array_formula_01.rb +1 -8
  1336. data/test/worksheet/test_write_autofilter.rb +1 -1
  1337. data/test/worksheet/test_write_brk.rb +1 -1
  1338. data/test/worksheet/test_write_cell.rb +1 -1
  1339. data/test/worksheet/test_write_cell_value.rb +1 -1
  1340. data/test/worksheet/test_write_col_breaks.rb +1 -1
  1341. data/test/worksheet/test_write_col_info.rb +1 -1
  1342. data/test/worksheet/test_write_conditional_formatting.rb +1 -1
  1343. data/test/worksheet/test_write_custom_filter.rb +1 -1
  1344. data/test/worksheet/test_write_custom_filters.rb +1 -1
  1345. data/test/worksheet/test_write_data_validation_01.rb +1 -1
  1346. data/test/worksheet/test_write_data_validation_02.rb +59 -2
  1347. data/test/worksheet/test_write_dimension.rb +1 -1
  1348. data/test/worksheet/test_write_filter.rb +1 -1
  1349. data/test/worksheet/test_write_filter_column.rb +1 -1
  1350. data/test/worksheet/test_write_filters.rb +1 -1
  1351. data/test/worksheet/test_write_formula_does_not_change_formula_string.rb +1 -1
  1352. data/test/worksheet/test_write_header_footer.rb +1 -1
  1353. data/test/worksheet/test_write_hyperlink.rb +1 -8
  1354. data/test/worksheet/test_write_legacy_drawing.rb +1 -1
  1355. data/test/worksheet/test_write_merge_cell.rb +1 -1
  1356. data/test/worksheet/test_write_merge_cells.rb +1 -1
  1357. data/test/worksheet/test_write_methods.rb +68 -177
  1358. data/test/worksheet/test_write_page_margins.rb +1 -1
  1359. data/test/worksheet/test_write_page_set_up_pr.rb +1 -1
  1360. data/test/worksheet/test_write_page_setup.rb +1 -1
  1361. data/test/worksheet/test_write_pane.rb +1 -1
  1362. data/test/worksheet/test_write_phonetic_pr.rb +1 -1
  1363. data/test/worksheet/test_write_print_options.rb +1 -1
  1364. data/test/worksheet/test_write_row_breaks.rb +1 -1
  1365. data/test/worksheet/test_write_row_element.rb +1 -1
  1366. data/test/worksheet/test_write_selection.rb +1 -1
  1367. data/test/worksheet/test_write_sheet_calc_pr.rb +1 -1
  1368. data/test/worksheet/test_write_sheet_data.rb +1 -1
  1369. data/test/worksheet/test_write_sheet_format_pr.rb +1 -1
  1370. data/test/worksheet/test_write_sheet_pr.rb +1 -1
  1371. data/test/worksheet/test_write_sheet_protection.rb +1 -1
  1372. data/test/worksheet/test_write_sheet_view.rb +20 -2
  1373. data/test/worksheet/test_write_sheet_view1.rb +1 -1
  1374. data/test/worksheet/test_write_sheet_view2.rb +1 -1
  1375. data/test/worksheet/test_write_sheet_view3.rb +1 -1
  1376. data/test/worksheet/test_write_sheet_view4.rb +1 -1
  1377. data/test/worksheet/test_write_sheet_view5.rb +1 -1
  1378. data/test/worksheet/test_write_sheet_view6.rb +1 -1
  1379. data/test/worksheet/test_write_sheet_view7.rb +1 -1
  1380. data/test/worksheet/test_write_sheet_view8.rb +1 -1
  1381. data/test/worksheet/test_write_sheet_view9.rb +1 -1
  1382. data/test/worksheet/test_write_tab_color.rb +1 -1
  1383. data/test/worksheet/test_write_worksheet_attributes.rb +1 -1
  1384. data/write_xlsx.gemspec +4 -3
  1385. metadata +937 -18
  1386. data/test/package/comments/test_write_text_t.rb +0 -44
  1387. data/test/test_col_name.rb +0 -13
  1388. data/test/workbook/test_workbook_new.rb +0 -18
  1389. data/test/worksheet/test_write_multiline_string_with_url.rb +0 -30
  1390. data/test/worksheet/test_write_url.rb +0 -19
@@ -2,7 +2,7 @@
2
2
  require 'helper'
3
3
  require 'write_xlsx'
4
4
 
5
- class TestExampleMatch < Test::Unit::TestCase
5
+ class TestExampleMatch < Minitest::Test
6
6
  def setup
7
7
  setup_dir_var
8
8
  end
@@ -11,6 +11,18 @@ class TestExampleMatch < Test::Unit::TestCase
11
11
  @tempfile.close
12
12
  end
13
13
 
14
+ def test_multi_line
15
+ @xlsx = 'multi_line.xlsx'
16
+ workbook = WriteXLSX.new(@io)
17
+ worksheet = workbook.add_worksheet
18
+
19
+ worksheet.write(0, 0, "Hi Excel!\n1234\nHi, again!")
20
+
21
+ workbook.close
22
+ store_to_tempfile
23
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
24
+ end
25
+
14
26
  def test_a_simple
15
27
  @xlsx = 'a_simple.xlsx'
16
28
  # Create a new workbook called simple.xls and add a worksheet
@@ -36,9 +48,9 @@ class TestExampleMatch < Test::Unit::TestCase
36
48
 
37
49
  # Write a hyperlink
38
50
  hyperlink_format = workbook.add_format(
39
- :color => 'blue',
40
- :underline => 1
41
- )
51
+ :color => 'blue',
52
+ :underline => 1
53
+ )
42
54
 
43
55
  worksheet.write(10, 0, 'http://www.ruby-lang.org/', hyperlink_format)
44
56
 
@@ -242,6 +254,393 @@ class TestExampleMatch < Test::Unit::TestCase
242
254
  compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
243
255
  end
244
256
 
257
+ def teset_background
258
+ @xlsx = 'background.xlsx'
259
+ workbook = WriteXLSX.new(@io)
260
+
261
+ worksheet = workbook.add_worksheet
262
+ worksheet.set_background(File.join(@test_dir, 'republic.png'))
263
+
264
+ workbook.close
265
+ store_to_tempfile
266
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
267
+ end
268
+
269
+ def test_chart_data_labels
270
+ @xlsx = 'chart_data_labels.xlsx'
271
+ workbook = WriteXLSX.new(@io)
272
+
273
+ worksheet = workbook.add_worksheet
274
+ bold = workbook.add_format(:bold => 1)
275
+
276
+ # Add the worksheet data that the charts will refer to.
277
+ headings = ['Number', 'Data', 'Text']
278
+ data = [
279
+ [ 2, 3, 4, 5, 6, 7 ],
280
+ [20, 10, 20, 30, 40, 30 ],
281
+ ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
282
+ ]
283
+
284
+ worksheet.write('A1', headings, bold)
285
+ worksheet.write('A2', data)
286
+
287
+
288
+ #######################################################################
289
+ #
290
+ # Example with standard data labels.
291
+ #
292
+
293
+ # Create a Column chart.
294
+ chart1 = workbook.add_chart(:type => 'column', :embedded => 1)
295
+
296
+ # Configure the data series and add the data labels.
297
+ chart1.add_series(
298
+ :categories => '=Sheet1!$A$2:$A$7',
299
+ :values => '=Sheet1!$B$2:$B$7',
300
+ :data_labels => { :value => 1 }
301
+ )
302
+
303
+ # Add a chart title.
304
+ chart1.set_title(:name => 'Chart with standard data labels')
305
+
306
+ # Turn off the chart legend.
307
+ chart1.set_legend(:none => 1)
308
+
309
+ # Insert the chart into the worksheet (with an offset).
310
+ worksheet.insert_chart('D2', chart1, { :x_offset => 25, :y_offset => 10 })
311
+
312
+
313
+ #######################################################################
314
+ #
315
+ # Example with value and category data labels.
316
+ #
317
+
318
+ # Create a Column chart.
319
+ chart2 = workbook.add_chart(:type => 'column', :embedded => 1)
320
+
321
+ # Configure the data series and add the data labels.
322
+ chart2.add_series(
323
+ :categories => '=Sheet1!$A$2:$A$7',
324
+ :values => '=Sheet1!$B$2:$B$7',
325
+ :data_labels => { :value => 1, :category => 1 }
326
+ )
327
+
328
+ # Add a chart title.
329
+ chart2.set_title(:name => 'Category and Value data labels')
330
+
331
+ # Turn off the chart legend.
332
+ chart2.set_legend(:none => 1)
333
+
334
+ # Insert the chart into the worksheet (with an offset).
335
+ worksheet.insert_chart('D18', chart2, { :x_offset => 25, :y_offset => 10 })
336
+
337
+
338
+ #######################################################################
339
+ #
340
+ # Example with standard data labels with different font.
341
+ #
342
+
343
+ # Create a Column chart.
344
+ chart3 = workbook.add_chart(:type => 'column', :embedded => 1)
345
+
346
+ # Configure the data series and add the data labels.
347
+ chart3.add_series(
348
+ :categories => '=Sheet1!$A$2:$A$7',
349
+ :values => '=Sheet1!$B$2:$B$7',
350
+ :data_labels => { :value => 1,
351
+ :font => {:bold => 1,
352
+ :color => 'red',
353
+ :rotation => -30}
354
+ }
355
+ )
356
+
357
+ # Add a chart title.
358
+ chart3.set_title(:name => 'Data labels with user defined font')
359
+
360
+ # Turn off the chart legend.
361
+ chart3.set_legend(:none => 1)
362
+
363
+ # Insert the chart into the worksheet (with an offset).
364
+ worksheet.insert_chart('D34', chart3, { :x_offset => 25, :y_offset => 10 })
365
+
366
+
367
+ #######################################################################
368
+ #
369
+ # Example with custom string data labels.
370
+ #
371
+
372
+ # Create a Column chart.
373
+ chart4 = workbook.add_chart(:type => 'column', :embedded => 1)
374
+
375
+ # Configure the data series and add the data labels.
376
+ chart4.add_series(
377
+ :categories => '=Sheet1!$A$2:$A$7',
378
+ :values => '=Sheet1!$B$2:$B$7',
379
+ :data_labels => {
380
+ :value => 1,
381
+ :border => {:color => 'red'},
382
+ :fill => {:color => 'yellow'}
383
+ }
384
+ )
385
+
386
+ # Add a chart title.
387
+ chart4.set_title(:name => 'Data labels with formatting')
388
+
389
+ # Turn off the chart legend.
390
+ chart4.set_legend(:none => 1)
391
+
392
+ # Insert the chart into the worksheet (with an offset).
393
+ worksheet.insert_chart('D50', chart4, { :x_offset => 25, :y_offset => 10 })
394
+
395
+
396
+ #######################################################################
397
+ #
398
+ # Example with custom string data labels.
399
+ #
400
+
401
+ # Create a Column chart.
402
+ chart5 = workbook.add_chart( :type => 'column', :embedded => 1 )
403
+
404
+ # Some custom labels.
405
+ custom_labels = [
406
+ { :value => 'Amy' },
407
+ { :value => 'Bea' },
408
+ { :value => 'Eva' },
409
+ { :value => 'Fay' },
410
+ { :value => 'Liv' },
411
+ { :value => 'Una' }
412
+ ]
413
+
414
+ # Configure the data series and add the data labels.
415
+ chart5.add_series(
416
+ :categories => '=Sheet1!$A$2:$A$7',
417
+ :values => '=Sheet1!$B$2:$B$7',
418
+ :data_labels => { :value => 1, :custom => custom_labels }
419
+ )
420
+
421
+ # Add a chart title.
422
+ chart5.set_title(:name => 'Chart with custom string data labels')
423
+
424
+ # Turn off the chart legend.
425
+ chart5.set_legend(:none => 1)
426
+
427
+ # Insert the chart into the worksheet (with an offset).
428
+ worksheet.insert_chart('D66', chart5, { :x_offset => 25, :y_offset => 10 })
429
+
430
+
431
+ #######################################################################
432
+ #
433
+ # Example with custom data labels from cells.
434
+ #
435
+
436
+ # Create a Column chart.
437
+ chart6 = workbook.add_chart(:type => 'column', :embedded => 1)
438
+
439
+ # Some custom labels.
440
+ custom_labels = [
441
+ { :value => '=Sheet1!$C$2' },
442
+ { :value => '=Sheet1!$C$3' },
443
+ { :value => '=Sheet1!$C$4' },
444
+ { :value => '=Sheet1!$C$5' },
445
+ { :value => '=Sheet1!$C$6' },
446
+ { :value => '=Sheet1!$C$7' }
447
+ ]
448
+
449
+
450
+ # Configure the data series and add the data labels.
451
+ chart6.add_series(
452
+ :categories => '=Sheet1!$A$2:$A$7',
453
+ :values => '=Sheet1!$B$2:$B$7',
454
+ :data_labels => { :value => 1, :custom => custom_labels }
455
+ )
456
+
457
+ # Add a chart title.
458
+ chart6.set_title(:name => 'Chart with custom data labels from cells')
459
+
460
+ # Turn off the chart legend.
461
+ chart6.set_legend(:none => 1)
462
+
463
+ # Insert the chart into the worksheet (with an offset).
464
+ worksheet.insert_chart('D82', chart6, { :x_offset => 25, :y_offset => 10 })
465
+
466
+
467
+ #######################################################################
468
+ #
469
+ # Example with custom and default data labels.
470
+ #
471
+
472
+ # Create a Column chart.
473
+ chart7 = workbook.add_chart(:type => 'column', :embedded => 1)
474
+
475
+ # Some custom labels. The nil items will get the default value.
476
+ # We also set a font for the custom items as an extra example.
477
+ custom_labels = [
478
+ { :value => '=Sheet1!$C$2', :font => { :color => 'red' } },
479
+ nil,
480
+ { :value => '=Sheet1!$C$4', :font => { :color => 'red' } },
481
+ { :value => '=Sheet1!$C$5', :font => { :color => 'red' } }
482
+ ]
483
+
484
+
485
+ # Configure the data series and add the data labels.
486
+ chart7.add_series(
487
+ :categories => '=Sheet1!$A$2:$A$7',
488
+ :values => '=Sheet1!$B$2:$B$7',
489
+ :data_labels => { :value => 1, :custom => custom_labels }
490
+ )
491
+
492
+ # Add a chart title.
493
+ chart7.set_title(:name => 'Mixed custom and default data labels')
494
+
495
+ # Turn off the chart legend.
496
+ chart7.set_legend(:none => 1)
497
+
498
+ # Insert the chart into the worksheet (with an offset).
499
+ worksheet.insert_chart('D98', chart7, { :x_offset => 25, :y_offset => 10 })
500
+
501
+
502
+ #######################################################################
503
+ #
504
+ # Example with deleted custom data labels.
505
+ #
506
+
507
+ # Create a Column chart.
508
+ chart8 = workbook.add_chart(:type => 'column', :embedded => 1)
509
+
510
+ # Some deleted custom labels and defaults (nil). This allows us to
511
+ # highlight certain values such as the minimum and maximum.
512
+ custom_labels = [
513
+ { :delete => 1 },
514
+ nil,
515
+ { :delete => 1 },
516
+ { :delete => 1 },
517
+ nil,
518
+ { :delete => 1 }
519
+ ]
520
+
521
+ # Configure the data series and add the data labels.
522
+ chart8.add_series(
523
+ :categories => '=Sheet1!$A$2:$A$7',
524
+ :values => '=Sheet1!$B$2:$B$7',
525
+ :data_labels => { :value => 1, :custom => custom_labels }
526
+ )
527
+
528
+ # Add a chart title.
529
+ chart8.set_title(:name => 'Chart with deleted data labels')
530
+
531
+ # Turn off the chart legend.
532
+ chart8.set_legend(:none => 1)
533
+
534
+ # Insert the chart into the worksheet (with an offset).
535
+ worksheet.insert_chart('D114', chart8, { :x_offset => 25, :y_offset => 10 })
536
+
537
+ #######################################################################
538
+ #
539
+ # Example with custom string data labels and formatting.
540
+ #
541
+
542
+ # Create a Column chart.
543
+ chart9 = workbook.add_chart( :type => 'column', :embedded => 1 )
544
+
545
+ # Some custom labels.
546
+ custom_labels = [
547
+ { :value => 'Amy', :border => {:color => 'blue'} },
548
+ { :value => 'Bea' },
549
+ { :value => 'Eva' },
550
+ { :value => 'Fay' },
551
+ { :value => 'Liv' },
552
+ { :value => 'Una', :fill => {:color => 'green'} }
553
+ ]
554
+
555
+
556
+ # Configure the data series and add the data labels.
557
+ chart9.add_series(
558
+ :categories => '=Sheet1!$A$2:$A$7',
559
+ :values => '=Sheet1!$B$2:$B$7',
560
+ :data_labels => {
561
+ :value => 1,
562
+ :custom => custom_labels,
563
+ :border => {:color => 'red'},
564
+ :fill => {:color => 'yellow'}
565
+ }
566
+ )
567
+
568
+ # Add a chart title.
569
+ chart9.set_title( :name => 'Chart with custom labels and formatting' )
570
+
571
+ # Turn off the chart legend.
572
+ chart9.set_legend( :none => 1 )
573
+
574
+ # Insert the chart into the worksheet (with an offset).
575
+ worksheet.insert_chart( 'D130', chart9, { :x_offset => 25, :y_offset => 10 } )
576
+
577
+ workbook.close
578
+ store_to_tempfile
579
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
580
+ end
581
+
582
+ def test_chart_gauge
583
+ @xlsx = 'chart_gauge.xlsx'
584
+ workbook = WriteXLSX.new(@io)
585
+ worksheet = workbook.add_worksheet
586
+
587
+ chart_doughnut = workbook.add_chart(:type => 'doughnut', :embedded => 1)
588
+ chart_pie = workbook.add_chart(:type => 'pie', :embedded => 1)
589
+
590
+ # Add some data for the Doughnut and Pie charts. This is set up so the
591
+ # gauge goes from 0-100. It is initially set at 75%.
592
+ worksheet.write_col('H2', ['Donut', 25, 50, 25, 100])
593
+ worksheet.write_col('I2', ['Pie', 75, 1, '=200-I4-I3'])
594
+
595
+ # Configure the doughnut chart as the background for the gauge.
596
+ chart_doughnut.add_series(
597
+ :name => '=Sheet1!$H$2',
598
+ :values => '=Sheet1!$H$3:$H$6',
599
+ :points => [
600
+ { :fill => { :color => 'green' } },
601
+ { :fill => { :color => 'yellow' } },
602
+ { :fill => { :color => 'red' } },
603
+ { :fill => { :none => 1 } }
604
+ ]
605
+ )
606
+
607
+ # Rotate chart so the gauge parts are above the horizontal.
608
+ chart_doughnut.set_rotation(270)
609
+
610
+ # Turn off the chart legend.
611
+ chart_doughnut.set_legend(:none => 1)
612
+
613
+ # Turn off the chart fill and border.
614
+ chart_doughnut.set_chartarea(
615
+ :border => { :none => 1 },
616
+ :fill => { :none => 1 }
617
+ )
618
+
619
+ # Configure the pie chart as the needle for the gauge.
620
+ chart_pie.add_series(
621
+ :name => '=Sheet1!$I$2',
622
+ :values => '=Sheet1!$I$3:$I$6',
623
+ :points => [
624
+ { :fill => { :none => 1 } },
625
+ { :fill => { :color => 'black' } },
626
+ { :fill => { :none => 1 } }
627
+ ]
628
+ )
629
+
630
+ # Rotate the pie chart/needle to align with the doughnut/gauge.
631
+ chart_pie.set_rotation(270)
632
+
633
+ # Combine the pie and doughnut charts.
634
+ chart_doughnut.combine(chart_pie)
635
+
636
+ # Insert the chart into the worksheet.
637
+ worksheet.insert_chart('A1', chart_doughnut)
638
+
639
+ workbook.close
640
+ store_to_tempfile
641
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
642
+ end
643
+
245
644
  def test_chart_scatter06
246
645
  @xlsx = 'chart_scatter06.xlsx'
247
646
  workbook = WriteXLSX.new(@io)
@@ -252,23 +651,23 @@ class TestExampleMatch < Test::Unit::TestCase
252
651
  chart.instance_variable_set(:@axis_ids, [57708544, 44297600])
253
652
 
254
653
  data = [
255
- [ 1, 2, 3, 4, 5 ],
256
- [ 2, 4, 6, 8, 10 ],
257
- [ 3, 6, 9, 12, 15 ]
654
+ [ 1, 2, 3, 4, 5 ],
655
+ [ 2, 4, 6, 8, 10 ],
656
+ [ 3, 6, 9, 12, 15 ]
258
657
 
259
- ]
658
+ ]
260
659
 
261
660
  worksheet.write('A1', data)
262
661
 
263
662
  chart.add_series(
264
- :categories => '=Sheet1!$A$1:$A$5',
265
- :values => '=Sheet1!$B$1:$B$5'
266
- )
663
+ :categories => '=Sheet1!$A$1:$A$5',
664
+ :values => '=Sheet1!$B$1:$B$5'
665
+ )
267
666
 
268
667
  chart.add_series(
269
- :categories => '=Sheet1!$A$1:$A$5',
270
- :values => '=Sheet1!$C$1:$C$5'
271
- )
668
+ :categories => '=Sheet1!$A$1:$A$5',
669
+ :values => '=Sheet1!$C$1:$C$5'
670
+ )
272
671
 
273
672
  chart.set_x_axis(:minor_unit => 1, :major_unit => 3)
274
673
  chart.set_y_axis(:minor_unit => 2, :major_unit => 4)
@@ -281,7 +680,7 @@ class TestExampleMatch < Test::Unit::TestCase
281
680
  end
282
681
 
283
682
  def autofilter_data
284
- <<EOS
683
+ <<EOS
285
684
  Region Item Volume Month
286
685
  East Apple 9000 July
287
686
  East Apple 5000 July
@@ -345,10 +744,10 @@ EOS
345
744
  # Add the worksheet data that the charts will refer to.
346
745
  headings = [ 'Number', 'Batch 1', 'Batch 2' ]
347
746
  data = [
348
- [ 2, 3, 4, 5, 6, 7 ],
349
- [ 40, 40, 50, 30, 25, 50 ],
350
- [ 30, 25, 30, 10, 5, 10 ]
351
- ]
747
+ [ 2, 3, 4, 5, 6, 7 ],
748
+ [ 40, 40, 50, 30, 25, 50 ],
749
+ [ 30, 25, 30, 10, 5, 10 ]
750
+ ]
352
751
 
353
752
  worksheet.write('A1', headings, bold)
354
753
  worksheet.write('A2', data)
@@ -358,18 +757,18 @@ EOS
358
757
 
359
758
  # Configure the first series.
360
759
  chart.add_series(
361
- :name => '=Sheet1!$B$1',
362
- :categories => '=Sheet1!$A$2:$A$7',
363
- :values => '=Sheet1!$B$2:$B$7'
364
- )
760
+ :name => '=Sheet1!$B$1',
761
+ :categories => '=Sheet1!$A$2:$A$7',
762
+ :values => '=Sheet1!$B$2:$B$7'
763
+ )
365
764
 
366
765
  # Configure second series. Note alternative use of array ref to define
367
766
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
368
767
  chart.add_series(
369
- :name => '=Sheet1!$C$1',
370
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
371
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
372
- )
768
+ :name => '=Sheet1!$C$1',
769
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
770
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
771
+ )
373
772
 
374
773
  # Add a chart title and some axis labels.
375
774
  chart.set_title(:name => 'Results of sample analysis')
@@ -396,9 +795,9 @@ EOS
396
795
  # Add the worksheet data that the charts will refer to.
397
796
  headings = [ 'Number', 'Batch 1', 'Batch 2' ]
398
797
  data = [
399
- [ 2, 3, 4, 5, 6, 7 ],
400
- [ 10, 40, 50, 20, 10, 50 ],
401
- [ 30, 60, 70, 50, 40, 30 ]
798
+ [ 2, 3, 4, 5, 6, 7 ],
799
+ [ 10, 40, 50, 20, 10, 50 ],
800
+ [ 30, 60, 70, 50, 40, 30 ]
402
801
  ]
403
802
 
404
803
  worksheet.write('A1', headings, bold)
@@ -409,17 +808,17 @@ EOS
409
808
 
410
809
  # Configure the first series.
411
810
  chart.add_series(
412
- :name => '=Sheet1!$B$1',
413
- :categories => '=Sheet1!$A$2:$A$7',
414
- :values => '=Sheet1!$B$2:$B$7'
811
+ :name => '=Sheet1!$B$1',
812
+ :categories => '=Sheet1!$A$2:$A$7',
813
+ :values => '=Sheet1!$B$2:$B$7'
415
814
  )
416
815
 
417
816
  # Configure second series. Note alternative use of array ref to define
418
817
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
419
818
  chart.add_series(
420
- :name => '=Sheet1!$C$1',
421
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
422
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
819
+ :name => '=Sheet1!$C$1',
820
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
821
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
423
822
  )
424
823
 
425
824
  # Add a chart title and some axis labels.
@@ -447,9 +846,9 @@ EOS
447
846
  # Add the worksheet data that the charts will refer to.
448
847
  headings = [ 'Number', 'Batch 1', 'Batch 2' ]
449
848
  data = [
450
- [ 2, 3, 4, 5, 6, 7 ],
451
- [ 10, 40, 50, 20, 10, 50 ],
452
- [ 30, 60, 70, 50, 40, 30 ]
849
+ [ 2, 3, 4, 5, 6, 7 ],
850
+ [ 10, 40, 50, 20, 10, 50 ],
851
+ [ 30, 60, 70, 50, 40, 30 ]
453
852
  ]
454
853
 
455
854
  worksheet.write('A1', headings, bold)
@@ -460,17 +859,17 @@ EOS
460
859
 
461
860
  # Configure the first series.
462
861
  chart.add_series(
463
- :name => '=Sheet1!$B$1',
464
- :categories => '=Sheet1!$A$2:$A$7',
465
- :values => '=Sheet1!$B$2:$B$7'
862
+ :name => '=Sheet1!$B$1',
863
+ :categories => '=Sheet1!$A$2:$A$7',
864
+ :values => '=Sheet1!$B$2:$B$7'
466
865
  )
467
866
 
468
867
  # Configure second series. Note alternative use of array ref to define
469
868
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
470
869
  chart.add_series(
471
- :name => '=Sheet1!$C$1',
472
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
473
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
870
+ :name => '=Sheet1!$C$1',
871
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
872
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
474
873
  )
475
874
 
476
875
  # Add a chart title and some axis labels.
@@ -498,9 +897,9 @@ EOS
498
897
  # Add the worksheet data that the charts will refer to.
499
898
  headings = [ 'Category', 'Values' ]
500
899
  data = [
501
- [ 'Glazed', 'Chocolate', 'Cream' ],
502
- [ 50, 35, 15 ]
503
- ]
900
+ [ 'Glazed', 'Chocolate', 'Cream' ],
901
+ [ 50, 35, 15 ]
902
+ ]
504
903
 
505
904
  worksheet.write('A1', headings, bold)
506
905
  worksheet.write('A2', data)
@@ -512,10 +911,10 @@ EOS
512
911
  # [ $sheetname, $row_start, $row_end, $col_start, $col_end ].
513
912
  # See below for an alternative syntax.
514
913
  chart1.add_series(
515
- :name => 'Doughnut sales data',
516
- :categories => [ 'Sheet1', 1, 3, 0, 0 ],
517
- :values => [ 'Sheet1', 1, 3, 1, 1 ]
518
- );
914
+ :name => 'Doughnut sales data',
915
+ :categories => [ 'Sheet1', 1, 3, 0, 0 ],
916
+ :values => [ 'Sheet1', 1, 3, 1, 1 ]
917
+ )
519
918
 
520
919
  # Add a title.
521
920
  chart1.set_title(:name => 'Popular Doughnut Types')
@@ -536,15 +935,15 @@ EOS
536
935
 
537
936
  # Configure the series and add user defined segment colours.
538
937
  chart2.add_series(
539
- :name => 'Doughnut sales data',
540
- :categories => '=Sheet1!$A$2:$A$4',
541
- :values => '=Sheet1!$B$2:$B$4',
542
- :points => [
543
- { :fill => { :color => '#FA58D0' } },
544
- { :fill => { :color => '#61210B' } },
545
- { :fill => { :color => '#F5F6CE' } }
546
- ]
547
- )
938
+ :name => 'Doughnut sales data',
939
+ :categories => '=Sheet1!$A$2:$A$4',
940
+ :values => '=Sheet1!$B$2:$B$4',
941
+ :points => [
942
+ { :fill => { :color => '#FA58D0' } },
943
+ { :fill => { :color => '#61210B' } },
944
+ { :fill => { :color => '#F5F6CE' } }
945
+ ]
946
+ )
548
947
 
549
948
  # Add a title.
550
949
  chart2.set_title(:name => 'Doughnut Chart with user defined colors')
@@ -563,10 +962,10 @@ EOS
563
962
 
564
963
  # Configure the series.
565
964
  chart3.add_series(
566
- :name => 'Doughnut sales data',
567
- :categories => '=Sheet1!$A$2:$A$4',
568
- :values => '=Sheet1!$B$2:$B$4'
569
- )
965
+ :name => 'Doughnut sales data',
966
+ :categories => '=Sheet1!$A$2:$A$4',
967
+ :values => '=Sheet1!$B$2:$B$4'
968
+ )
570
969
 
571
970
  # Add a title.
572
971
  chart3.set_title(:name => 'Doughnut Chart with segment rotation')
@@ -587,10 +986,10 @@ EOS
587
986
 
588
987
  # Configure the series.
589
988
  chart4.add_series(
590
- :name => 'Doughnut sales data',
591
- :categories => '=Sheet1!$A$2:$A$4',
592
- :values => '=Sheet1!$B$2:$B$4'
593
- )
989
+ :name => 'Doughnut sales data',
990
+ :categories => '=Sheet1!$A$2:$A$4',
991
+ :values => '=Sheet1!$B$2:$B$4'
992
+ )
594
993
 
595
994
  # Add a title.
596
995
  chart4.set_title(:name => 'Doughnut Chart with user defined hole size')
@@ -615,9 +1014,9 @@ EOS
615
1014
  # Add the worksheet data that the charts will refer to.
616
1015
  headings = [ 'Number', 'Batch 1', 'Batch 2' ]
617
1016
  data = [
618
- [ 2, 3, 4, 5, 6, 7 ],
619
- [ 10, 40, 50, 20, 10, 50 ],
620
- [ 30, 60, 70, 50, 40, 30 ]
1017
+ [ 2, 3, 4, 5, 6, 7 ],
1018
+ [ 10, 40, 50, 20, 10, 50 ],
1019
+ [ 30, 60, 70, 50, 40, 30 ]
621
1020
  ]
622
1021
 
623
1022
  worksheet.write('A1', headings, bold)
@@ -628,17 +1027,17 @@ EOS
628
1027
 
629
1028
  # Configure the first series.
630
1029
  chart.add_series(
631
- :name => '=Sheet1!$B$1',
632
- :categories => '=Sheet1!$A$2:$A$7',
633
- :values => '=Sheet1!$B$2:$B$7'
1030
+ :name => '=Sheet1!$B$1',
1031
+ :categories => '=Sheet1!$A$2:$A$7',
1032
+ :values => '=Sheet1!$B$2:$B$7'
634
1033
  )
635
1034
 
636
1035
  # Configure second series. Note alternative use of array ref to define
637
1036
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
638
1037
  chart.add_series(
639
- :name => '=Sheet1!$C$1',
640
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
641
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
1038
+ :name => '=Sheet1!$C$1',
1039
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
1040
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
642
1041
  )
643
1042
 
644
1043
  # Add a chart title and some axis labels.
@@ -652,6 +1051,81 @@ EOS
652
1051
  # Insert the chart into the worksheet (with an offset).
653
1052
  worksheet.insert_chart('D2', chart, 25, 10)
654
1053
 
1054
+ #
1055
+ # Create a stacked chart sub-type
1056
+ #
1057
+ chart2 = workbook.add_chart(
1058
+ :type => 'line',
1059
+ :embedded => 1,
1060
+ :subtype => 'stacked'
1061
+ )
1062
+
1063
+ # Configure the first series.
1064
+ chart2.add_series(
1065
+ :name => '=Sheet1!$B$1',
1066
+ :categories => '=Sheet1!$A$2:$A$7',
1067
+ :values => '=Sheet1!$B$2:$B$7'
1068
+ )
1069
+
1070
+ # Configure second series.
1071
+ chart2.add_series(
1072
+ :name => '=Sheet1!$C$1',
1073
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
1074
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
1075
+ )
1076
+
1077
+ # Add a chart title and some axis labels.
1078
+ chart2.set_title( :name => 'Stacked Chart' )
1079
+ chart2.set_x_axis( :name => 'Test number' )
1080
+ chart2.set_y_axis( :name => 'Sample length (mm)' )
1081
+
1082
+ # Set an Excel chart style. Blue colors with white outline and shadow.
1083
+ chart2.set_style( 12 )
1084
+
1085
+ # Insert the chart into the worksheet (with an offset).
1086
+ worksheet.insert_chart(
1087
+ 'D18', chart2,
1088
+ { :x_offset => 25, :y_offset => 10 }
1089
+ )
1090
+
1091
+
1092
+ #
1093
+ # Create a percent stacked chart sub-type
1094
+ #
1095
+ chart3 = workbook.add_chart(
1096
+ :type => 'line',
1097
+ :embedded => 1,
1098
+ :subtype => 'percent_stacked'
1099
+ )
1100
+
1101
+ # Configure the first series.
1102
+ chart3.add_series(
1103
+ :name => '=Sheet1!$B$1',
1104
+ :categories => '=Sheet1!$A$2:$A$7',
1105
+ :values => '=Sheet1!$B$2:$B$7'
1106
+ )
1107
+
1108
+ # Configure second series.
1109
+ chart3.add_series(
1110
+ :name => '=Sheet1!$C$1',
1111
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
1112
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
1113
+ )
1114
+
1115
+ # Add a chart title and some axis labels.
1116
+ chart3.set_title( :name => 'Percent Stacked Chart' )
1117
+ chart3.set_x_axis( :name => 'Test number' )
1118
+ chart3.set_y_axis( :name => 'Sample length (mm)' )
1119
+
1120
+ # Set an Excel chart style. Blue colors with white outline and shadow.
1121
+ chart3.set_style( 13 )
1122
+
1123
+ # Insert the chart into the worksheet (with an offset).
1124
+ worksheet.insert_chart(
1125
+ 'D34', chart3,
1126
+ { :x_offset => 25, :y_offset => 10 }
1127
+ )
1128
+
655
1129
  workbook.close
656
1130
  store_to_tempfile
657
1131
  compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
@@ -666,9 +1140,9 @@ EOS
666
1140
  # Add the worksheet data that the charts will refer to.
667
1141
  headings = [ 'Category', 'Values' ]
668
1142
  data = [
669
- [ 'Apple', 'Cherry', 'Pecan' ],
670
- [ 60, 30, 10 ]
671
- ]
1143
+ [ 'Apple', 'Cherry', 'Pecan' ],
1144
+ [ 60, 30, 10 ]
1145
+ ]
672
1146
 
673
1147
  worksheet.write('A1', headings, bold)
674
1148
  worksheet.write('A2', data)
@@ -680,10 +1154,10 @@ EOS
680
1154
  # [ $sheetname, $row_start, $row_end, $col_start, $col_end ].
681
1155
  # See below for an alternative syntax.
682
1156
  chart1.add_series(
683
- :name => 'Pie sales data',
684
- :categories => [ 'Sheet1', 1, 3, 0, 0 ],
685
- :values => [ 'Sheet1', 1, 3, 1, 1 ]
686
- )
1157
+ :name => 'Pie sales data',
1158
+ :categories => [ 'Sheet1', 1, 3, 0, 0 ],
1159
+ :values => [ 'Sheet1', 1, 3, 1, 1 ]
1160
+ )
687
1161
 
688
1162
  # Add a title.
689
1163
  chart1.set_title(:name => 'Popular Pie Types')
@@ -703,15 +1177,15 @@ EOS
703
1177
 
704
1178
  # Configure the series and add user defined segment colours.
705
1179
  chart2.add_series(
706
- :name => 'Pie sales data',
707
- :categories => '=Sheet1!$A$2:$A$4',
708
- :values => '=Sheet1!$B$2:$B$4',
709
- :points => [
710
- { :fill => { :color => '#5ABA10' } },
711
- { :fill => { :color => '#FE110E' } },
712
- { :fill => { :color => '#CA5C05' } }
713
- ]
714
- )
1180
+ :name => 'Pie sales data',
1181
+ :categories => '=Sheet1!$A$2:$A$4',
1182
+ :values => '=Sheet1!$B$2:$B$4',
1183
+ :points => [
1184
+ { :fill => { :color => '#5ABA10' } },
1185
+ { :fill => { :color => '#FE110E' } },
1186
+ { :fill => { :color => '#CA5C05' } }
1187
+ ]
1188
+ )
715
1189
 
716
1190
  # Add a title.
717
1191
  chart2.set_title(:name => 'Pie Chart with user defined colors')
@@ -733,10 +1207,10 @@ EOS
733
1207
  # Add the worksheet data that the charts will refer to.
734
1208
  headings = [ 'Number', 'Batch 1', 'Batch 2' ]
735
1209
  data = [
736
- [ 2, 3, 4, 5, 6, 7 ],
737
- [ 30, 60, 70, 50, 40, 30 ],
738
- [ 25, 40, 50, 30, 50, 40 ]
739
- ]
1210
+ [ 2, 3, 4, 5, 6, 7 ],
1211
+ [ 30, 60, 70, 50, 40, 30 ],
1212
+ [ 25, 40, 50, 30, 50, 40 ]
1213
+ ]
740
1214
 
741
1215
  worksheet.write('A1', headings, bold)
742
1216
  worksheet.write('A2', data)
@@ -746,18 +1220,18 @@ EOS
746
1220
 
747
1221
  # Configure the first series.
748
1222
  chart1.add_series(
749
- :name => '=Sheet1!$B$1',
750
- :categories => '=Sheet1!$A$2:$A$7',
751
- :values => '=Sheet1!$B$2:$B$7'
752
- )
1223
+ :name => '=Sheet1!$B$1',
1224
+ :categories => '=Sheet1!$A$2:$A$7',
1225
+ :values => '=Sheet1!$B$2:$B$7'
1226
+ )
753
1227
 
754
1228
  # Configure second series. Note alternative use of array ref to define
755
1229
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
756
1230
  chart1.add_series(
757
- :name => '=Sheet1!$C$1',
758
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
759
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
760
- )
1231
+ :name => '=Sheet1!$C$1',
1232
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
1233
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
1234
+ )
761
1235
 
762
1236
  # Add a chart title and some axis labels.
763
1237
  chart1.set_title(:name => 'Results of sample analysis')
@@ -774,24 +1248,24 @@ EOS
774
1248
  # Create a with_markers chart sub-type
775
1249
  #
776
1250
  chart2 = workbook.add_chart(
777
- :type => 'radar',
778
- :embedded => 1,
779
- :subtype => 'with_markers'
780
- )
1251
+ :type => 'radar',
1252
+ :embedded => 1,
1253
+ :subtype => 'with_markers'
1254
+ )
781
1255
 
782
1256
  # Configure the first series.
783
1257
  chart2.add_series(
784
- :name => '=Sheet1!$B$1',
785
- :categories => '=Sheet1!$A$2:$A$7',
786
- :values => '=Sheet1!$B$2:$B$7'
787
- )
1258
+ :name => '=Sheet1!$B$1',
1259
+ :categories => '=Sheet1!$A$2:$A$7',
1260
+ :values => '=Sheet1!$B$2:$B$7'
1261
+ )
788
1262
 
789
1263
  # Configure second series.
790
1264
  chart2.add_series(
791
- :name => '=Sheet1!$C$1',
792
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
793
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
794
- )
1265
+ :name => '=Sheet1!$C$1',
1266
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
1267
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
1268
+ )
795
1269
 
796
1270
  # Add a chart title and some axis labels.
797
1271
  chart2.set_title(:name => 'Stacked Chart')
@@ -808,24 +1282,24 @@ EOS
808
1282
  # Create a filled chart sub-type
809
1283
  #
810
1284
  chart3 = workbook.add_chart(
811
- :type => 'radar',
812
- :embedded => 1,
813
- :subtype => 'filled'
814
- )
1285
+ :type => 'radar',
1286
+ :embedded => 1,
1287
+ :subtype => 'filled'
1288
+ )
815
1289
 
816
1290
  # Configure the first series.
817
1291
  chart3.add_series(
818
- :name => '=Sheet1!$B$1',
819
- :categories => '=Sheet1!$A$2:$A$7',
820
- :values => '=Sheet1!$B$2:$B$7'
821
- )
1292
+ :name => '=Sheet1!$B$1',
1293
+ :categories => '=Sheet1!$A$2:$A$7',
1294
+ :values => '=Sheet1!$B$2:$B$7'
1295
+ )
822
1296
 
823
1297
  # Configure second series.
824
1298
  chart3.add_series(
825
- :name => '=Sheet1!$C$1',
826
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
827
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
828
- )
1299
+ :name => '=Sheet1!$C$1',
1300
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
1301
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
1302
+ )
829
1303
 
830
1304
  # Add a chart title and some axis labels.
831
1305
  chart3.set_title(:name => 'Percent Stacked Chart')
@@ -852,9 +1326,9 @@ EOS
852
1326
  # Add the worksheet data that the charts will refer to.
853
1327
  headings = [ 'Number', 'Batch 1', 'Batch 2' ]
854
1328
  data = [
855
- [ 2, 3, 4, 5, 6, 7 ],
856
- [ 10, 40, 50, 20, 10, 50 ],
857
- [ 30, 60, 70, 50, 40, 30 ]
1329
+ [ 2, 3, 4, 5, 6, 7 ],
1330
+ [ 10, 40, 50, 20, 10, 50 ],
1331
+ [ 30, 60, 70, 50, 40, 30 ]
858
1332
  ]
859
1333
 
860
1334
  worksheet.write('A1', headings, bold)
@@ -865,17 +1339,17 @@ EOS
865
1339
 
866
1340
  # Configure the first series.
867
1341
  chart.add_series(
868
- :name => '=Sheet1!$B$1',
869
- :categories => '=Sheet1!$A$2:$A$7',
870
- :values => '=Sheet1!$B$2:$B$7'
1342
+ :name => '=Sheet1!$B$1',
1343
+ :categories => '=Sheet1!$A$2:$A$7',
1344
+ :values => '=Sheet1!$B$2:$B$7'
871
1345
  )
872
1346
 
873
1347
  # Configure second series. Note alternative use of array ref to define
874
1348
  # ranges: [ $sheetname, $row_start, $row_end, $col_start, $col_end ].$chart->add_series(
875
1349
  chart.add_series(
876
- :name => '=Sheet1!$C$1',
877
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
878
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
1350
+ :name => '=Sheet1!$C$1',
1351
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
1352
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
879
1353
  )
880
1354
 
881
1355
  # Add a chart title and some axis labels.
@@ -906,19 +1380,19 @@ EOS
906
1380
  # Add the worksheet data that the charts will refer to.
907
1381
  headings = [ 'Date', 'High', 'Low', 'Close' ]
908
1382
  data = [
909
- [ '2007-01-01T', '2007-01-02T', '2007-01-03T', '2007-01-04T', '2007-01-05T' ],
910
- [ 27.2, 25.03, 19.05, 20.34, 18.5 ],
911
- [ 23.49, 19.55, 15.12, 17.84, 16.34 ],
912
- [ 25.45, 23.05, 17.32, 20.45, 17.34 ]
1383
+ [ '2007-01-01T', '2007-01-02T', '2007-01-03T', '2007-01-04T', '2007-01-05T' ],
1384
+ [ 27.2, 25.03, 19.05, 20.34, 18.5 ],
1385
+ [ 23.49, 19.55, 15.12, 17.84, 16.34 ],
1386
+ [ 25.45, 23.05, 17.32, 20.45, 17.34 ]
913
1387
  ]
914
1388
 
915
1389
  worksheet.write('A1', headings, bold)
916
1390
 
917
1391
  (0 .. 4).each do |row|
918
- worksheet.write_date_time(row + 1, 0, data[0][row], date_format)
919
- worksheet.write(row + 1, 1, data[1][row])
920
- worksheet.write(row + 1, 2, data[2][row])
921
- worksheet.write(row + 1, 3, data[3][row])
1392
+ worksheet.write_date_time(row + 1, 0, data[0][row], date_format)
1393
+ worksheet.write(row + 1, 1, data[1][row])
1394
+ worksheet.write(row + 1, 2, data[2][row])
1395
+ worksheet.write(row + 1, 3, data[3][row])
922
1396
  end
923
1397
 
924
1398
  worksheet.set_column('A:D', 11)
@@ -960,9 +1434,9 @@ EOS
960
1434
  # Add the worksheet data that the charts will refer to.
961
1435
  headings = [ 'Aliens', 'Humans']
962
1436
  data = [
963
- [ 2, 3, 4, 5, 6, 7 ],
964
- [ 10, 40, 50, 20, 10, 50 ]
965
- ]
1437
+ [ 2, 3, 4, 5, 6, 7 ],
1438
+ [ 10, 40, 50, 20, 10, 50 ]
1439
+ ]
966
1440
 
967
1441
  worksheet.write('A1', headings, bold)
968
1442
  worksheet.write('A2', data)
@@ -972,15 +1446,15 @@ EOS
972
1446
 
973
1447
  # Configure the first series.
974
1448
  chart.add_series(
975
- :name => '=Sheet1!$A$1',
976
- :values => '=Sheet1!$A$2:$A$7',
977
- :y2_axis => 1
978
- )
1449
+ :name => '=Sheet1!$A$1',
1450
+ :values => '=Sheet1!$A$2:$A$7',
1451
+ :y2_axis => 1
1452
+ )
979
1453
 
980
1454
  chart.add_series(
981
- :name => '=Sheet1!$B$1',
982
- :values => '=Sheet1!$B$2:$B$7'
983
- )
1455
+ :name => '=Sheet1!$B$1',
1456
+ :values => '=Sheet1!$B$2:$B$7'
1457
+ )
984
1458
 
985
1459
  chart.set_legend(:position => 'right')
986
1460
 
@@ -1258,7 +1732,7 @@ EOS
1258
1732
  comment = 'Hello.'
1259
1733
 
1260
1734
  worksheet6.write( 'C9', cell_text, text_wrap )
1261
- worksheet6.write_comment( 'C9', comment, :color => 0x35 )
1735
+ worksheet6.write_comment( 'C9', comment, :color => '#FF6600' )
1262
1736
 
1263
1737
 
1264
1738
  ###############################################################################
@@ -1275,7 +1749,7 @@ EOS
1275
1749
  cell = 'C3'
1276
1750
 
1277
1751
  cell_text = "Move the mouse over this cell and you will see 'Cell commented " +
1278
- "by #{author}' (blank) in the status bar at the bottom"
1752
+ "by #{author}' (blank) in the status bar at the bottom"
1279
1753
 
1280
1754
  comment = 'Hello.'
1281
1755
 
@@ -1286,7 +1760,7 @@ EOS
1286
1760
  author = 'Ruby'
1287
1761
  cell = 'C6'
1288
1762
  cell_text = "Move the mouse over this cell and you will see 'Cell commented " +
1289
- "by #{author}' in the status bar at the bottom"
1763
+ "by #{author}' in the status bar at the bottom"
1290
1764
 
1291
1765
  comment = 'Hello.'
1292
1766
 
@@ -1297,7 +1771,7 @@ EOS
1297
1771
  author = '€'
1298
1772
  cell = 'C9'
1299
1773
  cell_text = "Move the mouse over this cell and you will see 'Cell commented " +
1300
- "by #{author}' in the status bar at the bottom"
1774
+ "by #{author}' in the status bar at the bottom"
1301
1775
  comment = 'Hello.'
1302
1776
 
1303
1777
  worksheet7.write( cell, cell_text, text_wrap )
@@ -1361,36 +1835,36 @@ EOS
1361
1835
 
1362
1836
  # Light red fill with dark red text.
1363
1837
  format1 = workbook.add_format(
1364
- :bg_color => '#FFC7CE',
1365
- :color => '#9C0006'
1366
- )
1838
+ :bg_color => '#FFC7CE',
1839
+ :color => '#9C0006'
1840
+ )
1367
1841
 
1368
1842
  # Green fill with dark green text.
1369
1843
  format2 = workbook.add_format(
1370
- :bg_color => '#C6EFCE',
1371
- :color => '#006100'
1372
- )
1844
+ :bg_color => '#C6EFCE',
1845
+ :color => '#006100'
1846
+ )
1373
1847
 
1374
1848
  # Some sample data to run the conditional formatting against.
1375
1849
  data = [
1376
- [ 34, 72, 38, 30, 75, 48, 75, 66, 84, 86 ],
1377
- [ 6, 24, 1, 84, 54, 62, 60, 3, 26, 59 ],
1378
- [ 28, 79, 97, 13, 85, 93, 93, 22, 5, 14 ],
1379
- [ 27, 71, 40, 17, 18, 79, 90, 93, 29, 47 ],
1380
- [ 88, 25, 33, 23, 67, 1, 59, 79, 47, 36 ],
1381
- [ 24, 100, 20, 88, 29, 33, 38, 54, 54, 88 ],
1382
- [ 6, 57, 88, 28, 10, 26, 37, 7, 41, 48 ],
1383
- [ 52, 78, 1, 96, 26, 45, 47, 33, 96, 36 ],
1384
- [ 60, 54, 81, 66, 81, 90, 80, 93, 12, 55 ],
1385
- [ 70, 5, 46, 14, 71, 19, 66, 36, 41, 21 ]
1386
- ]
1850
+ [ 34, 72, 38, 30, 75, 48, 75, 66, 84, 86 ],
1851
+ [ 6, 24, 1, 84, 54, 62, 60, 3, 26, 59 ],
1852
+ [ 28, 79, 97, 13, 85, 93, 93, 22, 5, 14 ],
1853
+ [ 27, 71, 40, 17, 18, 79, 90, 93, 29, 47 ],
1854
+ [ 88, 25, 33, 23, 67, 1, 59, 79, 47, 36 ],
1855
+ [ 24, 100, 20, 88, 29, 33, 38, 54, 54, 88 ],
1856
+ [ 6, 57, 88, 28, 10, 26, 37, 7, 41, 48 ],
1857
+ [ 52, 78, 1, 96, 26, 45, 47, 33, 96, 36 ],
1858
+ [ 60, 54, 81, 66, 81, 90, 80, 93, 12, 55 ],
1859
+ [ 70, 5, 46, 14, 71, 19, 66, 36, 41, 21 ]
1860
+ ]
1387
1861
 
1388
1862
  ###############################################################################
1389
1863
  #
1390
1864
  # Example 1.
1391
1865
  #
1392
1866
  caption = 'Cells with values >= 50 are in light red. ' +
1393
- 'Values < 50 are in light green.'
1867
+ 'Values < 50 are in light green.'
1394
1868
 
1395
1869
  # Write the data.
1396
1870
  worksheet1.write('A1', caption)
@@ -1404,7 +1878,7 @@ EOS
1404
1878
  :value => 50,
1405
1879
  :format => format1
1406
1880
  }
1407
- )
1881
+ )
1408
1882
 
1409
1883
  # Write another conditional format over the same range.
1410
1884
  worksheet1.conditional_formatting('B3:K12',
@@ -1414,7 +1888,7 @@ EOS
1414
1888
  :value => 50,
1415
1889
  :format => format2
1416
1890
  }
1417
- )
1891
+ )
1418
1892
 
1419
1893
 
1420
1894
  ###############################################################################
@@ -1422,7 +1896,7 @@ EOS
1422
1896
  # Example 2.
1423
1897
  #
1424
1898
  caption = 'Values between 30 and 70 are in light red. ' +
1425
- 'Values outside that range are in light green.'
1899
+ 'Values outside that range are in light green.'
1426
1900
 
1427
1901
  worksheet2.write('A1', caption)
1428
1902
  worksheet2.write_col('B3', data)
@@ -1435,7 +1909,7 @@ EOS
1435
1909
  :maximum => 70,
1436
1910
  :format => format1
1437
1911
  }
1438
- )
1912
+ )
1439
1913
 
1440
1914
  worksheet2.conditional_formatting('B3:K12',
1441
1915
  {
@@ -1445,7 +1919,7 @@ EOS
1445
1919
  :maximum => 70,
1446
1920
  :format => format2
1447
1921
  }
1448
- )
1922
+ )
1449
1923
 
1450
1924
 
1451
1925
  ###############################################################################
@@ -1453,7 +1927,7 @@ EOS
1453
1927
  # Example 3.
1454
1928
  #
1455
1929
  caption = 'Duplicate values are in light red. ' +
1456
- 'Unique values are in light green.'
1930
+ 'Unique values are in light green.'
1457
1931
 
1458
1932
  worksheet3.write('A1', caption)
1459
1933
  worksheet3.write_col('B3', data)
@@ -1463,14 +1937,14 @@ EOS
1463
1937
  :type => 'duplicate',
1464
1938
  :format => format1,
1465
1939
  }
1466
- )
1940
+ )
1467
1941
 
1468
1942
  worksheet3.conditional_formatting('B3:K12',
1469
1943
  {
1470
1944
  :type => 'unique',
1471
1945
  :format => format2,
1472
1946
  }
1473
- )
1947
+ )
1474
1948
 
1475
1949
 
1476
1950
  ###############################################################################
@@ -1478,7 +1952,7 @@ EOS
1478
1952
  # Example 4.
1479
1953
  #
1480
1954
  caption = 'Above average values are in light red. ' +
1481
- 'Below average values are in light green.'
1955
+ 'Below average values are in light green.'
1482
1956
 
1483
1957
  worksheet4.write('A1', caption)
1484
1958
  worksheet4.write_col('B3', data)
@@ -1489,7 +1963,7 @@ EOS
1489
1963
  :criteria => 'above',
1490
1964
  :format => format1
1491
1965
  }
1492
- )
1966
+ )
1493
1967
 
1494
1968
  worksheet4.conditional_formatting('B3:K12',
1495
1969
  {
@@ -1497,7 +1971,7 @@ EOS
1497
1971
  :criteria => 'below',
1498
1972
  :format => format2
1499
1973
  }
1500
- )
1974
+ )
1501
1975
 
1502
1976
 
1503
1977
  ###############################################################################
@@ -1505,7 +1979,7 @@ EOS
1505
1979
  # Example 5.
1506
1980
  #
1507
1981
  caption = 'Top 10 values are in light red. ' +
1508
- 'Bottom 10 values are in light green.'
1982
+ 'Bottom 10 values are in light green.'
1509
1983
 
1510
1984
  worksheet5.write('A1', caption)
1511
1985
  worksheet5.write_col('B3', data)
@@ -1516,7 +1990,7 @@ EOS
1516
1990
  :value => '10',
1517
1991
  :format => format1
1518
1992
  }
1519
- )
1993
+ )
1520
1994
 
1521
1995
  worksheet5.conditional_formatting('B3:K12',
1522
1996
  {
@@ -1524,7 +1998,7 @@ EOS
1524
1998
  :value => '10',
1525
1999
  :format => format2
1526
2000
  }
1527
- )
2001
+ )
1528
2002
 
1529
2003
 
1530
2004
  ###############################################################################
@@ -1532,7 +2006,7 @@ EOS
1532
2006
  # Example 6.
1533
2007
  #
1534
2008
  caption = 'Cells with values >= 50 are in light red. ' +
1535
- 'Values < 50 are in light green. Non-contiguous ranges.'
2009
+ 'Values < 50 are in light green. Non-contiguous ranges.'
1536
2010
 
1537
2011
  # Write the data.
1538
2012
  worksheet6.write('A1', caption)
@@ -1546,7 +2020,7 @@ EOS
1546
2020
  :value => 50,
1547
2021
  :format => format1
1548
2022
  }
1549
- )
2023
+ )
1550
2024
 
1551
2025
  # Write another conditional format over the same range.
1552
2026
  worksheet6.conditional_formatting('B3:K6,B9:K12',
@@ -1556,7 +2030,7 @@ EOS
1556
2030
  :value => 50,
1557
2031
  :format => format2
1558
2032
  }
1559
- )
2033
+ )
1560
2034
 
1561
2035
 
1562
2036
  ###############################################################################
@@ -1583,19 +2057,19 @@ EOS
1583
2057
  {
1584
2058
  :type => '2_color_scale'
1585
2059
  }
1586
- )
2060
+ )
1587
2061
 
1588
2062
  worksheet7.conditional_formatting('D3:D14',
1589
2063
  {
1590
2064
  :type => '3_color_scale'
1591
2065
  }
1592
- )
2066
+ )
1593
2067
 
1594
2068
  worksheet7.conditional_formatting('F3:F14',
1595
2069
  {
1596
2070
  :type => 'data_bar'
1597
2071
  }
1598
- )
2072
+ )
1599
2073
 
1600
2074
 
1601
2075
  ###############################################################################
@@ -1624,7 +2098,7 @@ EOS
1624
2098
  :min_color => "#FF0000",
1625
2099
  :max_color => "#00FF00"
1626
2100
  }
1627
- )
2101
+ )
1628
2102
 
1629
2103
  worksheet8.conditional_formatting('D3:D14',
1630
2104
  {
@@ -1633,14 +2107,14 @@ EOS
1633
2107
  :mid_color => "#8DB4E3",
1634
2108
  :max_color => "#538ED5"
1635
2109
  }
1636
- )
2110
+ )
1637
2111
 
1638
2112
  worksheet8.conditional_formatting('F3:F14',
1639
2113
  {
1640
2114
  :type => 'data_bar',
1641
2115
  :bar_color => '#63C384'
1642
2116
  }
1643
- )
2117
+ )
1644
2118
 
1645
2119
  workbook.close
1646
2120
  store_to_tempfile
@@ -1654,13 +2128,13 @@ EOS
1654
2128
 
1655
2129
  # Add a format for the header cells.
1656
2130
  header_format = workbook.add_format(
1657
- :border => 1,
1658
- :bg_color => 43,
1659
- :bold => 1,
1660
- :text_wrap => 1,
1661
- :valign => 'vcenter',
1662
- :indent => 1
1663
- )
2131
+ :border => 1,
2132
+ :bg_color => 43,
2133
+ :bold => 1,
2134
+ :text_wrap => 1,
2135
+ :valign => 'vcenter',
2136
+ :indent => 1
2137
+ )
1664
2138
 
1665
2139
  # Set up layout of the worksheet.
1666
2140
  worksheet.set_column('A:A', 68)
@@ -1932,32 +2406,32 @@ EOS
1932
2406
  # the format codes change the appearance of the date.
1933
2407
  #
1934
2408
  date_formats = [
1935
- 'dd/mm/yy',
1936
- 'mm/dd/yy',
1937
- '',
1938
- 'd mm yy',
1939
- 'dd mm yy',
1940
- '',
1941
- 'dd m yy',
1942
- 'dd mm yy',
1943
- 'dd mmm yy',
1944
- 'dd mmmm yy',
1945
- '',
1946
- 'dd mm y',
1947
- 'dd mm yyy',
1948
- 'dd mm yyyy',
1949
- '',
1950
- 'd mmmm yyyy',
1951
- '',
1952
- 'dd/mm/yy',
1953
- 'dd/mm/yy hh:mm',
1954
- 'dd/mm/yy hh:mm:ss',
1955
- 'dd/mm/yy hh:mm:ss.000',
1956
- '',
1957
- 'hh:mm',
1958
- 'hh:mm:ss',
1959
- 'hh:mm:ss.000'
1960
- ]
2409
+ 'dd/mm/yy',
2410
+ 'mm/dd/yy',
2411
+ '',
2412
+ 'd mm yy',
2413
+ 'dd mm yy',
2414
+ '',
2415
+ 'dd m yy',
2416
+ 'dd mm yy',
2417
+ 'dd mmm yy',
2418
+ 'dd mmmm yy',
2419
+ '',
2420
+ 'dd mm y',
2421
+ 'dd mm yyy',
2422
+ 'dd mm yyyy',
2423
+ '',
2424
+ 'd mmmm yyyy',
2425
+ '',
2426
+ 'dd/mm/yy',
2427
+ 'dd/mm/yy hh:mm',
2428
+ 'dd/mm/yy hh:mm:ss',
2429
+ 'dd/mm/yy hh:mm:ss.000',
2430
+ '',
2431
+ 'hh:mm',
2432
+ 'hh:mm:ss',
2433
+ 'hh:mm:ss.000'
2434
+ ]
1961
2435
 
1962
2436
  # Write the same date and time using each of the above formats. The empty
1963
2437
  # string formats create a blank line to make the example clearer.
@@ -1969,9 +2443,9 @@ EOS
1969
2443
 
1970
2444
  # Create a format for the date or time.
1971
2445
  format = workbook.add_format(
1972
- :num_format => date_format,
1973
- :align => 'left'
1974
- )
2446
+ :num_format => date_format,
2447
+ :align => 'left'
2448
+ )
1975
2449
 
1976
2450
  # Write the same date using different formats.
1977
2451
  worksheet.write_date_time(row, 0, '2004-08-01T12:30:45.123', format)
@@ -2036,17 +2510,17 @@ EOS
2036
2510
  worksheet.set_row(0, 40)
2037
2511
 
2038
2512
  heading = workbook.add_format(
2039
- :bold => 1,
2040
- :color => 'blue',
2041
- :size => 16,
2042
- :merge => 1,
2043
- :align => 'vcenter'
2044
- )
2513
+ :bold => 1,
2514
+ :color => 'blue',
2515
+ :size => 16,
2516
+ :merge => 1,
2517
+ :align => 'vcenter'
2518
+ )
2045
2519
 
2046
2520
  hyperlink_format = workbook.add_format(
2047
- :color => 'blue',
2048
- :underline => 1
2049
- )
2521
+ :color => 'blue',
2522
+ :underline => 1
2523
+ )
2050
2524
 
2051
2525
  headings = ['Features of WriteXLSX', '']
2052
2526
  worksheet.write_row('A1', headings, heading)
@@ -2056,12 +2530,12 @@ EOS
2056
2530
  # Some text examples
2057
2531
  #
2058
2532
  text_format = workbook.add_format(
2059
- :bold => 1,
2060
- :italic => 1,
2061
- :color => 'red',
2062
- :size => 18,
2063
- :font => 'Lucida Calligraphy'
2064
- )
2533
+ :bold => 1,
2534
+ :italic => 1,
2535
+ :color => 'red',
2536
+ :size => 18,
2537
+ :font => 'Lucida Calligraphy'
2538
+ )
2065
2539
 
2066
2540
  worksheet.write('A2', "Text")
2067
2541
  worksheet.write('B2', "Hello Excel")
@@ -2104,7 +2578,10 @@ EOS
2104
2578
  # Images
2105
2579
  #
2106
2580
  worksheet.write('A10', "Images")
2107
- worksheet.insert_image('B10', File.join(@test_dir, 'republic.png'), 16, 8)
2581
+ worksheet.insert_image(
2582
+ 'B10', File.join(@test_dir, 'republic.png'),
2583
+ :x_offset => 16, :y_offset => 8
2584
+ )
2108
2585
 
2109
2586
  #######################################################################
2110
2587
  #
@@ -2129,10 +2606,10 @@ EOS
2129
2606
  format3 = workbook.add_format(:diag_type => 3)
2130
2607
 
2131
2608
  format4 = workbook.add_format(
2132
- :diag_type => 3,
2133
- :diag_border => 7,
2134
- :diag_color => 'red'
2135
- )
2609
+ :diag_type => 3,
2610
+ :diag_border => 7,
2611
+ :diag_color => 'red'
2612
+ )
2136
2613
 
2137
2614
  worksheet.write('B3', 'Text', format1)
2138
2615
  worksheet.write('B6', 'Text', format2)
@@ -2218,9 +2695,9 @@ EOS
2218
2695
  format2.set_color('blue')
2219
2696
 
2220
2697
  format3 = workbook.add_format(
2221
- :color => 'blue',
2222
- :underline => 1
2223
- )
2698
+ :color => 'blue',
2699
+ :underline => 1
2700
+ )
2224
2701
 
2225
2702
  worksheet.write(2, 0, 'This workbook demonstrates some of', format)
2226
2703
  worksheet.write(3, 0, 'the formatting options provided by', format)
@@ -2233,16 +2710,16 @@ EOS
2233
2710
  'Named colors', format3)
2234
2711
 
2235
2712
  worksheet.write(
2236
- 'A10',
2237
- "internal:'Standard colors'!A1",
2238
- 'Standard colors', format3
2239
- )
2713
+ 'A10',
2714
+ "internal:'Standard colors'!A1",
2715
+ 'Standard colors', format3
2716
+ )
2240
2717
 
2241
2718
  worksheet.write(
2242
- 'A11',
2243
- "internal:'Numeric formats'!A1",
2244
- 'Numeric formats', format3
2245
- )
2719
+ 'A11',
2720
+ "internal:'Numeric formats'!A1",
2721
+ 'Numeric formats', format3
2722
+ )
2246
2723
 
2247
2724
  worksheet.write('A12', "internal:Borders!A1", 'Borders', format3)
2248
2725
  worksheet.write('A13', "internal:Patterns!A1", 'Patterns', format3)
@@ -2272,10 +2749,10 @@ EOS
2272
2749
  [33, 11, 53, 17, 22, 18, 13, 16, 23, 9, 12, 15, 14, 20, 8, 10].each do |index|
2273
2750
  color = colors[index]
2274
2751
  format = workbook.add_format(
2275
- :bg_color => color,
2276
- :pattern => 1,
2277
- :border => 1
2278
- )
2752
+ :bg_color => color,
2753
+ :pattern => 1,
2754
+ :border => 1
2755
+ )
2279
2756
 
2280
2757
  worksheet.write(i + 1, 0, index, center)
2281
2758
  worksheet.write(i + 1, 1, sprintf("0x%02X", index), center)
@@ -2302,10 +2779,10 @@ EOS
2302
2779
 
2303
2780
  (8 .. 63).each do |i|
2304
2781
  format = workbook.add_format(
2305
- :bg_color => i,
2306
- :pattern => 1,
2307
- :border => 1
2308
- )
2782
+ :bg_color => i,
2783
+ :pattern => 1,
2784
+ :border => 1
2785
+ )
2309
2786
 
2310
2787
  worksheet.write((i - 7), 0, i, center)
2311
2788
  worksheet.write((i - 7), 1, sprintf("0x%02X", i), center)
@@ -2787,17 +3264,17 @@ EOS
2787
3264
 
2788
3265
  # Add the standard url link format.
2789
3266
  url_format = workbook.add_format(
2790
- :color => 'blue',
2791
- :underline => 1
2792
- )
3267
+ :color => 'blue',
3268
+ :underline => 1
3269
+ )
2793
3270
 
2794
3271
  # Add a sample format.
2795
3272
  red_format = workbook.add_format(
2796
- :color => 'red',
2797
- :bold => 1,
2798
- :underline => 1,
2799
- :size => 12
2800
- )
3273
+ :color => 'red',
3274
+ :bold => 1,
3275
+ :underline => 1,
3276
+ :size => 12
3277
+ )
2801
3278
 
2802
3279
  # Add an alternate description string to the URL.
2803
3280
  str = 'Perl home.'
@@ -2839,6 +3316,55 @@ EOS
2839
3316
  compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2840
3317
  end
2841
3318
 
3319
+ def test_ignore_errors
3320
+ @xlsx = 'ignore_errors.xlsx'
3321
+ workbook = WriteXLSX.new(@io)
3322
+ worksheet = workbook.add_worksheet
3323
+
3324
+ # Write strings that looks like numbers. This will cause an Excel warning.
3325
+ worksheet.write_string('C2', '123')
3326
+ worksheet.write_string('C3', '123')
3327
+
3328
+ # Write a divide by zero formula. This will also cause an Excel warning.
3329
+ worksheet.write_formula('C5', '=1/0')
3330
+ worksheet.write_formula('C6', '=1/0')
3331
+
3332
+ # Turn off some of the warnings:
3333
+ worksheet.ignore_errors(
3334
+ :number_stored_as_text => 'C3',
3335
+ :eval_error => 'C6'
3336
+ )
3337
+
3338
+ # Write some descriptions for the cells and make the column wider for clarity.
3339
+ worksheet.set_column('B:B', 16)
3340
+ worksheet.write('B2', 'Warning:')
3341
+ worksheet.write('B3', 'Warning turned off:')
3342
+ worksheet.write('B5', 'Warning:')
3343
+ worksheet.write('B6', 'Warning turned off:')
3344
+
3345
+ workbook.close
3346
+ store_to_tempfile
3347
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3348
+ end
3349
+
3350
+ def test_keep_leading_zoros
3351
+ @xlsx = 'keep_leading_zeros.xlsx'
3352
+ workbook = WriteXLSX.new(@io)
3353
+ worksheet = workbook.add_worksheet
3354
+
3355
+ worksheet.keep_leading_zeros(true)
3356
+ worksheet.write('A1', '001')
3357
+ worksheet.write('B1', 'written as string.')
3358
+ worksheet.write('A2', '012')
3359
+ worksheet.write('B2', 'written as string.')
3360
+ worksheet.write('A3', '123')
3361
+ worksheet.write('B3', 'written as number.')
3362
+
3363
+ workbook.close
3364
+ store_to_tempfile
3365
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3366
+ end
3367
+
2842
3368
  def test_merge1
2843
3369
  @xlsx = 'merge1.xlsx'
2844
3370
  # Create a new workbook and add a worksheet
@@ -2873,16 +3399,16 @@ EOS
2873
3399
 
2874
3400
  # Create a merged format
2875
3401
  format = workbook.add_format(
2876
- :center_across => 1,
2877
- :bold => 1,
2878
- :size => 15,
2879
- :pattern => 1,
2880
- :border => 6,
2881
- :color => 'white',
2882
- :fg_color => 'green',
2883
- :border_color => 'yellow',
2884
- :align => 'vcenter'
2885
- )
3402
+ :center_across => 1,
3403
+ :bold => 1,
3404
+ :size => 15,
3405
+ :pattern => 1,
3406
+ :border => 6,
3407
+ :color => 'white',
3408
+ :fg_color => 'green',
3409
+ :border_color => 'yellow',
3410
+ :align => 'vcenter'
3411
+ )
2886
3412
 
2887
3413
  # Only one cell should contain text, the others should be blank.
2888
3414
  worksheet.write(2, 1, "Center across selection", format)
@@ -2909,12 +3435,12 @@ EOS
2909
3435
  # Example: Merge cells containing a hyperlink using merge_range().
2910
3436
  #
2911
3437
  format = workbook.add_format(
2912
- :border => 1,
2913
- :underline => 1,
2914
- :color => 'blue',
2915
- :align => 'center',
2916
- :valign => 'vcenter'
2917
- )
3438
+ :border => 1,
3439
+ :underline => 1,
3440
+ :color => 'blue',
3441
+ :align => 'center',
3442
+ :valign => 'vcenter'
3443
+ )
2918
3444
 
2919
3445
  # Merge 3 cells
2920
3446
  worksheet.merge_range('B4:D4', 'http://www.perl.com', format)
@@ -2942,12 +3468,12 @@ EOS
2942
3468
  # Example 1: Text centered vertically and horizontally
2943
3469
  #
2944
3470
  format1 = workbook.add_format(
2945
- :border => 6,
2946
- :bold => 1,
2947
- :color => 'red',
2948
- :valign => 'vcenter',
2949
- :align => 'center'
2950
- )
3471
+ :border => 6,
3472
+ :bold => 1,
3473
+ :color => 'red',
3474
+ :valign => 'vcenter',
3475
+ :align => 'center'
3476
+ )
2951
3477
 
2952
3478
  worksheet.merge_range('B2:D3', 'Vertical and horizontal', format1)
2953
3479
 
@@ -2956,12 +3482,12 @@ EOS
2956
3482
  # Example 2: Text aligned to the top and left
2957
3483
  #
2958
3484
  format2 = workbook.add_format(
2959
- :border => 6,
2960
- :bold => 1,
2961
- :color => 'red',
2962
- :valign => 'top',
2963
- :align => 'left'
2964
- )
3485
+ :border => 6,
3486
+ :bold => 1,
3487
+ :color => 'red',
3488
+ :valign => 'top',
3489
+ :align => 'left'
3490
+ )
2965
3491
 
2966
3492
  worksheet.merge_range('B5:D6', 'Aligned to the top and left', format2)
2967
3493
 
@@ -2970,12 +3496,12 @@ EOS
2970
3496
  # Example 3: Text aligned to the bottom and right
2971
3497
  #
2972
3498
  format3 = workbook.add_format(
2973
- :border => 6,
2974
- :bold => 1,
2975
- :color => 'red',
2976
- :valign => 'bottom',
2977
- :align => 'right'
2978
- )
3499
+ :border => 6,
3500
+ :bold => 1,
3501
+ :color => 'red',
3502
+ :valign => 'bottom',
3503
+ :align => 'right'
3504
+ )
2979
3505
 
2980
3506
  worksheet.merge_range('B8:D9', 'Aligned to the bottom and right', format3)
2981
3507
 
@@ -2984,12 +3510,12 @@ EOS
2984
3510
  # Example 4: Text justified (i.e. wrapped) in the cell
2985
3511
  #
2986
3512
  format4 = workbook.add_format(
2987
- :border => 6,
2988
- :bold => 1,
2989
- :color => 'red',
2990
- :valign => 'top',
2991
- :align => 'justify'
2992
- )
3513
+ :border => 6,
3514
+ :bold => 1,
3515
+ :color => 'red',
3516
+ :valign => 'top',
3517
+ :align => 'justify'
3518
+ )
2993
3519
 
2994
3520
  worksheet.merge_range('B11:D12', 'Justified: ' << 'so on and ' * 18, format4)
2995
3521
 
@@ -3013,13 +3539,13 @@ EOS
3013
3539
  # Rotation 1, letters run from top to bottom
3014
3540
  #
3015
3541
  format1 = workbook.add_format(
3016
- :border => 6,
3017
- :bold => 1,
3018
- :color => 'red',
3019
- :valign => 'vcentre',
3020
- :align => 'centre',
3021
- :rotation => 270
3022
- )
3542
+ :border => 6,
3543
+ :bold => 1,
3544
+ :color => 'red',
3545
+ :valign => 'vcentre',
3546
+ :align => 'centre',
3547
+ :rotation => 270
3548
+ )
3023
3549
 
3024
3550
  worksheet.merge_range( 'B4:B9', 'Rotation 270', format1 )
3025
3551
 
@@ -3028,13 +3554,13 @@ EOS
3028
3554
  # Rotation 2, 90ー anticlockwise
3029
3555
  #
3030
3556
  format2 = workbook.add_format(
3031
- :border => 6,
3032
- :bold => 1,
3033
- :color => 'red',
3034
- :valign => 'vcentre',
3035
- :align => 'centre',
3036
- :rotation => 90
3037
- )
3557
+ :border => 6,
3558
+ :bold => 1,
3559
+ :color => 'red',
3560
+ :valign => 'vcentre',
3561
+ :align => 'centre',
3562
+ :rotation => 90
3563
+ )
3038
3564
 
3039
3565
  worksheet.merge_range( 'D4:D9', 'Rotation 90°', format2 )
3040
3566
 
@@ -3043,13 +3569,13 @@ EOS
3043
3569
  # Rotation 3, 90ー clockwise
3044
3570
  #
3045
3571
  format3 = workbook.add_format(
3046
- :border => 6,
3047
- :bold => 1,
3048
- :color => 'red',
3049
- :valign => 'vcentre',
3050
- :align => 'centre',
3051
- :rotation => -90
3052
- )
3572
+ :border => 6,
3573
+ :bold => 1,
3574
+ :color => 'red',
3575
+ :valign => 'vcentre',
3576
+ :align => 'centre',
3577
+ :rotation => -90
3578
+ )
3053
3579
 
3054
3580
  worksheet.merge_range( 'F4:F9', 'Rotation -90°', format3 )
3055
3581
 
@@ -3070,14 +3596,14 @@ EOS
3070
3596
 
3071
3597
  # Format for the merged cells.
3072
3598
  format = workbook.add_format(
3073
- :border => 6,
3074
- :bold => 1,
3075
- :color => 'red',
3076
- :size => 20,
3077
- :valign => 'vcentre',
3078
- :align => 'left',
3079
- :indent => 1
3080
- )
3599
+ :border => 6,
3600
+ :bold => 1,
3601
+ :color => 'red',
3602
+ :size => 20,
3603
+ :valign => 'vcentre',
3604
+ :align => 'left',
3605
+ :indent => 1
3606
+ )
3081
3607
 
3082
3608
  ###############################################################################
3083
3609
  #
@@ -3234,12 +3760,12 @@ EOS
3234
3760
  # Example 3: Create a worksheet with outlined columns.
3235
3761
  #
3236
3762
  data = [
3237
- [ 'Month', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', ' Total' ],
3238
- [ 'North', 50, 20, 15, 25, 65, 80, '=SUM(B2:G2)' ],
3239
- [ 'South', 10, 20, 30, 50, 50, 50, '=SUM(B3:G3)' ],
3240
- [ 'East', 45, 75, 50, 15, 75, 100, '=SUM(B4:G4)' ],
3241
- [ 'West', 15, 15, 55, 35, 20, 50, '=SUM(B5:G5)' ],
3242
- ]
3763
+ [ 'Month', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', ' Total' ],
3764
+ [ 'North', 50, 20, 15, 25, 65, 80, '=SUM(B2:G2)' ],
3765
+ [ 'South', 10, 20, 30, 50, 50, 50, '=SUM(B3:G3)' ],
3766
+ [ 'East', 45, 75, 50, 15, 75, 100, '=SUM(B4:G4)' ],
3767
+ [ 'West', 15, 15, 55, 35, 20, 50, '=SUM(B5:G5)' ],
3768
+ ]
3243
3769
 
3244
3770
  # Add bold format to the first row
3245
3771
  worksheet3.set_row(0, nil, bold)
@@ -3259,10 +3785,10 @@ EOS
3259
3785
  # Example 4: Show all possible outline levels.
3260
3786
  #
3261
3787
  levels = [
3262
- "Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6",
3263
- "Level 7", "Level 6", "Level 5", "Level 4", "Level 3", "Level 2",
3264
- "Level 1"
3265
- ]
3788
+ "Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6",
3789
+ "Level 7", "Level 6", "Level 5", "Level 4", "Level 3", "Level 2",
3790
+ "Level 1"
3791
+ ]
3266
3792
 
3267
3793
 
3268
3794
  worksheet4.write_col('A1', levels)
@@ -3393,12 +3919,12 @@ EOS
3393
3919
  # Example 5: Create a worksheet with outlined columns.
3394
3920
  #
3395
3921
  data = [
3396
- [ 'Month', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Total' ],
3397
- [ 'North', 50, 20, 15, 25, 65, 80, '=SUM(B2:G2)' ],
3398
- [ 'South', 10, 20, 30, 50, 50, 50, '=SUM(B3:G3)' ],
3399
- [ 'East', 45, 75, 50, 15, 75, 100, '=SUM(B4:G4)' ],
3400
- [ 'West', 15, 15, 55, 35, 20, 50, '=SUM(B5:G6)' ]
3401
- ]
3922
+ [ 'Month', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Total' ],
3923
+ [ 'North', 50, 20, 15, 25, 65, 80, '=SUM(B2:G2)' ],
3924
+ [ 'South', 10, 20, 30, 50, 50, 50, '=SUM(B3:G3)' ],
3925
+ [ 'East', 45, 75, 50, 15, 75, 100, '=SUM(B4:G4)' ],
3926
+ [ 'West', 15, 15, 55, 35, 20, 50, '=SUM(B5:G6)' ]
3927
+ ]
3402
3928
 
3403
3929
  # Add bold format to the first row
3404
3930
  worksheet5.set_row(0, nil, bold)
@@ -3499,10 +4025,10 @@ EOS
3499
4025
  #
3500
4026
 
3501
4027
  header = workbook.add_format(
3502
- :align => 'center',
3503
- :valign => 'vcenter',
3504
- :fg_color => 0x2A
3505
- )
4028
+ :align => 'center',
4029
+ :valign => 'vcenter',
4030
+ :fg_color => 0x2A
4031
+ )
3506
4032
 
3507
4033
  center = workbook.add_format(:align => 'center')
3508
4034
 
@@ -3598,16 +4124,16 @@ EOS
3598
4124
  worksheet = workbook.add_worksheet
3599
4125
 
3600
4126
  workbook.set_properties(
3601
- :title => 'This is an example spreadsheet',
3602
- :subject => 'With document properties',
3603
- :author => 'John McNamara',
3604
- :manager => 'Dr. Heinz Doofenshmirtz',
3605
- :company => 'of Wolves',
3606
- :category => 'Example spreadsheets',
3607
- :keywords => 'Sample, Example, Properties',
3608
- :comments => 'Created with Perl and Excel::Writer::XLSX',
3609
- :status => 'Quo'
3610
- )
4127
+ :title => 'This is an example spreadsheet',
4128
+ :subject => 'With document properties',
4129
+ :author => 'John McNamara',
4130
+ :manager => 'Dr. Heinz Doofenshmirtz',
4131
+ :company => 'of Wolves',
4132
+ :category => 'Example spreadsheets',
4133
+ :keywords => 'Sample, Example, Properties',
4134
+ :comments => 'Created with Perl and Excel::Writer::XLSX',
4135
+ :status => 'Quo'
4136
+ )
3611
4137
 
3612
4138
  worksheet.set_column('A:A', 70)
3613
4139
  worksheet.write('A1', "Select 'Office Button -> Prepare -> Properties' to see the file properties.")
@@ -3708,16 +4234,16 @@ EOS
3708
4234
 
3709
4235
  # Write some strings with multiple formats.
3710
4236
  worksheet.write_rich_string('A1',
3711
- 'This is ', bold, 'bold', ' and this is ', italic, 'italic')
4237
+ 'This is ', bold, 'bold', ' and this is ', italic, 'italic')
3712
4238
 
3713
4239
  worksheet.write_rich_string('A3',
3714
- 'This is ', red, 'red', ' and this is ', blue, 'blue')
4240
+ 'This is ', red, 'red', ' and this is ', blue, 'blue')
3715
4241
 
3716
4242
  worksheet.write_rich_string('A5',
3717
- 'Some ', bold, 'bold text', ' centered', center)
4243
+ 'Some ', bold, 'bold text', ' centered', center)
3718
4244
 
3719
4245
  worksheet.write_rich_string('A7',
3720
- italic, 'j = k', superc, '(n-1)', center)
4246
+ italic, 'j = k', superc, '(n-1)', center)
3721
4247
 
3722
4248
  workbook.close
3723
4249
  store_to_tempfile
@@ -3750,7 +4276,7 @@ EOS
3750
4276
  :text => "Hello\nWorld",
3751
4277
  :width => 60,
3752
4278
  :height => 60
3753
- )
4279
+ )
3754
4280
 
3755
4281
  worksheet.insert_shape('A1', ellipse, 50, 50)
3756
4282
 
@@ -3775,12 +4301,12 @@ EOS
3775
4301
  :text => "Plain",
3776
4302
  :width => 100,
3777
4303
  :height => 100
3778
- )
4304
+ )
3779
4305
 
3780
4306
  bbformat = workbook.add_format(
3781
4307
  :color => 'red',
3782
4308
  :font => 'Lucida Calligraphy'
3783
- )
4309
+ )
3784
4310
 
3785
4311
  bbformat.set_bold
3786
4312
  bbformat.set_underline
@@ -3797,7 +4323,7 @@ EOS
3797
4323
  :line_weight => 3,
3798
4324
  :fill => 'FFFF00',
3799
4325
  :line => '3366FF'
3800
- )
4326
+ )
3801
4327
 
3802
4328
  worksheet.insert_shape('A1', plain, 50, 50)
3803
4329
  worksheet.insert_shape('A1', decor, 250, 50)
@@ -3818,7 +4344,7 @@ EOS
3818
4344
  :text => 'Normal',
3819
4345
  :width => 100,
3820
4346
  :height => 100
3821
- )
4347
+ )
3822
4348
 
3823
4349
  worksheet.insert_shape('A1', normal, 50, 50)
3824
4350
  normal.text = 'Scaled 3w x 2h'
@@ -3841,7 +4367,7 @@ EOS
3841
4367
  :type => type,
3842
4368
  :width => 90,
3843
4369
  :height => 90
3844
- )
4370
+ )
3845
4371
 
3846
4372
  (1..10).each do |n|
3847
4373
  # Change the last 5 rectangles to stars. Previously
@@ -3857,7 +4383,7 @@ EOS
3857
4383
  :width => 90,
3858
4384
  :height => 90,
3859
4385
  :text => 'started as a box'
3860
- )
4386
+ )
3861
4387
  worksheet.insert_shape('A1', stencil, 100, 150)
3862
4388
 
3863
4389
  stencil.stencil = 0
@@ -3884,14 +4410,14 @@ EOS
3884
4410
  :type => 'ellipse',
3885
4411
  :width => 60,
3886
4412
  :height => 60
3887
- )
4413
+ )
3888
4414
  worksheet.insert_shape('A1', s1, 50, 50)
3889
4415
 
3890
4416
  s2 = workbook.add_shape(
3891
4417
  :type => 'plus',
3892
4418
  :width => 20,
3893
4419
  :height => 20
3894
- )
4420
+ )
3895
4421
  worksheet.insert_shape('A1', s2, 250, 200)
3896
4422
 
3897
4423
  # Create a connector to link the two shapes.
@@ -3923,14 +4449,14 @@ EOS
3923
4449
  :type => 'chevron',
3924
4450
  :width => 60,
3925
4451
  :height => 60
3926
- )
4452
+ )
3927
4453
  worksheet.insert_shape('A1', s1, 50, 50)
3928
4454
 
3929
4455
  s2 = workbook.add_shape(
3930
4456
  :type => 'pentagon',
3931
4457
  :width => 20,
3932
4458
  :height => 20
3933
- )
4459
+ )
3934
4460
  worksheet.insert_shape('A1', s2, 250, 200)
3935
4461
 
3936
4462
  # Create a connector to link the two shapes.
@@ -3970,7 +4496,7 @@ EOS
3970
4496
  :text => "Hello\nWorld",
3971
4497
  :width => cw,
3972
4498
  :height => ch
3973
- )
4499
+ )
3974
4500
  worksheet.insert_shape('A1', ellipse, cx, cy)
3975
4501
 
3976
4502
  # Add a plus sign at 4 different positions around the circle.
@@ -3984,7 +4510,7 @@ EOS
3984
4510
  :id => 3,
3985
4511
  :width => pw,
3986
4512
  :height => ph
3987
- )
4513
+ )
3988
4514
 
3989
4515
  p1 = worksheet.insert_shape('A1', plus, 350, 350)
3990
4516
  p2 = worksheet.insert_shape('A1', plus, 150, 350)
@@ -4035,7 +4561,7 @@ EOS
4035
4561
  :text => "Hello\nWorld",
4036
4562
  :width => cw,
4037
4563
  :height => ch
4038
- )
4564
+ )
4039
4565
  worksheet.insert_shape('A1', ellipse, cx, cy)
4040
4566
 
4041
4567
  # Add a plus sign at 4 different positionos around the circle.
@@ -4049,7 +4575,7 @@ EOS
4049
4575
  :id => 3,
4050
4576
  :width => pw,
4051
4577
  :height => ph
4052
- )
4578
+ )
4053
4579
 
4054
4580
  p1 = worksheet.insert_shape('A1', plus, 350, 150)
4055
4581
  p2 = worksheet.insert_shape('A1', plus, 350, 350)
@@ -4100,11 +4626,11 @@ EOS
4100
4626
  end
4101
4627
  last_sheet = sheet
4102
4628
  shape = workbook.add_shape(
4103
- :type => name,
4104
- :text => name,
4105
- :width => 90,
4106
- :height => 90
4107
- )
4629
+ :type => name,
4630
+ :text => name,
4631
+ :width => 90,
4632
+ :height => 90
4633
+ )
4108
4634
 
4109
4635
  # Connectors can not have labels, so write the connector name in the cell
4110
4636
  # to the left.
@@ -4530,17 +5056,18 @@ EOS
4530
5056
  worksheet10 = workbook.add_worksheet
4531
5057
  worksheet11 = workbook.add_worksheet
4532
5058
  worksheet12 = workbook.add_worksheet
5059
+ worksheet13 = workbook.add_worksheet
4533
5060
 
4534
5061
  currency_format = workbook.add_format(:num_format => '$#,##0')
4535
5062
 
4536
5063
 
4537
5064
  # Some sample data for the table.
4538
5065
  data = [
4539
- [ 'Apples', 10000, 5000, 8000, 6000 ],
4540
- [ 'Pears', 2000, 3000, 4000, 5000 ],
4541
- [ 'Bananas', 6000, 6000, 6500, 6000 ],
4542
- [ 'Oranges', 500, 300, 200, 700 ]
4543
- ]
5066
+ [ 'Apples', 10000, 5000, 8000, 6000 ],
5067
+ [ 'Pears', 2000, 3000, 4000, 5000 ],
5068
+ [ 'Bananas', 6000, 6000, 6500, 6000 ],
5069
+ [ 'Oranges', 500, 300, 200, 700 ]
5070
+ ]
4544
5071
 
4545
5072
  ###############################################################################
4546
5073
  #
@@ -4561,7 +5088,7 @@ EOS
4561
5088
  #
4562
5089
  # Example 2.
4563
5090
  #
4564
- caption = 'Default table with data.';
5091
+ caption = 'Default table with data.'
4565
5092
 
4566
5093
  # Set the columns widths.
4567
5094
  worksheet2.set_column('B:G', 12)
@@ -4630,7 +5157,7 @@ EOS
4630
5157
  #
4631
5158
  # Example 6.
4632
5159
  #
4633
- caption = 'Table with banded columns but without default banded rows.';
5160
+ caption = 'Table with banded columns but without default banded rows.'
4634
5161
 
4635
5162
  # Set the columns widths.
4636
5163
  worksheet6.set_column('B:G', 12)
@@ -4648,7 +5175,7 @@ EOS
4648
5175
  #
4649
5176
  # Example 7.
4650
5177
  #
4651
- caption = 'Table with user defined column headers';
5178
+ caption = 'Table with user defined column headers'
4652
5179
 
4653
5180
  # Set the columns widths.
4654
5181
  worksheet7.set_column('B:G', 12)
@@ -4658,24 +5185,24 @@ EOS
4658
5185
 
4659
5186
  # Add a table to the worksheet.
4660
5187
  worksheet7.add_table(
4661
- 'B3:F7',
4662
- {
4663
- :data => data,
4664
- :columns => [
4665
- { :header => 'Product' },
4666
- { :header => 'Quarter 1' },
4667
- { :header => 'Quarter 2' },
4668
- { :header => 'Quarter 3' },
4669
- { :header => 'Quarter 4' }
4670
- ]
4671
- }
4672
- )
5188
+ 'B3:F7',
5189
+ {
5190
+ :data => data,
5191
+ :columns => [
5192
+ { :header => 'Product' },
5193
+ { :header => 'Quarter 1' },
5194
+ { :header => 'Quarter 2' },
5195
+ { :header => 'Quarter 3' },
5196
+ { :header => 'Quarter 4' }
5197
+ ]
5198
+ }
5199
+ )
4673
5200
 
4674
5201
  ###############################################################################
4675
5202
  #
4676
5203
  # Example 8.
4677
5204
  #
4678
- caption = 'Table with user defined column headers';
5205
+ caption = 'Table with user defined column headers'
4679
5206
 
4680
5207
  # Set the columns widths.
4681
5208
  worksheet8.set_column('B:G', 12)
@@ -4685,29 +5212,29 @@ EOS
4685
5212
 
4686
5213
  # Add a table to the worksheet.
4687
5214
  worksheet8.add_table(
4688
- 'B3:G7',
4689
- {
4690
- :data => data,
4691
- :columns => [
4692
- { :header => 'Product' },
4693
- { :header => 'Quarter 1' },
4694
- { :header => 'Quarter 2' },
4695
- { :header => 'Quarter 3' },
4696
- { :header => 'Quarter 4' },
4697
- {
4698
- :header => 'Year',
4699
- :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])'
4700
- }
4701
- ]
4702
- }
4703
- )
5215
+ 'B3:G7',
5216
+ {
5217
+ :data => data,
5218
+ :columns => [
5219
+ { :header => 'Product' },
5220
+ { :header => 'Quarter 1' },
5221
+ { :header => 'Quarter 2' },
5222
+ { :header => 'Quarter 3' },
5223
+ { :header => 'Quarter 4' },
5224
+ {
5225
+ :header => 'Year',
5226
+ :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])'
5227
+ }
5228
+ ]
5229
+ }
5230
+ )
4704
5231
 
4705
5232
 
4706
5233
  ###############################################################################
4707
5234
  #
4708
5235
  # Example 9.
4709
5236
  #
4710
- caption = 'Table with totals row (but no caption or totals).';
5237
+ caption = 'Table with totals row (but no caption or totals).'
4711
5238
 
4712
5239
  # Set the columns widths.
4713
5240
  worksheet9.set_column('B:G', 12)
@@ -4717,29 +5244,29 @@ EOS
4717
5244
 
4718
5245
  # Add a table to the worksheet.
4719
5246
  worksheet9.add_table(
4720
- 'B3:G8',
4721
- {
4722
- :data => data,
4723
- :total_row => 1,
4724
- :columns => [
4725
- { :header => 'Product' },
4726
- { :header => 'Quarter 1' },
4727
- { :header => 'Quarter 2' },
4728
- { :header => 'Quarter 3' },
4729
- { :header => 'Quarter 4' },
4730
- {
4731
- :header => 'Year',
4732
- :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])'
4733
- }
4734
- ]
4735
- }
4736
- )
5247
+ 'B3:G8',
5248
+ {
5249
+ :data => data,
5250
+ :total_row => 1,
5251
+ :columns => [
5252
+ { :header => 'Product' },
5253
+ { :header => 'Quarter 1' },
5254
+ { :header => 'Quarter 2' },
5255
+ { :header => 'Quarter 3' },
5256
+ { :header => 'Quarter 4' },
5257
+ {
5258
+ :header => 'Year',
5259
+ :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])'
5260
+ }
5261
+ ]
5262
+ }
5263
+ )
4737
5264
 
4738
5265
  ###############################################################################
4739
5266
  #
4740
5267
  # Example 10.
4741
5268
  #
4742
- caption = 'Table with totals row with user captions and functions.';
5269
+ caption = 'Table with totals row with user captions and functions.'
4743
5270
 
4744
5271
  # Set the columns widths.
4745
5272
  worksheet10.set_column('B:G', 12)
@@ -4749,30 +5276,30 @@ EOS
4749
5276
 
4750
5277
  # Add a table to the worksheet.
4751
5278
  worksheet10.add_table(
4752
- 'B3:G8',
4753
- {
4754
- :data => data,
4755
- :total_row => 1,
4756
- :columns => [
4757
- { :header => 'Product', :total_string => 'Totals' },
4758
- { :header => 'Quarter 1', :total_function => 'sum' },
4759
- { :header => 'Quarter 2', :total_function => 'sum' },
4760
- { :header => 'Quarter 3', :total_function => 'sum' },
4761
- { :header => 'Quarter 4', :total_function => 'sum' },
4762
- {
4763
- :header => 'Year',
4764
- :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
4765
- :total_function => 'sum'
4766
- }
4767
- ]
4768
- }
4769
- )
5279
+ 'B3:G8',
5280
+ {
5281
+ :data => data,
5282
+ :total_row => 1,
5283
+ :columns => [
5284
+ { :header => 'Product', :total_string => 'Totals' },
5285
+ { :header => 'Quarter 1', :total_function => 'sum' },
5286
+ { :header => 'Quarter 2', :total_function => 'sum' },
5287
+ { :header => 'Quarter 3', :total_function => 'sum' },
5288
+ { :header => 'Quarter 4', :total_function => 'sum' },
5289
+ {
5290
+ :header => 'Year',
5291
+ :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
5292
+ :total_function => 'sum'
5293
+ }
5294
+ ]
5295
+ }
5296
+ )
4770
5297
 
4771
5298
  ###############################################################################
4772
5299
  #
4773
5300
  # Example 11.
4774
5301
  #
4775
- caption = 'Table with alternative Excel style.';
5302
+ caption = 'Table with alternative Excel style.'
4776
5303
 
4777
5304
  # Set the columns widths.
4778
5305
  worksheet11.set_column('B:G', 12)
@@ -4782,31 +5309,31 @@ EOS
4782
5309
 
4783
5310
  # Add a table to the worksheet.
4784
5311
  worksheet11.add_table(
4785
- 'B3:G8',
4786
- {
4787
- :data => data,
4788
- :style => 'Table Style Light 11',
4789
- :total_row => 1,
4790
- :columns => [
4791
- { :header => 'Product', :total_string => 'Totals' },
4792
- { :header => 'Quarter 1', :total_function => 'sum' },
4793
- { :header => 'Quarter 2', :total_function => 'sum' },
4794
- { :header => 'Quarter 3', :total_function => 'sum' },
4795
- { :header => 'Quarter 4', :total_function => 'sum' },
4796
- {
4797
- :header => 'Year',
4798
- :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
4799
- :total_function => 'sum'
4800
- }
4801
- ]
4802
- }
4803
- )
5312
+ 'B3:G8',
5313
+ {
5314
+ :data => data,
5315
+ :style => 'Table Style Light 11',
5316
+ :total_row => 1,
5317
+ :columns => [
5318
+ { :header => 'Product', :total_string => 'Totals' },
5319
+ { :header => 'Quarter 1', :total_function => 'sum' },
5320
+ { :header => 'Quarter 2', :total_function => 'sum' },
5321
+ { :header => 'Quarter 3', :total_function => 'sum' },
5322
+ { :header => 'Quarter 4', :total_function => 'sum' },
5323
+ {
5324
+ :header => 'Year',
5325
+ :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
5326
+ :total_function => 'sum'
5327
+ }
5328
+ ]
5329
+ }
5330
+ )
4804
5331
 
4805
5332
  ###############################################################################
4806
5333
  #
4807
5334
  # Example 12.
4808
5335
  #
4809
- caption = 'Table with column formats.';
5336
+ caption = 'Table with no Excel style.'
4810
5337
 
4811
5338
  # Set the columns widths.
4812
5339
  worksheet12.set_column('B:G', 12)
@@ -4816,41 +5343,75 @@ EOS
4816
5343
 
4817
5344
  # Add a table to the worksheet.
4818
5345
  worksheet12.add_table(
4819
- 'B3:G8',
4820
- {
4821
- :data => data,
4822
- :total_row => 1,
4823
- :columns => [
4824
- { :header => 'Product', :total_string => 'Totals' },
4825
- {
4826
- :header => 'Quarter 1',
4827
- :total_function => 'sum',
4828
- :format => currency_format,
4829
- },
4830
- {
4831
- :header => 'Quarter 2',
4832
- :total_function => 'sum',
4833
- :format => currency_format,
4834
- },
4835
- {
4836
- :header => 'Quarter 3',
4837
- :total_function => 'sum',
4838
- :format => currency_format,
4839
- },
4840
- {
4841
- :header => 'Quarter 4',
4842
- :total_function => 'sum',
4843
- :format => currency_format,
4844
- },
4845
- {
4846
- :header => 'Year',
4847
- :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
4848
- :total_function => 'sum',
4849
- :format => currency_format,
4850
- }
4851
- ]
4852
- }
4853
- )
5346
+ 'B3:G8',
5347
+ {
5348
+ :data => data,
5349
+ :style => 'None',
5350
+ :total_row => 1,
5351
+ :columns => [
5352
+ { :header => 'Product', :total_string => 'Totals' },
5353
+ { :header => 'Quarter 1', :total_function => 'sum' },
5354
+ { :header => 'Quarter 2', :total_function => 'sum' },
5355
+ { :header => 'Quarter 3', :total_function => 'sum' },
5356
+ { :header => 'Quarter 4', :total_function => 'sum' },
5357
+ {
5358
+ :header => 'Year',
5359
+ :formula => '=SUM(Table12[@[Quarter 1]:[Quarter 4]])',
5360
+ :total_function => 'sum'
5361
+ }
5362
+ ]
5363
+ }
5364
+ )
5365
+
5366
+ ###############################################################################
5367
+ #
5368
+ # Example 13.
5369
+ #
5370
+ caption = 'Table with column formats.'
5371
+
5372
+ # Set the columns widths.
5373
+ worksheet13.set_column('B:G', 12)
5374
+
5375
+ # Write the caption.
5376
+ worksheet13.write('B1', caption)
5377
+
5378
+ # Add a table to the worksheet.
5379
+ worksheet13.add_table(
5380
+ 'B3:G8',
5381
+ {
5382
+ :data => data,
5383
+ :total_row => 1,
5384
+ :columns => [
5385
+ { :header => 'Product', :total_string => 'Totals' },
5386
+ {
5387
+ :header => 'Quarter 1',
5388
+ :total_function => 'sum',
5389
+ :format => currency_format,
5390
+ },
5391
+ {
5392
+ :header => 'Quarter 2',
5393
+ :total_function => 'sum',
5394
+ :format => currency_format,
5395
+ },
5396
+ {
5397
+ :header => 'Quarter 3',
5398
+ :total_function => 'sum',
5399
+ :format => currency_format,
5400
+ },
5401
+ {
5402
+ :header => 'Quarter 4',
5403
+ :total_function => 'sum',
5404
+ :format => currency_format,
5405
+ },
5406
+ {
5407
+ :header => 'Year',
5408
+ :formula => '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
5409
+ :total_function => 'sum',
5410
+ :format => currency_format,
5411
+ }
5412
+ ]
5413
+ }
5414
+ )
4854
5415
 
4855
5416
  workbook.close
4856
5417
  store_to_tempfile
@@ -4864,42 +5425,42 @@ EOS
4864
5425
 
4865
5426
  # Some sample data to plot.
4866
5427
  data = [
4867
- [ -2, 2, 3, -1, 0 ],
4868
- [ 30, 20, 33, 20, 15 ],
4869
- [ 1, -1, -1, 1, -1 ]
4870
- ]
5428
+ [ -2, 2, 3, -1, 0 ],
5429
+ [ 30, 20, 33, 20, 15 ],
5430
+ [ 1, -1, -1, 1, -1 ]
5431
+ ]
4871
5432
 
4872
5433
  # Write the sample data to the worksheet.
4873
5434
  worksheet.write_col('A1', data)
4874
5435
 
4875
5436
  # Add a line sparkline (the default) with markers.
4876
5437
  worksheet.add_sparkline(
4877
- {
4878
- :location => 'F1',
4879
- :range => 'Sheet1!A1:E1',
4880
- :markers => 1
4881
- }
4882
- )
5438
+ {
5439
+ :location => 'F1',
5440
+ :range => 'Sheet1!A1:E1',
5441
+ :markers => 1
5442
+ }
5443
+ )
4883
5444
 
4884
5445
  # Add a column sparkline with non-default style.
4885
5446
  worksheet.add_sparkline(
4886
- {
4887
- :location => 'F2',
4888
- :range => 'Sheet1!A2:E2',
4889
- :type => 'column',
4890
- :style => 12
4891
- }
4892
- )
5447
+ {
5448
+ :location => 'F2',
5449
+ :range => 'Sheet1!A2:E2',
5450
+ :type => 'column',
5451
+ :style => 12
5452
+ }
5453
+ )
4893
5454
 
4894
5455
  # Add a win/loss sparkline with negative values highlighted.
4895
5456
  worksheet.add_sparkline(
4896
- {
4897
- :location => 'F3',
4898
- :range => 'Sheet1!A3:E3',
4899
- :type => 'win_loss',
4900
- :negative_points => 1
4901
- }
4902
- )
5457
+ {
5458
+ :location => 'F3',
5459
+ :range => 'Sheet1!A3:E3',
5460
+ :type => 'win_loss',
5461
+ :negative_points => 1
5462
+ }
5463
+ )
4903
5464
 
4904
5465
  workbook.close
4905
5466
  store_to_tempfile
@@ -4928,11 +5489,11 @@ EOS
4928
5489
  str = 'A default "line" sparkline.'
4929
5490
 
4930
5491
  worksheet1.add_sparkline(
4931
- {
4932
- :location => 'A2',
4933
- :range => 'Sheet2!A1:J1'
4934
- }
4935
- )
5492
+ {
5493
+ :location => 'A2',
5494
+ :range => 'Sheet2!A1:J1'
5495
+ }
5496
+ )
4936
5497
 
4937
5498
  worksheet1.write(row, 1, str)
4938
5499
  row += 1
@@ -4942,12 +5503,12 @@ EOS
4942
5503
  str = 'A default "column" sparkline.'
4943
5504
 
4944
5505
  worksheet1.add_sparkline(
4945
- {
4946
- :location => 'A3',
4947
- :range => 'Sheet2!A2:J2',
4948
- :type => 'column'
4949
- }
4950
- )
5506
+ {
5507
+ :location => 'A3',
5508
+ :range => 'Sheet2!A2:J2',
5509
+ :type => 'column'
5510
+ }
5511
+ )
4951
5512
 
4952
5513
  worksheet1.write(row, 1, str)
4953
5514
  row += 1
@@ -4957,12 +5518,12 @@ EOS
4957
5518
  str = 'A default "win/loss" sparkline.'
4958
5519
 
4959
5520
  worksheet1.add_sparkline(
4960
- {
4961
- :location => 'A4',
4962
- :range => 'Sheet2!A3:J3',
4963
- :type => 'win_loss'
4964
- }
4965
- )
5521
+ {
5522
+ :location => 'A4',
5523
+ :range => 'Sheet2!A3:J3',
5524
+ :type => 'win_loss'
5525
+ }
5526
+ )
4966
5527
 
4967
5528
  worksheet1.write(row, 1, str)
4968
5529
  row += 2
@@ -4972,12 +5533,12 @@ EOS
4972
5533
  str = 'Line with markers.'
4973
5534
 
4974
5535
  worksheet1.add_sparkline(
4975
- {
4976
- :location => 'A6',
4977
- :range => 'Sheet2!A1:J1',
4978
- :markers => 1
4979
- }
4980
- )
5536
+ {
5537
+ :location => 'A6',
5538
+ :range => 'Sheet2!A1:J1',
5539
+ :markers => 1
5540
+ }
5541
+ )
4981
5542
 
4982
5543
  worksheet1.write(row, 1, str)
4983
5544
  row += 1
@@ -4987,13 +5548,13 @@ EOS
4987
5548
  str = 'Line with high and low points.'
4988
5549
 
4989
5550
  worksheet1.add_sparkline(
4990
- {
4991
- :location => 'A7',
4992
- :range => 'Sheet2!A1:J1',
4993
- :high_point => 1,
4994
- :low_point => 1
4995
- }
4996
- )
5551
+ {
5552
+ :location => 'A7',
5553
+ :range => 'Sheet2!A1:J1',
5554
+ :high_point => 1,
5555
+ :low_point => 1
5556
+ }
5557
+ )
4997
5558
 
4998
5559
  worksheet1.write(row, 1, str)
4999
5560
  row += 1
@@ -5003,13 +5564,13 @@ EOS
5003
5564
  str = 'Line with first and last point markers.'
5004
5565
 
5005
5566
  worksheet1.add_sparkline(
5006
- {
5007
- :location => 'A8',
5008
- :range => 'Sheet2!A1:J1',
5009
- :first_point => 1,
5010
- :last_point => 1
5011
- }
5012
- )
5567
+ {
5568
+ :location => 'A8',
5569
+ :range => 'Sheet2!A1:J1',
5570
+ :first_point => 1,
5571
+ :last_point => 1
5572
+ }
5573
+ )
5013
5574
 
5014
5575
  worksheet1.write(row, 1, str)
5015
5576
  row += 1
@@ -5019,12 +5580,12 @@ EOS
5019
5580
  str = 'Line with negative point markers.'
5020
5581
 
5021
5582
  worksheet1.add_sparkline(
5022
- {
5023
- :location => 'A9',
5024
- :range => 'Sheet2!A1:J1',
5025
- :negative_points => 1
5026
- }
5027
- )
5583
+ {
5584
+ :location => 'A9',
5585
+ :range => 'Sheet2!A1:J1',
5586
+ :negative_points => 1
5587
+ }
5588
+ )
5028
5589
 
5029
5590
  worksheet1.write(row, 1, str)
5030
5591
  row += 1
@@ -5034,12 +5595,12 @@ EOS
5034
5595
  str = 'Line with axis.'
5035
5596
 
5036
5597
  worksheet1.add_sparkline(
5037
- {
5038
- :location => 'A10',
5039
- :range => 'Sheet2!A1:J1',
5040
- :axis => 1
5041
- }
5042
- )
5598
+ {
5599
+ :location => 'A10',
5600
+ :range => 'Sheet2!A1:J1',
5601
+ :axis => 1
5602
+ }
5603
+ )
5043
5604
 
5044
5605
  worksheet1.write(row, 1, str)
5045
5606
  row += 2
@@ -5049,12 +5610,12 @@ EOS
5049
5610
  str = 'Column with default style (1).'
5050
5611
 
5051
5612
  worksheet1.add_sparkline(
5052
- {
5053
- :location => 'A12',
5054
- :range => 'Sheet2!A2:J2',
5055
- :type => 'column'
5056
- }
5057
- )
5613
+ {
5614
+ :location => 'A12',
5615
+ :range => 'Sheet2!A2:J2',
5616
+ :type => 'column'
5617
+ }
5618
+ )
5058
5619
 
5059
5620
  worksheet1.write(row, 1, str)
5060
5621
  row += 1
@@ -5064,13 +5625,13 @@ EOS
5064
5625
  str = 'Column with style 2.'
5065
5626
 
5066
5627
  worksheet1.add_sparkline(
5067
- {
5068
- :location => 'A13',
5069
- :range => 'Sheet2!A2:J2',
5070
- :type => 'column',
5071
- :style => 2
5072
- }
5073
- )
5628
+ {
5629
+ :location => 'A13',
5630
+ :range => 'Sheet2!A2:J2',
5631
+ :type => 'column',
5632
+ :style => 2
5633
+ }
5634
+ )
5074
5635
 
5075
5636
  worksheet1.write(row, 1, str)
5076
5637
  row += 1
@@ -5080,13 +5641,13 @@ EOS
5080
5641
  str = 'Column with style 3.'
5081
5642
 
5082
5643
  worksheet1.add_sparkline(
5083
- {
5084
- :location => 'A14',
5085
- :range => 'Sheet2!A2:J2',
5086
- :type => 'column',
5087
- :style => 3
5088
- }
5089
- )
5644
+ {
5645
+ :location => 'A14',
5646
+ :range => 'Sheet2!A2:J2',
5647
+ :type => 'column',
5648
+ :style => 3
5649
+ }
5650
+ )
5090
5651
 
5091
5652
  worksheet1.write(row, 1, str)
5092
5653
  row += 1
@@ -5096,13 +5657,13 @@ EOS
5096
5657
  str = 'Column with style 4.'
5097
5658
 
5098
5659
  worksheet1.add_sparkline(
5099
- {
5100
- :location => 'A15',
5101
- :range => 'Sheet2!A2:J2',
5102
- :type => 'column',
5103
- :style => 4
5104
- }
5105
- )
5660
+ {
5661
+ :location => 'A15',
5662
+ :range => 'Sheet2!A2:J2',
5663
+ :type => 'column',
5664
+ :style => 4
5665
+ }
5666
+ )
5106
5667
 
5107
5668
  worksheet1.write(row, 1, str)
5108
5669
  row += 1
@@ -5112,13 +5673,13 @@ EOS
5112
5673
  str = 'Column with style 5.'
5113
5674
 
5114
5675
  worksheet1.add_sparkline(
5115
- {
5116
- :location => 'A16',
5117
- :range => 'Sheet2!A2:J2',
5118
- :type => 'column',
5119
- :style => 5
5120
- }
5121
- )
5676
+ {
5677
+ :location => 'A16',
5678
+ :range => 'Sheet2!A2:J2',
5679
+ :type => 'column',
5680
+ :style => 5
5681
+ }
5682
+ )
5122
5683
 
5123
5684
  worksheet1.write(row, 1, str)
5124
5685
  row += 1
@@ -5128,13 +5689,13 @@ EOS
5128
5689
  str = 'Column with style 6.'
5129
5690
 
5130
5691
  worksheet1.add_sparkline(
5131
- {
5132
- :location => 'A17',
5133
- :range => 'Sheet2!A2:J2',
5134
- :type => 'column',
5135
- :style => 6
5136
- }
5137
- )
5692
+ {
5693
+ :location => 'A17',
5694
+ :range => 'Sheet2!A2:J2',
5695
+ :type => 'column',
5696
+ :style => 6
5697
+ }
5698
+ )
5138
5699
 
5139
5700
  worksheet1.write(row, 1, str)
5140
5701
  row += 1
@@ -5144,13 +5705,13 @@ EOS
5144
5705
  str = 'Column with a user defined colour.'
5145
5706
 
5146
5707
  worksheet1.add_sparkline(
5147
- {
5148
- :location => 'A18',
5149
- :range => 'Sheet2!A2:J2',
5150
- :type => 'column',
5151
- :series_color => '#E965E0'
5152
- }
5153
- )
5708
+ {
5709
+ :location => 'A18',
5710
+ :range => 'Sheet2!A2:J2',
5711
+ :type => 'column',
5712
+ :series_color => '#E965E0'
5713
+ }
5714
+ )
5154
5715
 
5155
5716
  worksheet1.write(row, 1, str)
5156
5717
  row += 2
@@ -5160,12 +5721,12 @@ EOS
5160
5721
  str = 'A win/loss sparkline.'
5161
5722
 
5162
5723
  worksheet1.add_sparkline(
5163
- {
5164
- :location => 'A20',
5165
- :range => 'Sheet2!A3:J3',
5166
- :type => 'win_loss'
5167
- }
5168
- )
5724
+ {
5725
+ :location => 'A20',
5726
+ :range => 'Sheet2!A3:J3',
5727
+ :type => 'win_loss'
5728
+ }
5729
+ )
5169
5730
 
5170
5731
  worksheet1.write(row, 1, str)
5171
5732
  row += 1
@@ -5175,13 +5736,13 @@ EOS
5175
5736
  str = 'A win/loss sparkline with negative points highlighted.'
5176
5737
 
5177
5738
  worksheet1.add_sparkline(
5178
- {
5179
- :location => 'A21',
5180
- :range => 'Sheet2!A3:J3',
5181
- :type => 'win_loss',
5182
- :negative_points => 1
5183
- }
5184
- )
5739
+ {
5740
+ :location => 'A21',
5741
+ :range => 'Sheet2!A3:J3',
5742
+ :type => 'win_loss',
5743
+ :negative_points => 1
5744
+ }
5745
+ )
5185
5746
 
5186
5747
  worksheet1.write(row, 1, str)
5187
5748
  row += 2
@@ -5191,13 +5752,13 @@ EOS
5191
5752
  str = 'A left to right column (the default).'
5192
5753
 
5193
5754
  worksheet1.add_sparkline(
5194
- {
5195
- :location => 'A23',
5196
- :range => 'Sheet2!A4:J4',
5197
- :type => 'column',
5198
- :style => 20
5199
- }
5200
- )
5755
+ {
5756
+ :location => 'A23',
5757
+ :range => 'Sheet2!A4:J4',
5758
+ :type => 'column',
5759
+ :style => 20
5760
+ }
5761
+ )
5201
5762
 
5202
5763
  worksheet1.write(row, 1, str)
5203
5764
  row += 1
@@ -5207,14 +5768,14 @@ EOS
5207
5768
  str = 'A right to left column.'
5208
5769
 
5209
5770
  worksheet1.add_sparkline(
5210
- {
5211
- :location => 'A24',
5212
- :range => 'Sheet2!A4:J4',
5213
- :type => 'column',
5214
- :style => 20,
5215
- :reverse => 1
5216
- }
5217
- )
5771
+ {
5772
+ :location => 'A24',
5773
+ :range => 'Sheet2!A4:J4',
5774
+ :type => 'column',
5775
+ :style => 20,
5776
+ :reverse => 1
5777
+ }
5778
+ )
5218
5779
 
5219
5780
  worksheet1.write(row, 1, str)
5220
5781
  row += 1
@@ -5224,13 +5785,13 @@ EOS
5224
5785
  str = 'Sparkline and text in one cell.'
5225
5786
 
5226
5787
  worksheet1.add_sparkline(
5227
- {
5228
- :location => 'A25',
5229
- :range => 'Sheet2!A4:J4',
5230
- :type => 'column',
5231
- :style => 20
5232
- }
5233
- )
5788
+ {
5789
+ :location => 'A25',
5790
+ :range => 'Sheet2!A4:J4',
5791
+ :type => 'column',
5792
+ :style => 20
5793
+ }
5794
+ )
5234
5795
 
5235
5796
  worksheet1.write(row, 0, 'Growth')
5236
5797
  worksheet1.write(row, 1, str)
@@ -5241,12 +5802,12 @@ EOS
5241
5802
  str = 'A grouped sparkline. Changes are applied to all three.'
5242
5803
 
5243
5804
  worksheet1.add_sparkline(
5244
- {
5245
- :location => [ 'A27', 'A28', 'A29' ],
5246
- :range => [ 'Sheet2!A5:J5', 'Sheet2!A6:J6', 'Sheet2!A7:J7' ],
5247
- :markers => 1
5248
- }
5249
- )
5805
+ {
5806
+ :location => [ 'A27', 'A28', 'A29' ],
5807
+ :range => [ 'Sheet2!A5:J5', 'Sheet2!A6:J6', 'Sheet2!A7:J7' ],
5808
+ :markers => 1
5809
+ }
5810
+ )
5250
5811
 
5251
5812
  worksheet1.write(row, 1, str)
5252
5813
  row += 1
@@ -5258,23 +5819,23 @@ EOS
5258
5819
  worksheet2.set_column('A:J', 11)
5259
5820
 
5260
5821
  data = [
5261
- # Simple line data.
5262
- [ -2, 2, 3, -1, 0, -2, 3, 2, 1, 0 ],
5822
+ # Simple line data.
5823
+ [ -2, 2, 3, -1, 0, -2, 3, 2, 1, 0 ],
5263
5824
 
5264
- # Simple column data.
5265
- [ 30, 20, 33, 20, 15, 5, 5, 15, 10, 15 ],
5825
+ # Simple column data.
5826
+ [ 30, 20, 33, 20, 15, 5, 5, 15, 10, 15 ],
5266
5827
 
5267
- # Simple win/loss data.
5268
- [ 1, 1, -1, -1, 1, -1, 1, 1, 1, -1 ],
5828
+ # Simple win/loss data.
5829
+ [ 1, 1, -1, -1, 1, -1, 1, 1, 1, -1 ],
5269
5830
 
5270
- # Unbalanced histogram.
5271
- [ 5, 6, 7, 10, 15, 20, 30, 50, 70, 100 ],
5831
+ # Unbalanced histogram.
5832
+ [ 5, 6, 7, 10, 15, 20, 30, 50, 70, 100 ],
5272
5833
 
5273
- # Data for the grouped sparkline example.
5274
- [ -2, 2, 3, -1, 0, -2, 3, 2, 1, 0 ],
5275
- [ 3, -1, 0, -2, 3, 2, 1, 0, 2, 1 ],
5276
- [ 0, -2, 3, 2, 1, 0, 1, 2, 3, 1 ]
5277
- ]
5834
+ # Data for the grouped sparkline example.
5835
+ [ -2, 2, 3, -1, 0, -2, 3, 2, 1, 0 ],
5836
+ [ 3, -1, 0, -2, 3, 2, 1, 0, 2, 1 ],
5837
+ [ 0, -2, 3, 2, 1, 0, 1, 2, 3, 1 ]
5838
+ ]
5278
5839
 
5279
5840
  # Write the sample data to the worksheet.
5280
5841
  worksheet2.write_col('A1', data)
@@ -5339,10 +5900,10 @@ EOS
5339
5900
  # Add the worksheet data that the charts will refer to.
5340
5901
  headings = [ 'Number', 'Batch 1', 'Batch 2' ]
5341
5902
  data = [
5342
- [ 2, 3, 4, 5, 6, 7 ],
5343
- [ 10, 40, 50, 20, 10, 50 ],
5344
- [ 30, 60, 70, 50, 40, 30 ]
5345
- ]
5903
+ [ 2, 3, 4, 5, 6, 7 ],
5904
+ [ 10, 40, 50, 20, 10, 50 ],
5905
+ [ 30, 60, 70, 50, 40, 30 ]
5906
+ ]
5346
5907
 
5347
5908
  worksheet.write('A1', headings, bold)
5348
5909
  worksheet.write('A2', data)
@@ -5352,18 +5913,18 @@ EOS
5352
5913
 
5353
5914
  # Configure the first series.
5354
5915
  chart1.add_series(
5355
- :name => '=Sheet1!$B$1',
5356
- :categories => '=Sheet1!$A$2:$A$7',
5357
- :values => '=Sheet1!$B$2:$B$7'
5358
- )
5916
+ :name => '=Sheet1!$B$1',
5917
+ :categories => '=Sheet1!$A$2:$A$7',
5918
+ :values => '=Sheet1!$B$2:$B$7'
5919
+ )
5359
5920
 
5360
5921
  # Configure second series. Note alternative use of array ref to define
5361
5922
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
5362
5923
  chart1.add_series(
5363
- :name => '=Sheet1!$C$1',
5364
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
5365
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
5366
- )
5924
+ :name => '=Sheet1!$C$1',
5925
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
5926
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
5927
+ )
5367
5928
 
5368
5929
  # Add a chart title and some axis labels.
5369
5930
  chart1.set_title(:name => 'Chart with Data Table')
@@ -5383,18 +5944,18 @@ EOS
5383
5944
 
5384
5945
  # Configure the first series.
5385
5946
  chart2.add_series(
5386
- :name => '=Sheet1!$B$1',
5387
- :categories => '=Sheet1!$A$2:$A$7',
5388
- :values => '=Sheet1!$B$2:$B$7'
5389
- )
5947
+ :name => '=Sheet1!$B$1',
5948
+ :categories => '=Sheet1!$A$2:$A$7',
5949
+ :values => '=Sheet1!$B$2:$B$7'
5950
+ )
5390
5951
 
5391
5952
  # Configure second series. Note alternative use of array ref to define
5392
5953
  # ranges: [ sheetname, row_start, row_end, col_start, col_end ].
5393
5954
  chart2.add_series(
5394
- :name => '=Sheet1!$C$1',
5395
- :categories => [ 'Sheet1', 1, 6, 0, 0 ],
5396
- :values => [ 'Sheet1', 1, 6, 2, 2 ]
5397
- )
5955
+ :name => '=Sheet1!$C$1',
5956
+ :categories => [ 'Sheet1', 1, 6, 0, 0 ],
5957
+ :values => [ 'Sheet1', 1, 6, 2, 2 ]
5958
+ )
5398
5959
 
5399
5960
  # Add a chart title and some axis labels.
5400
5961
  chart2.set_title(:name => 'Data Table with legend keys')
@@ -5424,10 +5985,10 @@ EOS
5424
5985
  # Add the worksheet data that the charts will refer to.
5425
5986
  headings = [ 'Number', 'Data 1', 'Data 2' ]
5426
5987
  data = [
5427
- [ 2, 3, 4, 5, 6, 7 ],
5428
- [ 10, 40, 50, 20, 10, 50 ],
5429
- [ 30, 60, 70, 50, 40, 30 ]
5430
- ]
5988
+ [ 2, 3, 4, 5, 6, 7 ],
5989
+ [ 10, 40, 50, 20, 10, 50 ],
5990
+ [ 30, 60, 70, 50, 40, 30 ]
5991
+ ]
5431
5992
 
5432
5993
  worksheet.write('A1', headings, bold)
5433
5994
  worksheet.write('A2', data)
@@ -5443,20 +6004,20 @@ EOS
5443
6004
 
5444
6005
  # Configure the first series with a polynomial trendline.
5445
6006
  chart1.add_series(
5446
- :categories => '=Sheet1!$A$2:$A$7',
5447
- :values => '=Sheet1!$B$2:$B$7',
5448
- :trendline => {
5449
- :type => 'polynomial',
5450
- :order => 3,
5451
- }
5452
- )
6007
+ :categories => '=Sheet1!$A$2:$A$7',
6008
+ :values => '=Sheet1!$B$2:$B$7',
6009
+ :trendline => {
6010
+ :type => 'polynomial',
6011
+ :order => 3,
6012
+ }
6013
+ )
5453
6014
 
5454
6015
  # Configure the second series with a moving average trendline.
5455
6016
  chart1.add_series(
5456
- :categories => '=Sheet1!$A$2:$A$7',
5457
- :values => '=Sheet1!$C$2:$C$7',
5458
- :trendline => { :type => 'linear' }
5459
- )
6017
+ :categories => '=Sheet1!$A$2:$A$7',
6018
+ :values => '=Sheet1!$C$2:$C$7',
6019
+ :trendline => { :type => 'linear' }
6020
+ )
5460
6021
 
5461
6022
  # Add a chart title. and some axis labels.
5462
6023
  chart1.set_title(:name => 'Chart with Trendlines')
@@ -5474,17 +6035,17 @@ EOS
5474
6035
 
5475
6036
  # Configure the first series.
5476
6037
  chart2.add_series(
5477
- :categories => '=Sheet1!$A$2:$A$7',
5478
- :values => '=Sheet1!$B$2:$B$7',
5479
- :data_labels => { :value => 1 },
5480
- :marker => { :type => 'automatic' }
5481
- )
6038
+ :categories => '=Sheet1!$A$2:$A$7',
6039
+ :values => '=Sheet1!$B$2:$B$7',
6040
+ :data_labels => { :value => 1 },
6041
+ :marker => { :type => 'automatic' }
6042
+ )
5482
6043
 
5483
6044
  # Configure the second series.
5484
6045
  chart2.add_series(
5485
- :categories => '=Sheet1!$A$2:$A$7',
5486
- :values => '=Sheet1!$C$2:$C$7'
5487
- )
6046
+ :categories => '=Sheet1!$A$2:$A$7',
6047
+ :values => '=Sheet1!$C$2:$C$7'
6048
+ )
5488
6049
 
5489
6050
  # Add a chart title. and some axis labels.
5490
6051
  chart2.set_title(:name => 'Chart with Data Labels and Markers')
@@ -5502,16 +6063,16 @@ EOS
5502
6063
 
5503
6064
  # Configure the first series.
5504
6065
  chart3.add_series(
5505
- :categories => '=Sheet1!$A$2:$A$7',
5506
- :values => '=Sheet1!$B$2:$B$7',
5507
- :y_error_bars => { :type => 'standard_error' }
5508
- )
6066
+ :categories => '=Sheet1!$A$2:$A$7',
6067
+ :values => '=Sheet1!$B$2:$B$7',
6068
+ :y_error_bars => { :type => 'standard_error' }
6069
+ )
5509
6070
 
5510
6071
  # Configure the second series.
5511
6072
  chart3.add_series(
5512
- :categories => '=Sheet1!$A$2:$A$7',
5513
- :values => '=Sheet1!$C$2:$C$7'
5514
- )
6073
+ :categories => '=Sheet1!$A$2:$A$7',
6074
+ :values => '=Sheet1!$C$2:$C$7'
6075
+ )
5515
6076
 
5516
6077
  # Add a chart title. and some axis labels.
5517
6078
  chart3.set_title(:name => 'Chart with Error Bars')
@@ -5532,15 +6093,15 @@ EOS
5532
6093
 
5533
6094
  # Configure the first series.
5534
6095
  chart4.add_series(
5535
- :categories => '=Sheet1!$A$2:$A$7',
5536
- :values => '=Sheet1!$B$2:$B$7'
5537
- )
6096
+ :categories => '=Sheet1!$A$2:$A$7',
6097
+ :values => '=Sheet1!$B$2:$B$7'
6098
+ )
5538
6099
 
5539
6100
  # Configure the second series.
5540
6101
  chart4.add_series(
5541
- :categories => '=Sheet1!$A$2:$A$7',
5542
- :values => '=Sheet1!$C$2:$C$7'
5543
- )
6102
+ :categories => '=Sheet1!$A$2:$A$7',
6103
+ :values => '=Sheet1!$C$2:$C$7'
6104
+ )
5544
6105
 
5545
6106
  # Add a chart title. and some axis labels.
5546
6107
  chart4.set_title(:name => 'Chart with Up-Down Bars')
@@ -5561,15 +6122,15 @@ EOS
5561
6122
 
5562
6123
  # Configure the first series.
5563
6124
  chart5.add_series(
5564
- :categories => '=Sheet1!$A$2:$A$7',
5565
- :values => '=Sheet1!$B$2:$B$7'
5566
- )
6125
+ :categories => '=Sheet1!$A$2:$A$7',
6126
+ :values => '=Sheet1!$B$2:$B$7'
6127
+ )
5567
6128
 
5568
6129
  # Configure the second series.
5569
6130
  chart5.add_series(
5570
- :categories => '=Sheet1!$A$2:$A$7',
5571
- :values => '=Sheet1!$C$2:$C$7'
5572
- )
6131
+ :categories => '=Sheet1!$A$2:$A$7',
6132
+ :values => '=Sheet1!$C$2:$C$7'
6133
+ )
5573
6134
 
5574
6135
  # Add a chart title. and some axis labels.
5575
6136
  chart5.set_title(:name => 'Chart with High-Low Lines')
@@ -5590,15 +6151,15 @@ EOS
5590
6151
 
5591
6152
  # Configure the first series.
5592
6153
  chart6.add_series(
5593
- :categories => '=Sheet1!$A$2:$A$7',
5594
- :values => '=Sheet1!$B$2:$B$7'
5595
- )
6154
+ :categories => '=Sheet1!$A$2:$A$7',
6155
+ :values => '=Sheet1!$B$2:$B$7'
6156
+ )
5596
6157
 
5597
6158
  # Configure the second series.
5598
6159
  chart6.add_series(
5599
- :categories => '=Sheet1!$A$2:$A$7',
5600
- :values => '=Sheet1!$C$2:$C$7'
5601
- )
6160
+ :categories => '=Sheet1!$A$2:$A$7',
6161
+ :values => '=Sheet1!$C$2:$C$7'
6162
+ )
5602
6163
 
5603
6164
  # Add a chart title. and some axis labels.
5604
6165
  chart6.set_title(:name => 'Chart with Drop Lines')