Small Improvements for LegendItem#64
Small Improvements for LegendItem#64CPrescher wants to merge 1 commit intopyqtgraph:developfrom CPrescher:develop
Conversation
Added 3 new parameters LegendItem: horSpacing: Specifies the spacing between the line symbol and the label. verSpacing: Specifies the spacing between individual entries of the legend vertically. (Can also be negative to have them really close) box: Specifies if the Legend should will be drawn with a rectangle around it. This made it possible to change the resize behavior by just using layout.setVerticalSpacing and layout.setVerticalSpacing. Changed the removeItem function to accept either name or the originally added Item. I found the latter more useful, especially if several items happen to have the same name. Changed the rows in which addItem inserts a new item. Now the number increases all the time. This was needed because there where some overwriting issues when using several times removeItem and addItem on the same legend (in random order). The GraphicsGridLayout does not care about empty rows, so this seems to work best.
|
Hello, I'm a master student in Japan. In this PR, Also, I think the options used in Regards, |
|
I just had a look at this and really like the new parameters
Finally, I would suggest new parameters What do you think? I have incorporated in some of this PR here. If there is sufficient interest, I can submit a new pull request from that branch. |
|
@CPrescher thanks for this PR, sorry it's taken us so long to properly follow up. I'm going to close this as #958 took components of this PR and added more on top of it, but still wanted to thank you for your contribution! |
Logging cleanup
Added 3 new parameters LegendItem:
horSpacing: Specifies the spacing between the line symbol and the label.
verSpacing: Specifies the spacing between individual entries of the
legend vertically. (Can also be negative to have them really close)
box: Specifies if the Legend should will be drawn with a rectangle
around it.
This made it possible to change the resize behavior by just using
layout.setVerticalSpacing and layout.setVerticalSpacing.
Changed the removeItem function to accept either name or the originally
added Item. I found the latter more useful, especially if several items
happen to have the same name.
Changed the rows in which addItem inserts a new item. Now the number
increases all the time. This was needed because there where some
overwriting issues (it did want to write in a row were already an item was existent, in the previous version) when using several times removeItem and addItem on
the same legend (in random order). The GraphicsGridLayout does not care
about empty rows. I found this approach to work best.