Opened 7 years ago

Closed 7 years ago

#4428 closed enhancement (duplicate)

Plot legend size often too large

Reported by: ceraolo Owned by: adeas31
Priority: high Milestone: 1.12.0
Component: OMEdit Version:
Keywords: Cc:

Description (last modified by ceraolo)

I remember that I've already created a ticket on this a few years ago, but i cannot find it anymore.
Sorry for possible duplication.
In the effort of make the best usage of our valuable desktop space, I propose to reconsider the legend layout.
See the enclosed picture: the plot is sacrificed to a huge legend. I propose the line spacing (so the vertical space legend occupation), when two rows are needed, to be reduced to a minimum.
Aldo the space above the first row could be slightly reduced: compare with the smaller space below "time (s)".

Attachments (2)

small.png (4.7 KB) - added by ceraolo 7 years ago.
Export.png (5.1 KB) - added by adeas31 7 years ago.

Download all attachments as: .zip

Change History (14)

Changed 7 years ago by ceraolo

comment:1 Changed 7 years ago by ceraolo

  • Summary changed from PPlor legend size often too large to Plot legend size often too large

comment:2 Changed 7 years ago by ceraolo

  • Description modified (diff)

comment:3 follow-up: Changed 7 years ago by adeas31

The old ticket is #3194 (see point 1).

I already mentioned in #3194 that this is not possible.
Unfortunately the 3rd party tool (qwt) we are using for plotting doesn't allow this. I looked again into the code and they have written some algorithm which finds the width and height for items and call resize on the layout.

However, I found that when I set a legend, I can also set a ratio for it. Its a ratio between legend and plot. I set the ratio to 0.1 (the minimum possible value) in e2f605d/OMPlot. With 0.1 ratio you will see one line of legend items and if the legend items spread over multiple lines then a scroll bar is shown instead of giving more height to the legend.

I am not sure if this is a good solution. So I keep this ticket open. You can test the new functionality and then we will see if we keep it or not.

comment:4 Changed 7 years ago by ceraolo

Thank you for your effort.
I will test the change and get back to this ticket.

comment:5 Changed 7 years ago by ceraolo

BTW, the win nightly builds seem not to be updated since 14th of May. Do you have an idea about when the change related to this ticket will be available?

comment:6 Changed 7 years ago by adeas31

I have fixed the builds. Hopefully a new one is available in couple of hours.

comment:7 in reply to: ↑ 3 Changed 7 years ago by ceraolo

I am not sure if this is a good solution. So I keep this ticket open. You can test the new functionality and then we will see if we keep it or not.

Difficult to say. We have reduced the legend size in cases in which more rows are needed but:

  • the scrollbar is there also when there is single variable. It is unnecessary, slightly confusing and, even worse, when clocked moves slightly the legend up and down which is no use
  • when we have more than one row, each click on the scrollbar does not scroll by one row of text, but a bunch of pixels instead, so the user has to adjust manually the position of the legend.

Maybe modifying the code so that the scrollbar appears only when there is no room for a single-row legend, would result in a better solution than the standard OM 1.12.alpha's.

Just a more general comment.
This is another element that shows the poor graphical quality of qwt plots. Do you think it is a good idea to test QChart as a replacement? I've no tried it yet, but the fact that it is included in the standard Qt libraries seems to be a good starting point.
I will open, today or tomorrow, a specific ticket on the graphical characteristics of OMEdit plots that make me to question about their quality. I mean, they do their job, but they could do it much better.
Some of the items I will include there have already been discussed in tickets, and resulted to be a consequence of the usage of Qwt.

comment:8 Changed 7 years ago by Christoph Buchner <buchner@…>

Is the existence of the scrollbar handled gracefully when exporting the plot to an image file, where you obviously can't scroll? Sorry, I can't test this personally right now.

comment:9 Changed 7 years ago by adeas31

It seems that the reduced legend size with scrollbars is more worse. Indeed the export to an image file looks rather bad (see attachment).

It is not possible to modify the code for the scrollbars since they are not easily accessible. There are some tricks to hack the code but I don't think its worth to try it for such a minor cosmetic issue. IMHO we should revert this change. Size is not an issue with today's latest 4k monitors.

Changed 7 years ago by adeas31

comment:10 Changed 7 years ago by adeas31

QtCharts looks promising. But we have to wait for it. We are currently using Qt 5.6.0 and QtCharts seems to be available with 5.9.

comment:11 Changed 7 years ago by ceraolo

Since Qt developpers labelled rel 5.9 "LTS", maybe the planned switch to 5.7 could be modified into jumping directly to 5.9?

Last edited 7 years ago by ceraolo (previous) (diff)

comment:12 Changed 7 years ago by ceraolo

  • Resolution set to duplicate
  • Status changed from new to closed

Part of #4437

Note: See TracTickets for help on using tickets.