* LegendItem: fix spelling mistake
* LegendItem: remove unused curRow variable
* LegendItem: correct calculation of rowCount
Previously, rowCount would never be updated unless setColumnCount()
was called. This fixes that issue.
It also fixes that setColumnCount() rounded down (floored) the
number of rows, instead of providing an accurate number:
e.g. 4 items in 3 columns would yield rowCount=1, when it should be 2
* LegendItem: remove rowCount argument (not implemented)
Logic to actually use the rowCount argument was not implemented.
Users might expect rowCount to limit the number of rows to e.g. 1,
but that is not what the current code does (it only works with limiting
the number of columns).
Thus, we were exposing an unused/misleading parameter to users.
This can and should be reverted if the logic for limiting the number
of rows is added.
* LegendItem: add colCount docs
* test (LegendItem): remove unused curRow variable
* test (LegendItem): check increasing rowCount as add items
* Fixed logic in placement of items in legend with multiple columns
* Actual row count here should be 2, not 3
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
* LegendItem: Introduce itemStyles and provide ToggleItem
Show example
* Minor cleanup of the legend item and test
* Make ItemSample customizable
* Remove example modifications
* Changes for sampleType according to review
* NEW options for LegendItem
* * changed 'drawFrame' into 'frame'
* added **kwargs to plotItem.addLegend
* added (frame=False, colCount=2) in legend example
* more elegant solution for legend.getLabel
* repaired getLabel
ItemSample.item == plotitem
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
- Can be anchored to parent item at any location
- Support for filled plot styles
- Automatically resizes to fit contents
- PlotItem can auto-generate legend