Bug 426440 - Add background color for (tick-,title-,text-) labels
Summary: Add background color for (tick-,title-,text-) labels
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: frontend (show other bugs)
Version: latest
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-12 12:20 UTC by Orestes Mas
Modified: 2020-10-02 06:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.8.1


Attachments
Observed result (22.30 KB, image/png)
2020-09-12 12:20 UTC, Orestes Mas
Details
Image showing a minor bug (34.10 KB, image/png)
2020-10-01 21:38 UTC, Orestes Mas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Orestes Mas 2020-09-12 12:20:25 UTC
Created attachment 131573 [details]
Observed result

SUMMARY

At present most (all?) text labels have transparent background. This can be inconvenient in certain situations. For instance, grid lines can affect tick label readability when axis are centered (see attached picture)

This could be avoided if label background could be set to some color (instead of being transparent). Also, drawing order of these elements should be settable for optimum control, but drawing labels on top (with background color) should suffice in many cases.


STEPS TO REPRODUCE
1. Create a worksheet with an x-y plot
2. Set axis position to "centered". Enable some grid lines and tick labels. With suitable settings, grid lines will pass over labels, affecting their readability

OBSERVED RESULT
See attachment

EXPECTED RESULT
Labels text drawn on top (or with selectable drawing order), with selectable background color.

SOFTWARE/OS VERSIONS
Linux: 4.19.0-10-amd64
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.3
Comment 1 Alexander Semke 2020-10-01 07:24:37 UTC
It is possible now to select between "transparent" and "color" for the background of axis labels. If "color" is selected, the user can specify the color to be used, on default the background color of the plot area is used and you get the desired effect. We'll ship this in the next patch release 2.8.1 soon. You can also try the current master if it's possible for you and provide a feedback. Thanks for reporting this!
Comment 2 Orestes Mas 2020-10-01 21:38:30 UTC
Created attachment 132060 [details]
Image showing a minor bug
Comment 3 Orestes Mas 2020-10-01 21:48:36 UTC
I tested the current master branch. Great! Being able to set the backgroud color greatly improves readability in most situations.

However, a minor glitch persist: labels are drawn on top of grid, which is normally desirable, but main axes are sill drawn after labels, on top of them. See the "0,0" tick label in the second attachment.
Comment 4 Alexander Semke 2020-10-02 06:28:04 UTC
(In reply to Orestes Mas from comment #3)
> I tested the current master branch. Great! Being able to set the backgroud
> color greatly improves readability in most situations.
Thanks for the validation!

> However, a minor glitch persist: labels are drawn on top of grid, which is
> normally desirable, but main axes are sill drawn after labels, on top of
> them. See the "0,0" tick label in the second attachment.
Unfortunately there is no easy solution for this problem now... The axes are plotted on top of everything else and they are plotted one after another. In this example the y-axis is plotted after the x-axis. Since the axis labels belong internally to the axis object and are drawn together with the line, the line of the y-axis overrides the labels of the x-axis. To solve this we'd need to separate the drawing of the labels from the drawing of the lines and to draw the labels on top of the lines. This is a somewhat bigger task... I've added it to our TODO-list.