[Python] How to create a multi-line chart title with different colors per line in openpyxl

Discussão em 'Python' iniciado por Stack, Junho 2, 2025.

  1. Stack

    Stack Membro Participativo

    I'm writing a program that takes in an excel file, distributes the data between multiple DataFrames and then creates a final excel with tables and bar charts. I have the entire thing working as expected except I cant figure out how to create a multiline chart title.

    For example I have a title such as "Room: XXX, Sample Type: XXX, Grid: XXX" and beneath it I am trying to add "Acceptance Criteria: XXX". I can get the chart title in easily with chart.title but I can not figure out how to use CharacterProperties to change the appearance of each line.

    Any help or direction would be greatly appreciated.

    Thanks

    I have no code working for this part other than chart.title = chart_title + "\n" + subtitle which does give me two lines for the title. I tried AI and have a function generated by Gemini I can share but everything its been generating has not worked at all.

    Continue reading...

Compartilhe esta Página