[英]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.