XLSXWRITER-与渐变填充线排队

发布于 2025-01-20 09:17:42 字数 612 浏览 4 评论 0原文

我正在尝试使用XLSXWriter库绘制光谱。

为此,我想用梯度为界线着色。不幸的是,这对我不起作用,该行停留在默认的颜色中。

这是我尝试过的代码:

    spectrumplot.add_series({
        'categories': '=Spektrum!$B$1:$CD$1',
        'values': '=Spektrum!$B$2:$CD$2',
        'gradient': {
            'colors': ['#B000AE', '#FF00FC', '#0000FF', '#00FFFF', '#00FF00', '#FFFF00', '#FFA200', '#FF0000', '#000000'],
            'positions': [0,        5,         17,       26,         37,         50,         56,         76,       100],
            'angle': 0.001}
    })

使用spectrumplot.set_plotarea()为背景作品着色,但我想为行本身上色。

有人有想法吗?多谢!

I am trying to plot the light spectrum with the XlsxWriter library.

For this I would like to color the line with a gradient. Unfortunately this does not work for me, the line stays in the default color.

This is the code I tried:

    spectrumplot.add_series({
        'categories': '=Spektrum!$B$1:$CD$1',
        'values': '=Spektrum!$B$2:$CD$2',
        'gradient': {
            'colors': ['#B000AE', '#FF00FC', '#0000FF', '#00FFFF', '#00FF00', '#FFFF00', '#FFA200', '#FF0000', '#000000'],
            'positions': [0,        5,         17,       26,         37,         50,         56,         76,       100],
            'angle': 0.001}
    })

Using spectrumplot.set_plotarea() to color the background works, but I would like to color the line itself.

Does anyone have any ideas? Thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撑一把青伞 2025-01-27 09:17:42

目前 XlsxWriter 图表中的线条不支持渐变填充,尽管许多其他图表元素支持渐变填充。如果您在 GitHub 上打开功能请求,我可以将其添加到积压工作中。

更新:功能请求:https://github.com/jmcnamara/XlsxWriter/issues/868

Currently gradient fill isn't supported for lines in XlsxWriter charts although it is supported for many other chart elements. If you open a feature request on GitHub I can add it to the backlog.

Update: Feature request: https://github.com/jmcnamara/XlsxWriter/issues/868

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文