Enhancements:

- The `start_date` parameter of `vertical_span` can take a list or tuple of dates to create multiple vertical lines.
- Added style parameters to drawings.

Bug Fixes:
- `VerticalSpan.delete()` now works as intended.
- Drawings no longer show up in the legend
This commit is contained in:
louisnw
2023-09-03 17:08:10 +01:00
parent eacafe3cd1
commit aad2a988b7
5 changed files with 137 additions and 42 deletions

View File

@ -76,7 +76,7 @@ ___
```{py:method} trend_line(start_time: str | datetime, start_value: NUM, end_time: str | datetime, end_value: NUM, color: COLOR, width: int) -> Line
```{py:method} trend_line(start_time: str | datetime, start_value: NUM, end_time: str | datetime, end_value: NUM, color: COLOR, width: int, style: LINE_STYLE) -> Line
Creates a trend line, drawn from the first point (`start_time`, `start_value`) to the last point (`end_time`, `end_value`).
@ -85,7 +85,7 @@ ___
```{py:method} ray_line(start_time: str | datetime, value: NUM, color: COLOR, width: int) -> Line
```{py:method} ray_line(start_time: str | datetime, value: NUM, color: COLOR, width: int, style: LINE_STYLE) -> Line
Creates a ray line, drawn from the first point (`start_time`, `value`) and onwards.
@ -94,12 +94,14 @@ ___
```{py:method} vertical_span(start_time: TIME, end_time: TIME = None, color: COLOR = 'rgba(252, 219, 3, 0.2)')
```{py:method} vertical_span(start_time: TIME | list | tuple, end_time: TIME = None, color: COLOR = 'rgba(252, 219, 3, 0.2)')
Creates and returns a `VerticalSpan` object.
If `end_time` is not given, then a single vertical line will be placed at `start_time`.
If a list/tuple is passed to `start_time`, vertical lines will be placed at each time.
This should be used after calling [`set`](#AbstractChart.set).
```
___

View File

@ -15,7 +15,7 @@ The following hotkeys can also be used when the Toolbox is enabled:
| `alt R` | Ray Line |
| `⌘ Z` or `ctrl Z` | Undo |
Right-clicking on a drawing will open a context menu, allowing for color selection and deletion.
Right-clicking on a drawing will open a context menu, allowing for color selection, style selection and deletion.
___