In bar chart when all data are negative (minus values) it's better to place X axis labels above this (labels outside the plotting area). But Writer can't write this setting in XML chart when saving to DOCX. This result of return of the axis labels back to plotting area (below the X axis) after reloading the document. 1) Data: A1: A A2: -10 2) Make bar chart 3) Set labels outside (A category) 4) Select X Axis -> Format Axis -> Positioning -> Labels -> Place labels: Near axis (other side) 5) Paste chart to Writer 6) Save as DOCX 7) Reload Result: X Axis latels are inside ploting area (under the X axis). Expected: Labels above X axis. Writer can't save 'high' and puts 'nextTo'd parameter in: <c:chart> <c:plotArea> <c:catAx> <c:tickLblPos val="nextTo"/>
Created attachment 202187 [details] DOCX chart label position above X axis is not saved Version: 25.2.4.3 (X86_64) / LibreOffice Community Build ID: 33e196637044ead23f5c3226cde09b47731f7e27 CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 26100); UI render: Skia/Raster; VCL: win Locale: pl-PL (pl_PL); UI: en-US Calc: CL threaded
Created attachment 202188 [details] Example spreadsheet
Created attachment 202189 [details] Resulting DOCX
Created attachment 202190 [details] *.DOCX/word/charts/chart1.xml Word and Writer comparison (Visual Studio) Comparison of DOCX documents saved by Word and Writer. LEFT chart from Excel pasted to Word RIGHT chart form Calc pasted to Writer
Created attachment 202191 [details] WinMerge: search 'high' in chart1.xml
Created attachment 202192 [details] WinMerge: search 'nextTo' in chart1.xml LEFT docx saved in Word RIGHT docx saved in Writer
QA:needsComment Additional findings / clarification ODS works as expected. The issue seems to be DOCX (OOXML chart) export mapping: when saving as DOCX, LibreOffice writes in *.DOCX\word\charts\chart1.xml <c:tickLblPos val="nextTo"/> for the category axis, while MS Word/Excel write <c:tickLblPos val="high"/> for the same “Near axis (other side)” placement. After reopening the DOCX in LO, labels are restored according to the exported OOXML (nextTo), which places them inside/overlapping the plotting area. This is likely in the OOXML export filter (see [1,5]): the ODF attribute axis-label-position="near-axis-other-side" from *.ODS\Object1\content.xml should map to tickLblPos=high — at least for this case where axis-position="0" and all data values are negative. ----------TL;DR---------- ODS\Object1\content.xml -----> axis-label-position="near-axis-other-side" [3] LO: DOCX\word\charts\chart1.xml -> c:tickLblPos val="nextTo" [2] MSO: DOCX\word\charts\chart1.xml -> c:tickLblPos val="high" [2] LO exports: "nextTo" <-- which is actual [2] MSO export: "high" <-- which is expected [2,4] ------------------------- [1] https://opengrok.libreoffice.org/xref/core/oox/source/export/chartexport.cxx [2] As can be seen in attachment 202190 [details] that compares file: word/charts/chart1.xml Word vs Writer [3] Example spreadsheet from the attachment 202188 [details] (tdf#167821 Label.ods). [4] https://c-rex.net/samples/ooxml/e1/part4/OOXML_P4_DOCX_ST_TickLblPos_topic_ID0EEA2RB.html [5] https://opengrok.libreoffice.org/xref/core/oox/source/export/chartexport.cxx?r=1fa4d0e6c95bddecbcc63bc6622187a8be2ee48d#4399
(In reply to Piotr Osada from comment #7) > QA:needsComment Another TL;DR DOCX export: chartexport.cxx maps <c:tickLblPos val="nextTo"/> instead of "high", so X-axis labels end up inside the plot area.