'XlsxWriter - Line with Gradient Fill
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!
Solution 1:[1]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
