56 Commits

Author SHA1 Message Date
a3e022c0a9 update version number 2024-06-05 14:25:35 +01:00
65e8d3d8b2 update docs 2024-06-05 14:24:27 +01:00
114b02bcbf drawings can be placed on any series, reimplement jupyter, implement editable text boxes, allow for whitespace data within charts if they are NaN values, fix legend bug 2024-06-01 13:21:45 +01:00
19a4f5f114 update docs 2024-05-29 19:02:03 +01:00
35eb62ac29 implement () event. 2024-05-27 22:39:33 +01:00
a91ea493d7 Update docs, setup.py, conf.py 2024-02-24 13:37:49 +00:00
5861da2123 Added the render_drawings parameter to update
Added the `round` parameter to `vertical_span`
2024-01-21 14:42:54 +00:00
223842bd14 docs(index): remove back tick from the index 2024-01-14 00:57:28 +08:00
e389be5ea4 docs(title): removed back ticks from Charts 2024-01-13 23:35:03 +08:00
fb773954fd docs(abstract): remove extra symbols to relect from original 2024-01-02 18:40:28 +08:00
164cbcdf46 docs(abstract): reflect docs style of def price_scale 2024-01-02 18:38:30 +08:00
2fb842a149 docs(abstract): remove residual 2024-01-02 18:11:36 +08:00
75cc4260ac docs(format): add quote block for consistency 2024-01-01 21:06:33 +08:00
036af89988 docs(abstract-chart): reflect changes from Abstract API 2024-01-01 17:44:09 +08:00
da2a5103fa Enhancements & Bug Fixes
- Added the `color_based_on_candle` parameter to the legend, which will color the percentage change based on the candle color underneath the crosshair.
(#210)
- Fixed a bug which prevented the legend from turning off. (#216)
2023-12-10 19:48:27 +00:00
631afd450f Enhancements:
- Added the `title` parameter to `Chart`.

Bug Fixes:
- When passing a timestamp format to `set`, `update`, or `update_from_tick`, the unit is now by default milliseconds rather than nanoseconds.
- When using `update`, if a time is passed that occurs before the current last datapoint, an error will be raised.
2023-11-22 17:31:35 +00:00
6df0e4fd45 update docs
update setup/conf
2023-10-09 17:42:52 +01:00
ab251a7600 implement table row click callbacks for individual cells
update docs
2023-10-04 19:32:46 +01:00
2bd4c7c037 Bug Fixes:
- Screen now defaults to the active screen rather than the `0` screen.
- `null` values given in chart data are now removed and replaced with whitespace.
- Closing the chart window now cleanly exits.
- Fixed a bug causing the `offset` parameter to be greater than `0` when there is no offset.
2023-09-29 12:03:49 +01:00
d43e7c24e7 Enhancements:
- Hotkeys can now use any character, and modifier keys are not required.
- Refactored the colors of the topbar, searchbox, toolbox, and widgets for consistency.
- Toolbox/interval refactoring and simplification.
- Histograms now show up in the legend, and will use shorthand notation by default (e.g 34k rather than 34000).
2023-09-24 15:09:45 +01:00
b1f007f6d0 Enhancements:
- added the `align` parameter to all topbar widgets, allowing for individual widgets to be placed either on the left or right hand side of the topbar.
- Disabled QtChart’s context menu by default.

Bug Fixes:
- The `screenshot` method now works for subcharts.
- Tables will still render if a `NoneType` is passed to them as a value.
- Qt and Wx charts no longer throw an error when using the toolbox.
2023-09-14 10:51:10 +01:00
8f65a7fc96 - Fixed legend not hiding when resizing to 0
- Added the `menu` widget to the topbar.
2023-09-06 12:46:52 +01:00
555573b54b Enhancements:
- added the `create_histogram` method and the `Histogram` object.
- added the `round` parameter to `trend_line` and `ray_line`
- chart.set can now be given line data.

Bug Fixes:
- `NaN` values can now be given when setting data, and will leave a blank space in the data.
- `resize` will now change the chart wrapper’s size as well as the chart itself.
2023-09-04 20:29:15 +01:00
8532d48e5d update version number 2023-09-03 17:12:17 +01:00
aad2a988b7 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
2023-09-03 17:08:10 +01:00
eacafe3cd1 update landing.html 2023-08-31 22:44:44 +01:00
a7c1dc8a30 Enhancements:
- Added the `screen` parameter to `Chart`, allowing for monitor selection. This should be an index from 0 (0 = primary monitor, 1=  second monitor, etc.)
- `vertical_span` method, allowing for vertical lines/spans to be drawn across the chart.
- `set_visible_range` method, which will set the visible range of the chart based on two given dates.
- `resize` method, which resizes the chart to the given size.
- `sync` will now sync both charts, regardless of which one is scrolled/zoomed.
2023-08-31 21:25:00 +01:00
f72baf95ba Polygon:
- Added async methods to polygon.
- The `requests` library is no longer required, with `urllib` being used instead.
- Added the `get_bar_data` function, which returns a dataframe of aggregate data from polygon.
- Opened up the `subscribe` and `unsubscribe` functions

Enhancements:
- Tables will now scroll when the rows exceed table height.

Bugs:
- Fixed a bug preventing async functions being used with horizontal line event.
- Fixed a bug causing the legend to show duplicate lines if the line was created after the legend.
- Fixed a bug causing the line hide icon to persist within the legend after deletion (#75)
- Fixed a bug causing the search box to be unfocused when the chart is loaded.
2023-08-27 00:20:05 +01:00
34ce3f7199 Refactoring/Enhancements/Fixes
Breaking Changes:
- Removed the `api` parameter; callbacks no longer need to be in a specific class.
- Topbar callbacks now take a chart as an argument (see updated callback examples)
- Removed the `topbar` parameter from chart declaration. The Topbar will be automatically created upon declaration of a topbar widget.
- Removed the `searchbox` parameter from charts. It will be created upon subscribing to it in `chart.events`.
- Removed `dynamic_loading`.
- Removed ‘volume_enabled’ parameter. Volume will be enabled if the volumn column is present in the dataframe.
- Widgets’ `func` parameter is now declared last.
- Switchers take a tuple of options rather than a variable number of arguments.
- `add_hotkey` renamed to `hotkey`
- Horizontal lines now take a `func` argument rather than `interactive`. This event will emit the Line object that was moved.
- Removed the `name` parameter from `line.set`. Line object names are now declared upon creation.

Enhancements:
- Added the `button` widget to the Topbar.
- Added the color picker to the drawing context menu.
- Charts now have a `candle_data` method, which returns the current data displayed on the chart as a DataFrame.
- Fixed callbacks are now located in the `chart.events` object:
    - search (e.g `chart.events.search += on_search`)
    - new_bar
    - range_change
- Added volume to the legend
- Drawings can now be accessed through `chart.toolbox.drawings`
- added the `style` and `name` parameters to `create_line`

Bug Fixes:
- Fixed a bug causing new charts not to load after `exit` was called.
- Refactored rayline placement to ensure they do not move the visible range.
- Fixed a bug causing the visible range to shift when trendlines are moved past the final candlestick.
- Fixed a bug preventing trendlines and raylines on irregular timeframes.
- Fixed a bug causing the legend to prevent mouse input into the chart.
2023-08-14 16:06:16 +01:00
06b605d3a7 Enhancements and Bug Fixes
Tables Feature
- Added the `create_table` method, which returns a `Table` object. This can be used to display watchlists, order windows, position windows and more.
- See the new page on the docs for more information!

Bugs
- Fixed a bug preventing the named column of a line to not work as a label of the series.
- Fixed a bug causing drawings loaded from the minute timeframe to not show on a daily timeframe.
- Fixed a bug causing `chart.exit` to not work.
- Fixed a bug preventing the chart from being moved after placing a ray.
- Fixed the ‘price in hoveringOver’ web console error.

Enhancements
- The date/time column can also be the `name` of the passed series object.
- Added the `label` method to `HorizontalLine`, allowing for the price line label of horizontal lines to be updated.
- `None` or an empty DataFrame can now be passed to `line.set` as a means to clear it.
- Seperate Chart objects will now run on the same pywebview instance. This means that any Chart objects created after the first will inherit the first Chart’s API.
- Reorganized the documentation for clarity.
2023-08-02 13:47:52 +01:00
ca3122baf3 Fixes/Enhancements
- Removed bar data from exported drawings, which should reduce the file size of exported drawings. (Make sure to back up any drawing files before running the new version!)
- Drawings can now be deleted through each’s right click context menu.
- Added the new ‘hotkey’ method, which will execute the given method or function when the key command is pressed.
- Non-fixed callbacks no longer need to be placed in the API class.
2023-07-24 17:03:31 +01:00
527130e618 Ability to save drawings
- Added `toolbox` to the common methods.
- `toolbox.save_drawings_under` can save drawings under a specific `topbar` widget. eg `chart.toolbox.save_drawings_under(chart.topbar[’symbol’]`)
- `toolbox.load_drawings` will load and display drawings stored under the tag/string given.
- `toolbox.export_drawings` will export all currently saved drawings to the given file path.
- `toolbox.import_drawings` will import the drawings stored at the given file path.

Fixes/Enhancements:
- `update` methods are no longer case sensitive.
- HorizontalLines no longer throw cyclic structure errors in the web console.
- `API` methods can now be normal methods or coroutines.
2023-07-20 21:52:17 +01:00
27b8268799 - Fixed 'JSON cannot stringify cyclic structures' web console error
- Changed undo key command to meta+Z or ctrl+z

- Fixed a bug stopping drawings from switching correctly.
2023-07-17 15:05:11 +01:00
95607c6fa4 Update README.md, polygon.md 2023-07-16 21:23:19 +01:00
e4459208d2 NEW FEATURE: Trendlines, Rays and the Toolbox
- Added `trend_line` and `ray_line` to the Common Methods.

- Added the `toolbox` parameter to chart declaration. This allows horizontal lines, trend lines and rays to be drawn on the chart using hotkeys and buttons.
    - cmd-Z will delete the last drawing.
    - Drawings can be moved by clicking and dragging.

- Added the `render_drawings` parameter to `set`, which will keep and re-render the drawings displayed on the chart (useful for multiple timeframes!)

Horizontal Lines
- The `horizontal_line` method now returns a HorizontalLine object, containing the methods `update` and `delete`.
- Added the `interactive` parameter to `horizontal_line`, allowing for callbacks to be emitted to the `on_horizontal_line_move` callback method when the line is dragged to a new price (stop losses, limit orders, etc.).

Enhancements:
- added the `precision` method to the Common Methods, allowing for the number of decimal places shown on the price scale to be declared.
- Lines displayed on legends now have toggle switches, allowing for their visibility to be controlled directly within the chart window.
- when using `set`, the column names can now be capitalised, and the `date` column can be the index.

Changes:
- Merged the `title` method into the `price_line` method.
2023-07-16 20:54:32 +01:00
4d1ce9e0d7 update docs 2023-07-02 10:33:53 +01:00
99d25f8974 v1.0.13.1 2023-06-28 19:15:49 +01:00
dde46149b2 update docs 2023-06-28 18:41:53 +01:00
d9c8aa3bd8 v1.0.13
NEW FEATURE: Polygon.io Full integration
- Added `polygon` to the common methods, allowing for data to be pulled from polygon.io. (`chart.polygon.<method>`)
- Added the `PolygonChart` object, which allows for a plug and play solution with the Polygon API.
- Check the docs for more details and examples!

Enhancements:
- Added `clear_markers` and `clear_horizontal_lines` to the common methods.
- Added the `maximize` parameter to the `Chart` object, which maximizes the chart window when shown.
- The Legend will now show Line values, and can be disabled using the `lines` parameter.
- Added the `name` parameter to the `set` method of line, using the column within the dataframe as the value and using its name within the legend.
- Added the `scale_candles_only` parameter to all Chart objects, which prevents the autoscaling of Lines.

- new `screenshot` method, which returns a bytes object of the displayed chart.

Fixes:
- `chart.lines()` now returns a copy of the list rather than the original.
2023-06-28 18:36:32 +01:00
adfc58a8af - Synced Subcharts will now have synced crosshairs.
- Fixed a bug causing Subcharts not to sync initially.

- added `scale_margin_top` and `scale_margin_bottom` parameters to the `price_scale` method.
- Added `price_line` and `price_label` parameters to `create_line`.

- Lowered the default margins of the chart.
2023-06-10 23:15:10 +01:00
e537ae7e9d update version 2023-06-10 14:39:23 +01:00
345b37e0f3 Bug Fixes/Enhancements:
- Added the chart.spinner method, which when set to `True` shows a loading spinner on the chart (a nice visual for API calls, large datasets etc).
- If an empty data frame is passed to set (eg.`chart.set(pd.DataFrame())`) the volume series and candle series will be cleared.
- added the `cumulative_volume` parameter to `update_from_tick`, which adds the given volume tick onto the latest bar.
- Added `vert_visible` and `horz_visible` parameters to `crosshair`.
- Small style improvements to the searchbox and topbar.
- Fixed a bug preventing callbacks within `WxChart` and `QtChart`

Thanks to @emma-uw for the following fixes and enhancements!
- Methods `hide_data`, `show_data`  and `price_line` can be used within Charts, Subcharts and Lines to change the visibility of data, price lines, and the price line labels.
- Added the `delete` method to Line, which irreversably deletes the Line on the chart as well as its objects in JavaScript and Python.
- Added the `lines` common method, which returns a list of all Line objects for the chart.
- Added the `fit` method to the common methods, which uses the `fitContent()` method from Lightweight Charts.
- Fixed a big which caused synced SubCharts to be out of sync upon loading.

BETA: Polygon.io integration
- Added the `PolygonChart` and `polygon` method, allowing for direct integration of polygon.io’s API.
- This feature is still in beta, and there will be a full announcement and update once the feature is complete!
2023-06-10 14:34:46 +01:00
3463f8635f update docs 2023-06-04 15:10:40 +01:00
3a7832e0d4 - Moved ChartAsync’s methods into the Chart object.
- Removed ChartAsync.
- Added the `show_async` method to `Chart`.
- Refactored how the TopBar is used. The docs explain this in detail, but a basic rundown is:
    - `corner_text` and `create_switcher` are no longer methods. The `topbar` attribute of `chart` should be used instead.
    - switchers and textboxes, now created with `chart.topbar.textbox` and `chart.topbar.switcher` require a name to be passed to them, which is used to access its instance (e.g `chart.topbar[‘timeframe’]`)
    - If you have any questions about these changes, or potential enhancements, feel free to raise an issue and I will get back to you ASAP :)

- PtQt and Wx can now use either synchronous or asynchronous callback functions

- BETA: Support for Jupyter Notebooks

- Fixed a bug causing the ‘date’ column of DataFrames passed to `set`, `update`, and `update_from_tick` to be modified.
2023-06-04 14:38:58 +01:00
a58f1e306c New Feature: ChartAsync
- Added the ChartAsync class, allowing for more sophisticated Charts and SubCharts.
- Symbol searching, timeframe selectors, and more is now possible with this varation of Chart.

`QtChart` and `WxChart` have access to all the methods that `ChartAsync` has, however they utilize their own respective event loops rather than asyncio.

New Feature: `StreamlitChart`
- Chart window that can display static data within a Streamlit application.

Removed the `subscribe_click` method.
2023-05-29 21:31:13 +01:00
7c70b0657e - Fixed a bug causing loading times for large amounts of data to be increased significantly.
- BETA: Dynamic candlestick loading
- the config method has been removed, and its methods can now be found in various places:
    - right_padding: moved to the ‘time_scale’ method.
    - mode: moved to the ‘price_scale’ method.
    - title: declared in the new ‘title’ method.
- It is now possible to update titles, horizontal_lines, and markers within Line objects.
2023-05-23 14:31:27 +01:00
7ea2b0ac19 - Significant refactoring resulting in a 34% reduction in size of the codebase (excluding the Lightweight Charts package) and greater efficiency.
- Upgraded to Lightweight Charts v4.0.1.
- Added a ‘hover’ item to the returning dictionary from subscribe_click.
- Markers and SubCharts no longer use a UUID for identification, but an 8 character string.
2023-05-21 15:42:57 +01:00
b60e9705cb - Fixed a bug causing the library to throw errors when used with python 3.9.
- Fixed a bug that did not size the multi pane charts correctly.
- Implementation of the ‘grid’ common method.
2023-05-20 01:14:01 +01:00
0e709040d5 Update docs 2023-05-18 23:47:11 +01:00
6237cf4d5a New Feature: Multi-Pane Charts
- Added the create_subchart method to Chart.
- Added the SubChart class.
- Added an inner_width and inner_height parameter to Chart.
- The time_scale method can now disable the time scale completely.

Bugs:
- Fixed a bug which prevented markers from being placed on charts with a timescale less than a day.
2023-05-18 23:14:04 +01:00