Bug 135366 - implementation errors for border of data labels in charts
Summary: implementation errors for border of data labels in charts
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-01 16:49 UTC by Regina Henschel
Modified: 2020-10-14 17:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Reproduce problems with dash of data label borders (14.76 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-01 16:49 UTC, Regina Henschel
Details
Data label solution made by Excel (7.81 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-01 23:20 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2020-08-01 16:49:42 UTC
Created attachment 163846 [details]
Reproduce problems with dash of data label borders

Open attached document. It contains a chart. The data labels and the legend have a thick yellow border. That makes the problem better visible.

Activate the chart.
Select the legend and set the line style to "Dot" on tab "Border" of its properties. That works as intended.
Select the data labels and set the line style to "Dash" on tab "Border" of its properties. The line style is not correctly applied.
For to see all problems use different styles for legend and data labels.

Save the document with a new name. Unzip this document. Open folder "Object 1", which contains the chart. Open file "content.xml". Open tree office:automatic-styles.

Find style with style name "ch2". That belongs to the legend. You will find in the element stype:graphic-properties the attributes
    draw:stroke="dash"      That says, that it is not solid.
    draw:stroke-dash="Dot"  The name of the dash-definition.
    svg:stroke-width="0.2cm"    The width of the border
    svg:stroke-color="#ffff00"   The color of the border

Now open the style which belongs to the data labels. It should be "ch7", if you have styled all data labels and not only a single one.
Open element style:chart-properties. You will find attributes
    loext:label-stroke-color
    loext:label-stroke
    loext:label-stroke-width
They shouldn't exists. Border properties are graphic properties, not chart properties.
Open element style:graphic-properties. You will find attribute
    draw:stroke="none"     That is false, value should be "dash"
Notice, that there is no reference to the dash-definition.

Open file styles-xml and look for the dash definitions. There is only one draw:stroke-dash element, and that has draw:name="Dot". It belongs to the legend. The definition for the style "Dash" of the data label border is missing.
Comment 1 Regina Henschel 2020-08-01 23:20:22 UTC
Created attachment 163866 [details]
Data label solution made by Excel

The attached file was generated with Excel 365. It shows, how data labels are styled using existing ODF elements. The essential part is, that ODF provides an element <chart:data-label>, which can be used as child of a <chart:series> element to define a default or as child of a <chart:data-point> element to style the data label of that point.

This <chart:data-label> element has an attribute which refers a style. In that style the usual attributes draw:stroke and others can be used. There is no need for the private namespace 'loext' at all.


> Open element style:graphic-properties. You will find attribute
>     draw:stroke="none"     That is false, value should be "dash"
Here I was wrong. It is correct, because it is the style of the circle sector, not of the label.
Comment 2 Regina Henschel 2020-08-01 23:23:31 UTC
The feature was implemented by Kohei Yoshida, 2014-07-26

https://cgit.freedesktop.org/libreoffice/core/commit/?id=f1531cdaaebe706d909dc6ddde439ccb5f4ad36d
bnc#885825: Support borders around data labels

https://cgit.freedesktop.org/libreoffice/core/commit/?id=48f31a924280a418046f0c816f8a7d20b672dac6
bnc#885825: OOXML import and export of data label borders.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=6c2c974dd3f0b21a23bc3bc5560487d28bbe0fad
bnc#885825: Handle ODF import and export of data label border properties.
Comment 3 Regina Henschel 2020-08-13 23:05:10 UTC
If you drag a data label to a different place and save and reload the document, then the data label looses the position. That too is the implication of the missing element chart:data-label. This element has the attributes svg:x and svg:y to store such position information.
Comment 4 Regina Henschel 2020-08-28 16:12:56 UTC
I had a discussion with Miklos on the dev-list. The result was to keep the internal way to hold the border related information on the series or point respectively, and do not change the internal model by introducing a dedicated service corresponding to the <chart:data-label> element.

I'm currently working on implementing the import of ODF-documents, which use <chart:data-label>, in a way, that the associated style is transformed to properties of the series or point, respectively.

I have no idea yet how to transform svg:x and svg:y to the internal model.

... and the export to ODF so that <chart:data-label> elements are used, is missing too.
Comment 5 Commit Notification 2020-09-05 15:50:01 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/87d1ebeb11a00301745ee3c3c03fffb7033ab59d

tdf#135366 ODF import of line and fill of data labels

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Regina Henschel 2020-09-10 12:48:34 UTC
I'm still working on it.
Intermediate step for export is at
https://gerrit.libreoffice.org/c/core/+/102381
Comment 7 Commit Notification 2020-09-19 12:28:24 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6d7a72ab1c044f7e1f30f7c4133dafdb214dfcbf

tdf#135366 Save line and fill of data labels to ODF

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Regina Henschel 2020-09-19 13:46:56 UTC
Solid border line and solid fill can now be saved and load in ODF strict too. That means, that save and load do not need extended namespace. The loext attributes are still written in extended mode to allow LO versions before 7.1 to read the information.

The bug is an example of a bad bugreport :(, my fault. It addresses several unrelated problems. I will take this bug for the problem of not needed loext namespace. All other problems will be tracked in new bugs.
Comment 9 BogdanB 2020-10-14 17:54:09 UTC
Dash line for data labels working.

Verified in
Version: 7.1.0.0.alpha0+
Build ID: f21f3d094cfb495c89dfb0a23ecb061ef1a2178e
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded