python - xlsxwriter 条件格式数据栏选项不起作用
问题描述
我正在尝试使用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,数据栏就可以工作了!
推荐阅读
- html - Javaservlet 连接
- python - 使用指定索引重塑数组
- amazon-web-services - 为什么我的事件桥规则不执行我的 Lambda 函数?
- load-balancing - 防止单个客户过载的内容负载均衡器
- msbuild - Sonarqube MSBuild TFVC Token 没有权限
- flutter - 我想让 https:// 自动附加到链接
- r - 我想有人帮我解决这个错误
- reactjs - 多次使用 useEffect 反应调用函数
- php - 无法使用 Big Sur 在 Mac 上完成 AMPPS 的安装
- xml - 有没有办法将字符串转换为 XML 标签或搜索 xml 文档?