[英]xlsxwriter conditional format data bars options not working
我正在嘗試使用xlsxwriter
輸出具有條件格式數據條的表。 出於某種原因,這似乎只有在我指定沒有可選參數的代碼或僅使用顏色更改參數時才有效。 其他參數都不起作用('data_bars_2010', 'bar_direction', 'bar_negative_color_same')
。
使用條件格式的文檔說您需要 excel 2010 或更高版本,而我目前使用的是 2013 版本。 也許這與我的xlsxwriter
版本不是最新版本有關。
在代碼方面:這個基本示例有效:
worksheet8.conditional_format('B3:B14', {'type': 'data_bar'})
worksheet8.conditional_format('F3:F14', {'type': 'data_bar',
'bar_color': '#63C384'})
但是這些更風格化的選項不起作用,導致根本不顯示條。
worksheet8.conditional_format('J3:J14', {'type': 'data_bar',
'bar_direction': 'right'})
worksheet8.conditional_format('L3:L14', {'type': 'data_bar',
'data_bar_2010': True})
worksheet8.conditional_format('M3:N14', {'type': 'data_bar',
'bar_negative_color_same': True,
'bar_negative_border_color_same': True})
你完全正確。 一旦我更新到 xlsxwriter 1.3.3,數據條就起作用了!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.