write_xlsx 0.90.0 → 1.02.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (369) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Changes +93 -0
  4. data/LICENSE.txt +1 -1
  5. data/README.md +2 -2
  6. data/examples/a_simple.rb +2 -7
  7. data/examples/add_vba_project.rb +1 -1
  8. data/examples/array_formula.rb +1 -1
  9. data/examples/chart_area.rb +5 -2
  10. data/examples/chart_bar.rb +5 -2
  11. data/examples/chart_clustered.rb +1 -1
  12. data/examples/chart_column.rb +5 -2
  13. data/examples/chart_combined.rb +1 -1
  14. data/examples/chart_data_table.rb +9 -3
  15. data/examples/chart_data_tools.rb +25 -7
  16. data/examples/chart_doughnut.rb +17 -5
  17. data/examples/chart_gauge.rb +73 -0
  18. data/examples/chart_line.rb +5 -2
  19. data/examples/chart_pareto.rb +1 -1
  20. data/examples/chart_pie.rb +9 -3
  21. data/examples/chart_radar.rb +13 -4
  22. data/examples/chart_scatter.rb +5 -2
  23. data/examples/chart_secondary_axis.rb +5 -2
  24. data/examples/chart_stock.rb +1 -1
  25. data/examples/chart_styles.rb +1 -1
  26. data/examples/colors.rb +1 -1
  27. data/examples/conditional_format.rb +73 -46
  28. data/examples/data_validate.rb +1 -1
  29. data/examples/date_time.rb +1 -1
  30. data/examples/demo.rb +5 -8
  31. data/examples/formats.rb +1 -1
  32. data/examples/headers.rb +1 -1
  33. data/examples/hide_row_col.rb +1 -1
  34. data/examples/hide_sheet.rb +1 -1
  35. data/examples/hyperlink1.rb +5 -12
  36. data/examples/indent.rb +1 -1
  37. data/examples/macros.rb +1 -1
  38. data/examples/merge1.rb +1 -1
  39. data/examples/merge2.rb +1 -1
  40. data/examples/merge3.rb +1 -1
  41. data/examples/merge4.rb +1 -1
  42. data/examples/merge5.rb +1 -1
  43. data/examples/merge6.rb +1 -1
  44. data/examples/outline.rb +1 -1
  45. data/examples/outline_collapsed.rb +1 -1
  46. data/examples/panes.rb +1 -1
  47. data/examples/properties.rb +1 -1
  48. data/examples/regions.rb +1 -1
  49. data/examples/rich_strings.rb +1 -1
  50. data/examples/right_to_left.rb +1 -1
  51. data/examples/shape1.rb +1 -1
  52. data/examples/shape2.rb +1 -1
  53. data/examples/shape3.rb +1 -1
  54. data/examples/shape4.rb +1 -1
  55. data/examples/shape5.rb +1 -1
  56. data/examples/shape6.rb +1 -1
  57. data/examples/shape7.rb +1 -1
  58. data/examples/shape8.rb +1 -1
  59. data/examples/shape_all.rb +1 -1
  60. data/examples/sparklines1.rb +1 -1
  61. data/examples/sparklines2.rb +1 -1
  62. data/examples/stats.rb +1 -1
  63. data/examples/stats_ext.rb +1 -1
  64. data/examples/stocks.rb +1 -1
  65. data/examples/tab_colors.rb +1 -1
  66. data/examples/tables.rb +1 -1
  67. data/lib/write_xlsx/chart.rb +124 -240
  68. data/lib/write_xlsx/chart/area.rb +1 -1
  69. data/lib/write_xlsx/chart/axis.rb +4 -4
  70. data/lib/write_xlsx/chart/bar.rb +1 -1
  71. data/lib/write_xlsx/chart/caption.rb +3 -1
  72. data/lib/write_xlsx/chart/column.rb +1 -1
  73. data/lib/write_xlsx/chart/doughnut.rb +1 -1
  74. data/lib/write_xlsx/chart/legend.rb +14 -0
  75. data/lib/write_xlsx/chart/line.rb +1 -1
  76. data/lib/write_xlsx/chart/pie.rb +32 -15
  77. data/lib/write_xlsx/chart/radar.rb +1 -1
  78. data/lib/write_xlsx/chart/scatter.rb +1 -1
  79. data/lib/write_xlsx/chart/series.rb +11 -7
  80. data/lib/write_xlsx/chart/stock.rb +1 -1
  81. data/lib/write_xlsx/chartsheet.rb +35 -7
  82. data/lib/write_xlsx/drawing.rb +86 -30
  83. data/lib/write_xlsx/format.rb +19 -15
  84. data/lib/write_xlsx/package/comments.rb +57 -54
  85. data/lib/write_xlsx/package/conditional_format.rb +360 -39
  86. data/lib/write_xlsx/package/content_types.rb +10 -0
  87. data/lib/write_xlsx/package/custom.rb +125 -0
  88. data/lib/write_xlsx/package/packager.rb +26 -0
  89. data/lib/write_xlsx/package/relationships.rb +2 -2
  90. data/lib/write_xlsx/package/styles.rb +53 -21
  91. data/lib/write_xlsx/package/table.rb +16 -4
  92. data/lib/write_xlsx/shape.rb +4 -3
  93. data/lib/write_xlsx/sheets.rb +11 -1
  94. data/lib/write_xlsx/sparkline.rb +1 -1
  95. data/lib/write_xlsx/utility.rb +324 -35
  96. data/lib/write_xlsx/version.rb +1 -1
  97. data/lib/write_xlsx/workbook.rb +136 -17
  98. data/lib/write_xlsx/worksheet.rb +450 -163
  99. data/lib/write_xlsx/worksheet/data_validation.rb +10 -14
  100. data/lib/write_xlsx/worksheet/hyperlink.rb +16 -37
  101. data/test/chart/test_write_legend_pos.rb +9 -1
  102. data/test/chartsheet/test_write_sheet_protection.rb +91 -0
  103. data/test/drawing/test_drawing_chart_01.rb +6 -2
  104. data/test/drawing/test_drawing_image_01.rb +12 -3
  105. data/test/drawing/test_drawing_shape_01.rb +8 -5
  106. data/test/drawing/test_drawing_shape_02.rb +12 -5
  107. data/test/drawing/test_drawing_shape_03.rb +8 -5
  108. data/test/drawing/test_drawing_shape_04.rb +8 -24
  109. data/test/drawing/test_drawing_shape_05.rb +8 -5
  110. data/test/drawing/test_drawing_shape_06.rb +11 -6
  111. data/test/drawing/test_drawing_shape_07.rb +11 -6
  112. data/test/drawing/test_write_a_graphic_frame_locks.rb +1 -1
  113. data/test/drawing/test_write_c_chart.rb +1 -1
  114. data/test/drawing/test_write_c_nv_graphic_frame_pr.rb +1 -1
  115. data/test/drawing/test_write_c_nv_pr.rb +1 -1
  116. data/test/drawing/test_write_col.rb +1 -1
  117. data/test/drawing/test_write_col_off.rb +1 -1
  118. data/test/drawing/test_write_ext.rb +1 -1
  119. data/test/drawing/test_write_pos.rb +1 -1
  120. data/test/drawing/test_write_row.rb +1 -1
  121. data/test/drawing/test_write_row_off.rb +1 -1
  122. data/test/drawing/test_write_xfrm_extension.rb +1 -1
  123. data/test/drawing/test_write_xfrm_offset.rb +1 -1
  124. data/test/helper.rb +6 -1
  125. data/test/package/comments/test_comments_01.rb +54 -0
  126. data/test/package/comments/test_comments_02.rb +54 -0
  127. data/test/perl_output/chart_gauge.xlsx +0 -0
  128. data/test/perl_output/formats.xlsx +0 -0
  129. data/test/regression/_test_hyperlink31.rb +26 -0
  130. data/test/regression/images/happy.jpg +0 -0
  131. data/test/regression/images/zero_dpi.jpg +0 -0
  132. data/test/regression/test_array_formula03.rb +36 -0
  133. data/test/regression/test_autofilter08.rb +110 -0
  134. data/test/regression/test_autofilter09.rb +110 -0
  135. data/test/regression/test_autofilter10.rb +110 -0
  136. data/test/regression/test_chart_axis26.rb +10 -8
  137. data/test/regression/test_chart_axis27.rb +1 -1
  138. data/test/regression/test_chart_axis28.rb +1 -1
  139. data/test/regression/test_chart_axis29.rb +1 -1
  140. data/test/regression/test_chart_axis33.rb +1 -1
  141. data/test/regression/test_chart_axis42.rb +44 -0
  142. data/test/regression/test_chart_axis43.rb +44 -0
  143. data/test/regression/test_chart_axis44.rb +54 -0
  144. data/test/regression/test_chart_axis45.rb +54 -0
  145. data/test/regression/test_chart_axis46.rb +54 -0
  146. data/test/regression/test_chart_bar08.rb +3 -0
  147. data/test/regression/test_chart_bar11.rb +3 -0
  148. data/test/regression/test_chart_bar14.rb +3 -0
  149. data/test/regression/test_chart_chartarea05.rb +16 -17
  150. data/test/regression/test_chart_chartarea06.rb +49 -0
  151. data/test/regression/test_chart_combined10.rb +43 -0
  152. data/test/regression/test_chart_combined11.rb +63 -0
  153. data/test/regression/test_chart_data_labels25.rb +61 -0
  154. data/test/regression/test_chart_doughnut07.rb +37 -0
  155. data/test/regression/test_chart_font09.rb +1 -1
  156. data/test/regression/test_chart_format26.rb +48 -0
  157. data/test/regression/test_chart_format27.rb +58 -0
  158. data/test/regression/test_chart_format28.rb +52 -0
  159. data/test/regression/test_chart_format29.rb +59 -0
  160. data/test/regression/test_chart_format30.rb +53 -0
  161. data/test/regression/test_chart_format31.rb +60 -0
  162. data/test/regression/test_chart_legend03.rb +41 -0
  163. data/test/regression/test_chart_legend04.rb +41 -0
  164. data/test/regression/test_chart_legend05.rb +41 -0
  165. data/test/regression/test_chart_legend06.rb +41 -0
  166. data/test/regression/test_chart_legend07.rb +38 -0
  167. data/test/regression/test_chart_size03.rb +4 -1
  168. data/test/regression/test_chart_table03.rb +56 -0
  169. data/test/regression/test_comment13.rb +36 -0
  170. data/test/regression/test_comment14.rb +29 -0
  171. data/test/regression/test_cond_format14.rb +42 -0
  172. data/test/regression/test_cond_format15.rb +53 -0
  173. data/test/regression/test_cond_format16.rb +53 -0
  174. data/test/regression/test_cond_format17.rb +37 -0
  175. data/test/regression/test_cond_format18.rb +136 -0
  176. data/test/regression/test_cond_format19.rb +64 -0
  177. data/test/regression/test_cond_format20.rb +43 -0
  178. data/test/regression/test_date_1904_01.rb +1 -1
  179. data/test/regression/test_escapes04.rb +3 -0
  180. data/test/regression/test_escapes05.rb +3 -0
  181. data/test/regression/test_escapes07.rb +3 -0
  182. data/test/regression/test_escapes08.rb +3 -0
  183. data/test/regression/test_format15.rb +26 -0
  184. data/test/regression/test_hyperlink01.rb +3 -0
  185. data/test/regression/test_hyperlink02.rb +3 -0
  186. data/test/regression/test_hyperlink03.rb +4 -0
  187. data/test/regression/test_hyperlink04.rb +3 -0
  188. data/test/regression/test_hyperlink05.rb +3 -0
  189. data/test/regression/test_hyperlink06.rb +3 -0
  190. data/test/regression/test_hyperlink07.rb +3 -0
  191. data/test/regression/test_hyperlink08.rb +3 -0
  192. data/test/regression/test_hyperlink09.rb +3 -0
  193. data/test/regression/test_hyperlink10.rb +3 -0
  194. data/test/regression/test_hyperlink11.rb +3 -0
  195. data/test/regression/test_hyperlink12.rb +3 -0
  196. data/test/regression/test_hyperlink13.rb +3 -0
  197. data/test/regression/test_hyperlink14.rb +3 -0
  198. data/test/regression/test_hyperlink15.rb +3 -0
  199. data/test/regression/test_hyperlink16.rb +3 -0
  200. data/test/regression/test_hyperlink17.rb +3 -0
  201. data/test/regression/test_hyperlink18.rb +3 -0
  202. data/test/regression/test_hyperlink20.rb +3 -0
  203. data/test/regression/test_hyperlink21.rb +3 -0
  204. data/test/regression/test_hyperlink22.rb +3 -0
  205. data/test/regression/test_hyperlink23.rb +3 -0
  206. data/test/regression/test_hyperlink24.rb +3 -0
  207. data/test/regression/test_hyperlink25.rb +3 -0
  208. data/test/regression/test_hyperlink26.rb +3 -0
  209. data/test/regression/test_hyperlink27.rb +3 -0
  210. data/test/regression/test_hyperlink28.rb +50 -0
  211. data/test/regression/test_hyperlink29.rb +27 -0
  212. data/test/regression/test_hyperlink30.rb +36 -0
  213. data/test/regression/test_hyperlink32.rb +27 -0
  214. data/test/regression/test_hyperlink33.rb +28 -0
  215. data/test/regression/test_hyperlink34.rb +33 -0
  216. data/test/regression/test_hyperlink35.rb +39 -0
  217. data/test/regression/test_hyperlink36.rb +34 -0
  218. data/test/regression/test_hyperlink37.rb +33 -0
  219. data/test/regression/test_hyperlink38.rb +27 -0
  220. data/test/regression/test_hyperlink39.rb +27 -0
  221. data/test/regression/test_hyperlink40.rb +27 -0
  222. data/test/regression/test_hyperlink41.rb +27 -0
  223. data/test/regression/test_hyperlink42.rb +27 -0
  224. data/test/regression/test_hyperlink43.rb +27 -0
  225. data/test/regression/test_hyperlink44.rb +27 -0
  226. data/test/regression/test_hyperlink45.rb +27 -0
  227. data/test/regression/test_hyperlink47.rb +27 -0
  228. data/test/regression/test_image06.rb +5 -5
  229. data/test/regression/test_image08.rb +5 -4
  230. data/test/regression/test_image15.rb +4 -2
  231. data/test/regression/test_image28.rb +1 -1
  232. data/test/regression/test_image35.rb +26 -0
  233. data/test/regression/test_image36.rb +26 -0
  234. data/test/regression/test_image44.rb +28 -0
  235. data/test/regression/test_image45.rb +28 -0
  236. data/test/regression/test_image46.rb +29 -0
  237. data/test/regression/test_image47.rb +28 -0
  238. data/test/regression/test_object_position01.rb +26 -0
  239. data/test/regression/test_object_position02.rb +26 -0
  240. data/test/regression/test_object_position03.rb +26 -0
  241. data/test/regression/test_object_position04.rb +44 -0
  242. data/test/regression/test_object_position06.rb +28 -0
  243. data/test/regression/test_object_position07.rb +28 -0
  244. data/test/regression/test_object_position08.rb +47 -0
  245. data/test/regression/test_object_position09.rb +50 -0
  246. data/test/regression/test_object_position10.rb +28 -0
  247. data/test/regression/test_properties01.rb +1 -4
  248. data/test/regression/test_properties02.rb +1 -4
  249. data/test/regression/test_properties03.rb +26 -0
  250. data/test/regression/test_properties04.rb +61 -0
  251. data/test/regression/test_properties05.rb +30 -0
  252. data/test/regression/test_shape_connect01.rb +4 -2
  253. data/test/regression/test_table03.rb +3 -0
  254. data/test/regression/test_table04.rb +3 -0
  255. data/test/regression/test_table05.rb +3 -0
  256. data/test/regression/test_table06.rb +3 -0
  257. data/test/regression/test_table20.rb +34 -0
  258. data/test/regression/test_table21.rb +36 -0
  259. data/test/regression/test_table22.rb +32 -0
  260. data/test/regression/test_table23.rb +56 -0
  261. data/test/regression/xlsx_files/array_formula03.xlsx +0 -0
  262. data/test/regression/xlsx_files/autofilter08.xlsx +0 -0
  263. data/test/regression/xlsx_files/autofilter09.xlsx +0 -0
  264. data/test/regression/xlsx_files/autofilter10.xlsx +0 -0
  265. data/test/regression/xlsx_files/chart_axis26.xlsx +0 -0
  266. data/test/regression/xlsx_files/chart_axis27.xlsx +0 -0
  267. data/test/regression/xlsx_files/chart_axis28.xlsx +0 -0
  268. data/test/regression/xlsx_files/chart_axis29.xlsx +0 -0
  269. data/test/regression/xlsx_files/chart_axis33.xlsx +0 -0
  270. data/test/regression/xlsx_files/chart_axis42.xlsx +0 -0
  271. data/test/regression/xlsx_files/chart_axis43.xlsx +0 -0
  272. data/test/regression/xlsx_files/chart_axis44.xlsx +0 -0
  273. data/test/regression/xlsx_files/chart_axis45.xlsx +0 -0
  274. data/test/regression/xlsx_files/chart_axis46.xlsx +0 -0
  275. data/test/regression/xlsx_files/chart_chartarea05.xlsx +0 -0
  276. data/test/regression/xlsx_files/chart_chartarea06.xlsx +0 -0
  277. data/test/regression/xlsx_files/chart_combined10.xlsx +0 -0
  278. data/test/regression/xlsx_files/chart_combined11.xlsx +0 -0
  279. data/test/regression/xlsx_files/chart_data_labels25.xlsx +0 -0
  280. data/test/regression/xlsx_files/chart_doughnut07.xlsx +0 -0
  281. data/test/regression/xlsx_files/chart_font09.xlsx +0 -0
  282. data/test/regression/xlsx_files/chart_format26.xlsx +0 -0
  283. data/test/regression/xlsx_files/chart_format27.xlsx +0 -0
  284. data/test/regression/xlsx_files/chart_format28.xlsx +0 -0
  285. data/test/regression/xlsx_files/chart_format29.xlsx +0 -0
  286. data/test/regression/xlsx_files/chart_format30.xlsx +0 -0
  287. data/test/regression/xlsx_files/chart_format31.xlsx +0 -0
  288. data/test/regression/xlsx_files/chart_legend03.xlsx +0 -0
  289. data/test/regression/xlsx_files/chart_legend04.xlsx +0 -0
  290. data/test/regression/xlsx_files/chart_legend05.xlsx +0 -0
  291. data/test/regression/xlsx_files/chart_legend06.xlsx +0 -0
  292. data/test/regression/xlsx_files/chart_legend07.xlsx +0 -0
  293. data/test/regression/xlsx_files/chart_table03.xlsx +0 -0
  294. data/test/regression/xlsx_files/comment13.xlsx +0 -0
  295. data/test/regression/xlsx_files/comment14.xlsx +0 -0
  296. data/test/regression/xlsx_files/cond_format14.xlsx +0 -0
  297. data/test/regression/xlsx_files/cond_format15.xlsx +0 -0
  298. data/test/regression/xlsx_files/cond_format16.xlsx +0 -0
  299. data/test/regression/xlsx_files/cond_format17.xlsx +0 -0
  300. data/test/regression/xlsx_files/cond_format18.xlsx +0 -0
  301. data/test/regression/xlsx_files/cond_format19.xlsx +0 -0
  302. data/test/regression/xlsx_files/cond_format20.xlsx +0 -0
  303. data/test/regression/xlsx_files/date_1904_01.xlsx +0 -0
  304. data/test/regression/xlsx_files/format15.xlsx +0 -0
  305. data/test/regression/xlsx_files/hyperlink28.xlsx +0 -0
  306. data/test/regression/xlsx_files/hyperlink29.xlsx +0 -0
  307. data/test/regression/xlsx_files/hyperlink30.xlsx +0 -0
  308. data/test/regression/xlsx_files/hyperlink31.xlsx +0 -0
  309. data/test/regression/xlsx_files/hyperlink32.xlsx +0 -0
  310. data/test/regression/xlsx_files/hyperlink33.xlsx +0 -0
  311. data/test/regression/xlsx_files/hyperlink34.xlsx +0 -0
  312. data/test/regression/xlsx_files/hyperlink35.xlsx +0 -0
  313. data/test/regression/xlsx_files/hyperlink36.xlsx +0 -0
  314. data/test/regression/xlsx_files/hyperlink37.xlsx +0 -0
  315. data/test/regression/xlsx_files/hyperlink38.xlsx +0 -0
  316. data/test/regression/xlsx_files/hyperlink39.xlsx +0 -0
  317. data/test/regression/xlsx_files/hyperlink40.xlsx +0 -0
  318. data/test/regression/xlsx_files/hyperlink41.xlsx +0 -0
  319. data/test/regression/xlsx_files/hyperlink42.xlsx +0 -0
  320. data/test/regression/xlsx_files/hyperlink43.xlsx +0 -0
  321. data/test/regression/xlsx_files/hyperlink44.xlsx +0 -0
  322. data/test/regression/xlsx_files/hyperlink45.xlsx +0 -0
  323. data/test/regression/xlsx_files/hyperlink47.xlsx +0 -0
  324. data/test/regression/xlsx_files/hyperlink48.xlsx +0 -0
  325. data/test/regression/xlsx_files/hyperlink49.xlsx +0 -0
  326. data/test/regression/xlsx_files/image06.xlsx +0 -0
  327. data/test/regression/xlsx_files/image35.xlsx +0 -0
  328. data/test/regression/xlsx_files/image36.xlsx +0 -0
  329. data/test/regression/xlsx_files/image44.xlsx +0 -0
  330. data/test/regression/xlsx_files/image45.xlsx +0 -0
  331. data/test/regression/xlsx_files/image46.xlsx +0 -0
  332. data/test/regression/xlsx_files/image47.xlsx +0 -0
  333. data/test/regression/xlsx_files/object_position01.xlsx +0 -0
  334. data/test/regression/xlsx_files/object_position02.xlsx +0 -0
  335. data/test/regression/xlsx_files/object_position03.xlsx +0 -0
  336. data/test/regression/xlsx_files/object_position04.xlsx +0 -0
  337. data/test/regression/xlsx_files/object_position06.xlsx +0 -0
  338. data/test/regression/xlsx_files/object_position07.xlsx +0 -0
  339. data/test/regression/xlsx_files/object_position08.xlsx +0 -0
  340. data/test/regression/xlsx_files/object_position09.xlsx +0 -0
  341. data/test/regression/xlsx_files/object_position10.xlsx +0 -0
  342. data/test/regression/xlsx_files/properties03.xlsx +0 -0
  343. data/test/regression/xlsx_files/properties04.xlsx +0 -0
  344. data/test/regression/xlsx_files/properties05.xlsx +0 -0
  345. data/test/regression/xlsx_files/table21.xlsx +0 -0
  346. data/test/regression/xlsx_files/table22.xlsx +0 -0
  347. data/test/regression/xlsx_files/table23.xlsx +0 -0
  348. data/test/test_example_match.rb +836 -771
  349. data/test/workbook/test_check_sheetname.rb +61 -0
  350. data/test/workbook/test_write_workbook_view.rb +117 -0
  351. data/test/worksheet/test_cond_format_22.rb +266 -0
  352. data/test/worksheet/test_cond_format_23.rb +242 -0
  353. data/test/worksheet/test_cond_format_24.rb +303 -0
  354. data/test/worksheet/test_data_bar_01.rb +53 -0
  355. data/test/worksheet/test_data_bar_02.rb +79 -0
  356. data/test/worksheet/test_data_bar_03.rb +147 -0
  357. data/test/worksheet/test_data_bar_04.rb +145 -0
  358. data/test/worksheet/test_data_bar_05.rb +147 -0
  359. data/test/worksheet/test_data_bar_06.rb +145 -0
  360. data/test/worksheet/test_data_bar_07.rb +146 -0
  361. data/test/worksheet/test_data_bar_08.rb +54 -0
  362. data/test/worksheet/test_data_bar_09.rb +80 -0
  363. data/test/worksheet/test_data_bar_10.rb +165 -0
  364. data/test/worksheet/test_data_bar_11.rb +167 -0
  365. data/test/worksheet/test_data_bar_12.rb +104 -0
  366. data/test/worksheet/test_write_data_validation_02.rb +44 -0
  367. data/test/worksheet/test_write_sheet_view.rb +19 -1
  368. metadata +364 -7
  369. data/test/package/comments/test_write_text_t.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94c163c93be013a57cc4a4edba4cea1ac35f91ecbed56443d535fa1d6e1a464f
4
- data.tar.gz: 29fecf270f9b3382e0adae5f9f8ffd3b15ca97a84fc9da8bc24d0402de9a7ce7
3
+ metadata.gz: cd25c9e7242d84cbaa3f58304d292275f56e89353b61f151e9beb2bf9e740e46
4
+ data.tar.gz: 6ac71db1cf2089932e2381cb6c20d2b1fa0a82493bc00bafc307d4efbd2da048
5
5
  SHA512:
6
- metadata.gz: da03548ba5d54019f9a69b2aa6ca70042b4d27824d784996ebdd7109f8c54626609f007d099acffb8a0d09448d5fdd2ea49e491e729b2b075d2e142fd0b36dc7
7
- data.tar.gz: ba23f9b7be254784821b0bae59134bfa53a1cb2afa22e21576a054c718532f34753701d001d46f52871d770db0af4a6027705c22d28c18f658eb082b49172eeb
6
+ metadata.gz: aada5fa6d8a1034743af39bcc352b2e15120493c47c4f048006f6db3869c3f1eb8652e437ffb4bdf441b0280596f314bc06d436178c4bd82ea39e8e9dafcc5b8
7
+ data.tar.gz: db54ce603031240fe4e5081603042f804a9dd4566e6bd4e5d1b7124fd9f064748654552bb7297881cfc72915e959f26c7459777fd4cceddaee27aeb726aec798
data/.gitignore CHANGED
@@ -6,6 +6,7 @@ GTAGS
6
6
  .bundle
7
7
  .config
8
8
  .yardoc
9
+ .byebug_history
9
10
  Gemfile.lock
10
11
  InstalledFiles
11
12
  _site
data/Changes CHANGED
@@ -1,5 +1,98 @@
1
1
  Change history of write_xlsx rubygem.
2
2
 
3
+ 2021-02-12 v1.02.0
4
+
5
+ Added support for hyperlinks in worksheet images.
6
+
7
+ Increased allowable url length from 255 to 2079 characters, as allowed in
8
+ more recent versions of Excel.
9
+
10
+
11
+ 2021-02-08 v1.01.0
12
+
13
+ Added support for stacked and East Asian vertical chart fonts.
14
+
15
+ Added option to control positioning of charts or images when cells are
16
+ resized.
17
+
18
+ Added support for combining Pie/Doughnut charts.
19
+
20
+ Fixed sizing of cell comment boxes when they cross columns/rows that have
21
+ size changes that occur after the comment is written. Comments should
22
+ now behave like other worksheet objects such as images and charts.
23
+
24
+ Fix for structured reference in chart ranges.
25
+
26
+ 2021-01-23 v1.00.0
27
+
28
+ Fixed issue where images that started in hidden rows/columns weren't placed
29
+ correctly in the worksheet.
30
+
31
+
32
+ 2021-01-08 v0.99.0
33
+
34
+ Added font and font_size parameters to write_comment().
35
+
36
+ Allow formulas in date field of data_validation().
37
+
38
+ Added top_left chart legend position.
39
+
40
+ Added legend formatting options.
41
+
42
+ Added set_tab_ratio() method to set the ratio between the worksheet tabs
43
+ and the horizontal slider.
44
+
45
+ Added worksheet hide_row_col_headers() method to turn off worksheet row
46
+ and column headings.
47
+
48
+ Add functionality to align chart category axis labels.
49
+
50
+ Fix for issue with special characters in worksheet table functions.
51
+
52
+ Fix handling of 'num_format': '0' in duplicate formats.
53
+
54
+
55
+ 2021-01-03 v0.98.0
56
+
57
+ fixed for autofilter rule with blanks plus another filter.
58
+
59
+ 2021-01-02 v0.97.0
60
+
61
+ Added Excel 2010 data bar features such as solid fills and control over
62
+ the display of negative values.
63
+
64
+ Added default formatting for hyperlinks if none is specified. The format
65
+ is the Excel hyperlink style so links change colour after they are
66
+ clicked.
67
+
68
+ Fixed missing plotarea formatting in pie/doughnut charts.
69
+
70
+ 2020-12-31 v0.96.0
71
+
72
+ Added icon sets to conditional formatting.
73
+
74
+ 2020-12-30 v0.95.0
75
+
76
+ Added workbook set_size() method.
77
+
78
+ 2020-12-30 v0.94.0
79
+
80
+ Added font support to chart tables.
81
+
82
+ 2020-12-30 v0.93.0
83
+
84
+ Added trendline properties: intercept, display_equation and
85
+ display_r_squared.
86
+
87
+ 2020-12-30 v0.92.0
88
+
89
+ Fix for insert_image issue when handling images with zero dpi.
90
+
91
+ 2020-12-30 v0.91.0
92
+
93
+ Add set_custom_property() workbook method to set custom document
94
+ properties.
95
+
3
96
  2020-12-28 v0.90.0
4
97
 
5
98
  Added worksheet_by_name() workbook method to retrieve a worksheet
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2020 Hideo NAKAMURA
1
+ Copyright (c) 2012-2021 Hideo NAKAMURA
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  gem to create a new file in the Excel 2007+ XLSX format, and you can use the
7
7
  same interface as writeexcel gem. write_xlsx is converted from Perl's module
8
- [Excel::Writer::XLSX-0.90](https://github.com/jmcnamara/excel-writer-xlsx) .
8
+ [Excel::Writer::XLSX-1.02](https://github.com/jmcnamara/excel-writer-xlsx/tree/CPAN_1.02)
9
9
 
10
10
  ## Description
11
11
 
@@ -85,7 +85,7 @@ the first worksheet in an Excel XML spreadsheet called ruby.xlsx:
85
85
  Original Perl module was written by John McNamara(jmcnamara@cpan.org).
86
86
 
87
87
  Converted to ruby by Hideo NAKAMURA(nakamrua.hideo@gmail.com)
88
- Copyright (c) 2012-2020 Hideo NAKAMURA.
88
+ Copyright (c) 2012-2021 Hideo NAKAMURA.
89
89
 
90
90
  See LICENSE.txt for further details.
91
91
 
data/examples/a_simple.rb CHANGED
@@ -7,7 +7,7 @@
7
7
  # write text and numbers to an Excel xlsx file.
8
8
  #
9
9
  # reverse(c), March 2001, John McNamara, jmcnamara@cpan.org
10
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
11
11
  #
12
12
 
13
13
  require 'write_xlsx'
@@ -34,11 +34,6 @@
34
34
  worksheet.write(8, 0, '=IF(A5>3,"Yes", "No")')
35
35
 
36
36
  # Write a hyperlink
37
- hyperlink_format = workbook.add_format(
38
- :color => 'blue',
39
- :underline => 1
40
- )
41
-
42
- worksheet.write(10, 0, 'http://www.ruby-lang.org/', hyperlink_format)
37
+ worksheet.write(10, 0, 'http://www.ruby-lang.org/')
43
38
 
44
39
  workbook.close
@@ -10,7 +10,7 @@
10
10
  # used to extract the vbaProject.bin file.
11
11
  #
12
12
  # reverse('(c)'), November 2012, John McNamara, jmcnamara@cpan.org
13
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
13
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
14
14
  #
15
15
 
16
16
  require 'write_xlsx'
@@ -7,7 +7,7 @@
7
7
  # array formulas.
8
8
  #
9
9
  # reverse(c), August 2004, John McNamara, jmcnamara@cpan.org
10
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
11
11
  #
12
12
 
13
13
  require 'write_xlsx'
@@ -6,7 +6,7 @@
6
6
  # A demo of an Area chart in Excel::Writer::XLSX.
7
7
  #
8
8
  # reverse('ゥ'), March 2011, John McNamara, jmcnamara@cpan.org
9
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
9
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
10
10
  #
11
11
 
12
12
  require 'write_xlsx'
@@ -53,6 +53,9 @@
53
53
  chart.set_style(11)
54
54
 
55
55
  # Insert the chart into the worksheet (with an offset).
56
- worksheet.insert_chart('D2', chart, 25, 10)
56
+ worksheet.insert_chart(
57
+ 'D2', chart,
58
+ :x_offset => 25, :y_offset => 10
59
+ )
57
60
 
58
61
  workbook.close
@@ -6,7 +6,7 @@
6
6
  # A demo of an Bar chart in Excel::Writer::XLSX.
7
7
  #
8
8
  # reverse('c'), March 2011, John McNamara, jmcnamara@cpan.org
9
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
9
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
10
10
  #
11
11
 
12
12
  require 'write_xlsx'
@@ -53,6 +53,9 @@
53
53
  chart.set_style(11)
54
54
 
55
55
  # Insert the chart into the worksheet (with an offset).
56
- worksheet.insert_chart('D2', chart, 25, 10)
56
+ worksheet.insert_chart(
57
+ 'D2', chart,
58
+ :x_offset => 25, :y_offset => 10
59
+ )
57
60
 
58
61
  workbook.close
@@ -5,7 +5,7 @@
5
5
  # A demo of a clustered category chart in Excel::Writer::XLSX.
6
6
  #
7
7
  # reverse ('(c)'), March 2015, John McNamara, jmcnamara@cpan.org
8
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
8
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
9
9
  #
10
10
 
11
11
  require 'write_xlsx'
@@ -6,7 +6,7 @@
6
6
  # A demo of an Area chart in Excel::Writer::XLSX.
7
7
  #
8
8
  # reverse('ゥ'), March 2011, John McNamara, jmcnamara@cpan.org
9
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
9
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
10
10
  #
11
11
 
12
12
  require 'write_xlsx'
@@ -53,6 +53,9 @@
53
53
  chart.set_style(11)
54
54
 
55
55
  # Insert the chart into the worksheet (with an offset).
56
- worksheet.insert_chart('D2', chart, 25, 10)
56
+ worksheet.insert_chart(
57
+ 'D2', chart,
58
+ :x_offset => 25, :y_offset => 10
59
+ )
57
60
 
58
61
  workbook.close
@@ -6,7 +6,7 @@
6
6
  # An example of a Combined chart in WriteXLSX.
7
7
  #
8
8
  # reverse ('(c)'), March 2015, John McNamara, jmcnamara@cpan.org
9
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
9
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
10
10
  #
11
11
 
12
12
  require 'write_xlsx'
@@ -7,7 +7,7 @@
7
7
  # WriteXLSX.
8
8
  #
9
9
  # reverse ('(c)'), December 2012, John McNamara, jmcnamara@cpan.org
10
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
10
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
11
11
  #
12
12
 
13
13
  require 'write_xlsx'
@@ -54,7 +54,10 @@
54
54
  chart1.set_table
55
55
 
56
56
  # Insert the chart into the worksheet (with an offset).
57
- worksheet.insert_chart('D2', chart1, 25, 10)
57
+ worksheet.insert_chart(
58
+ 'D2', chart1,
59
+ :x_offset => 25, :y_offset => 10
60
+ )
58
61
 
59
62
  #
60
63
  # Create a second charat.
@@ -88,6 +91,9 @@
88
91
  chart2.set_legend(:position => 'none')
89
92
 
90
93
  # Insert the chart into the worksheet (with an offset).
91
- worksheet.insert_chart('D18', chart2, 25, 11)
94
+ worksheet.insert_chart(
95
+ 'D18', chart2,
96
+ :x_offset => 25, :y_offset => 11
97
+ )
92
98
 
93
99
  workbook.close
@@ -10,7 +10,7 @@
10
10
  # High-Low Lines and Up-Down Bars.
11
11
  #
12
12
  # reverse ('(c)'), December 2012, John McNamara, jmcnamara@cpan.org
13
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
13
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
14
14
  #
15
15
 
16
16
  require 'write_xlsx'
@@ -62,7 +62,10 @@
62
62
  chart1.set_title(:name => 'Chart with Trendlines')
63
63
 
64
64
  # Insert the chart into the worksheet (with an offset).
65
- worksheet.insert_chart('D2', chart1, 25, 10)
65
+ worksheet.insert_chart(
66
+ 'D2', chart1,
67
+ :x_offset => 25, :y_offset => 10
68
+ )
66
69
 
67
70
 
68
71
  #######################################################################
@@ -91,7 +94,10 @@
91
94
  chart2.set_title(:name => 'Chart with Data Labels and Markers')
92
95
 
93
96
  # Insert the chart into the worksheet (with an offset).
94
- worksheet.insert_chart('D18', chart2, 25, 10)
97
+ worksheet.insert_chart(
98
+ 'D18', chart2,
99
+ :x_offset => 25, :y_offset => 10
100
+ )
95
101
 
96
102
 
97
103
  #######################################################################
@@ -119,7 +125,10 @@
119
125
  chart3.set_title(:name => 'Chart with Error Bars')
120
126
 
121
127
  # Insert the chart into the worksheet (with an offset).
122
- worksheet.insert_chart('D34', chart3, 25, 10)
128
+ worksheet.insert_chart(
129
+ 'D34', chart3,
130
+ :x_offset => 25, :y_offset => 10
131
+ )
123
132
 
124
133
 
125
134
  #######################################################################
@@ -149,7 +158,10 @@
149
158
  chart4.set_title(:name => 'Chart with Up-Down Bars')
150
159
 
151
160
  # Insert the chart into the worksheet (with an offset).
152
- worksheet.insert_chart('D50', chart4, 25, 10)
161
+ worksheet.insert_chart(
162
+ 'D50', chart4,
163
+ :x_offset => 25, :y_offset => 10
164
+ )
153
165
 
154
166
 
155
167
  #######################################################################
@@ -179,7 +191,10 @@
179
191
  chart5.set_title(:name => 'Chart with High-Low Lines')
180
192
 
181
193
  # Insert the chart into the worksheet (with an offset).
182
- worksheet.insert_chart('D66', chart5, 25, 10)
194
+ worksheet.insert_chart(
195
+ 'D66', chart5,
196
+ :x_offset => 25, :y_offset => 10
197
+ )
183
198
 
184
199
 
185
200
  #######################################################################
@@ -209,6 +224,9 @@
209
224
  chart6.set_title(:name => 'Chart with Drop Lines')
210
225
 
211
226
  # Insert the chart into the worksheet (with an offset).
212
- worksheet.insert_chart('D82', chart6, 25, 10)
227
+ worksheet.insert_chart(
228
+ 'D82', chart6,
229
+ :x_offset => 25, :y_offset => 10
230
+ )
213
231
 
214
232
  workbook.close
@@ -12,7 +12,7 @@
12
12
  # formatting to each point in the series.
13
13
  #
14
14
  # reverse ('(c)'), March 2011, John McNamara, jmcnamara@cpan.org
15
- # convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
15
+ # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
16
16
  #
17
17
 
18
18
  require 'write_xlsx'
@@ -50,7 +50,10 @@
50
50
  chart1.set_style(10)
51
51
 
52
52
  # Insert the chart into the worksheet (with an offset).
53
- worksheet.insert_chart('C2', chart1, 25, 10)
53
+ worksheet.insert_chart(
54
+ 'C2', chart1,
55
+ :x_offset => 25, :y_offset => 10
56
+ )
54
57
 
55
58
 
56
59
  #
@@ -77,7 +80,10 @@
77
80
 
78
81
 
79
82
  # Insert the chart into the worksheet (with an offset).
80
- worksheet.insert_chart('C18', chart2, 25, 10)
83
+ worksheet.insert_chart(
84
+ 'C18', chart2,
85
+ :x_offset => 25, :y_offset => 10
86
+ )
81
87
 
82
88
 
83
89
  #
@@ -101,7 +107,10 @@
101
107
  chart3.set_rotation(90)
102
108
 
103
109
  # Insert the chart into the worksheet (with an offset).
104
- worksheet.insert_chart('C34', chart3, 25, 10)
110
+ worksheet.insert_chart(
111
+ 'C34', chart3,
112
+ :x_offset => 25, :y_offset => 10
113
+ )
105
114
 
106
115
 
107
116
  #
@@ -125,6 +134,9 @@
125
134
  chart4.set_hole_size(33)
126
135
 
127
136
  # Insert the chart into the worksheet (with an offset).
128
- worksheet.insert_chart('C50', chart4, 25, 10)
137
+ worksheet.insert_chart(
138
+ 'C50', chart4,
139
+ :x_offset => 25, :y_offset => 10
140
+ )
129
141
 
130
142
  workbook.close
@@ -0,0 +1,73 @@
1
+ # #!/usr/bin/env ruby
2
+
3
+ # #######################################################################
4
+ # #
5
+ # # A demo of an Gauge Chart in WriteXLSX gem.
6
+ # #
7
+ # # A Gauge Chart isn't a native chart type in Excel. It is constructed by
8
+ # # combining a doughnut chart and a pie chart and by using some non-filled
9
+ # # elements. This example follows the following online example of how to create
10
+ # # a Gauge Chart in Excel: https://www.excel-easy.com/examples/gauge-chart.html
11
+ # #
12
+ # # reverse ('(c)'), May 2019, John McNamara, jmcnamara@cpan.org
13
+ # # convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
14
+ # #
15
+
16
+ require 'write_xlsx'
17
+
18
+ workbook = WriteXLSX.new('chart_gauge.xlsx')
19
+ worksheet = workbook.add_worksheet
20
+
21
+ chart_doughnut = workbook.add_chart(:type => 'doughnut', :embedded => 1)
22
+ chart_pie = workbook.add_chart(:type => 'pie', :embedded => 1)
23
+
24
+ # Add some data for the Doughnut and Pie charts. This is set up so the
25
+ # gauge goes from 0-100. It is initially set at 75%.
26
+ worksheet.write_col('H2', ['Donut', 25, 50, 25, 100])
27
+ worksheet.write_col('I2', ['Pie', 75, 1, '=200-I4-I3'])
28
+
29
+ # Configure the doughnut chart as the background for the gauge.
30
+ chart_doughnut.add_series(
31
+ :name => '=Sheet1!$H$2',
32
+ :values => '=Sheet1!$H$3:$H$6',
33
+ :points => [
34
+ { :fill => { :color => 'green' } },
35
+ { :fill => { :color => 'yellow' } },
36
+ { :fill => { :color => 'red' } },
37
+ { :fill => { :none => 1 } }
38
+ ]
39
+ )
40
+
41
+ # Rotate chart so the gauge parts are above the horizontal.
42
+ chart_doughnut.set_rotation(270)
43
+
44
+ # Turn off the chart legend.
45
+ chart_doughnut.set_legend(:none => 1)
46
+
47
+ # Turn off the chart fill and border.
48
+ chart_doughnut.set_chartarea(
49
+ :border => { :none => 1 },
50
+ :fill => { :none => 1 }
51
+ )
52
+
53
+ # Configure the pie chart as the needle for the gauge.
54
+ chart_pie.add_series(
55
+ :name => '=Sheet1!$I$2',
56
+ :values => '=Sheet1!$I$3:$I$6',
57
+ :points => [
58
+ { :fill => { :none => 1 } },
59
+ { :fill => { :color => 'black' } },
60
+ { :fill => { :none => 1 } }
61
+ ]
62
+ )
63
+
64
+ # Rotate the pie chart/needle to align with the doughnut/gauge.
65
+ chart_pie.set_rotation(270)
66
+
67
+ # Combine the pie and doughnut charts.
68
+ chart_doughnut.combine(chart_pie)
69
+
70
+ # Insert the chart into the worksheet.
71
+ worksheet.insert_chart('A1', chart_doughnut)
72
+
73
+ workbook.close