[Python] Set transparency (alpha) of area chart openpyxl

Discussão em 'Python' iniciado por Stack, Julho 14, 2025.

  1. Stack

    Stack Membro Participativo

    I want to set transparency to the background of an area chart using openpyxl. The code I have for the chart is:

    from openpyxl.drawing.fill import PatternFillProperties, ColorChoice

    c2 = AreaChart()
    c2.grouping = 'stacked'
    c2.add_data(data, titles_from_data=True)

    c2_s1 = c2.series[0]
    fill = PatternFillProperties()
    fill.background = ColorChoice(srgbClr="FFFFFF")

    c2_s2.graphicalProperties.pattFill = fill


    I have tried using rgba hexadecimal encoding.

    fill.background = ColorChoice(srgbClr="80FFFFFF")


    I have also try to use SystemColor but I could not find any example of how to use it and every attempt I made was unsuccessful

    Continue reading...

Compartilhe esta Página