Opened 8 years ago

Closed 8 years ago

#4428 closed enhancement (duplicate)

Plot legend size often too large

Reported by: massimo ceraolo Owned by: Adeel Asghar
Priority: high Milestone: 1.12.0
Component: OMEdit Version:
Keywords: Cc:

Description (last modified by massimo 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 massimo ceraolo 8 years ago.
Export.png (5.1 KB ) - added by Adeel Asghar 8 years ago.

Download all attachments as: .zip

Change History (14)

by massimo ceraolo, 8 years ago

Attachment: small.png added

comment:1 by massimo ceraolo, 8 years ago

Summary: PPlor legend size often too largePlot legend size often too large

comment:2 by massimo ceraolo, 8 years ago

Description: modified (diff)

comment:3 by Adeel Asghar, 8 years ago

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 by massimo ceraolo, 8 years ago

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

comment:5 by massimo ceraolo, 8 years ago

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 by Adeel Asghar, 8 years ago

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

in reply to:  3 comment:7 by massimo ceraolo, 8 years ago

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 by Christoph Buchner <buchner@…>, 8 years ago

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 by Adeel Asghar, 8 years ago

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.

by Adeel Asghar, 8 years ago

Attachment: Export.png added

comment:10 by Adeel Asghar, 8 years ago

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 by massimo ceraolo, 8 years ago

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 8 years ago by massimo ceraolo (previous) (diff)

comment:12 by massimo ceraolo, 8 years ago

Resolution: duplicate
Status: newclosed

Part of #4437

Note: See TracTickets for help on using tickets.