> from openpyxl.chart.text import RichText
> from openpyxl.drawing.text import RichTextProperties, Paragraph,
> ParagraphProperties, CharacterProperties
>
> chart1.x_axis.txPr = RichText(
> bodyPr=RichTextProperties(),
> p=[Paragraph(
> pPr=ParagraphProperties(
> defRPr=CharacterProperties(sz=1200, b=True)),
> endParaRPr=CharacterProperties()
> )]
> )
>
> This results in a file that Excel won't open because "Excel could not
> open
> bar.xlsx because some content is unreadable. Do you want to open and
> repair
> this workbook?" If you repair the file it removes the chart. I've been
> able
> to successfully manipulate the graphicalProperties for the x_axis objects
> (fill, outline, etc.). Not having luck anywhere when trying to format
> rich
> text. Any help would be appreciated. Thanks.
First of all I'll take my hat off to you for delving so deep into this!
When I was working on Charts I decided to stop once all the basic
functionality was available. I think the problem you've run into is that
one of the objects should be a sequence but is currently configured to
take only one item. I think this would be apparent if you compared the
source of the Excel file with that created by openpyxl. Hopefully this
would be fairly easy and painless to fix and involve in changing the
relevant descriptor. PR including docs welcome!
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel:
+49-211-600-3657
Mobile:
+49-178-782-6226