Merge branch 'louisnw01:main' into main
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import asyncio
|
||||
import os
|
||||
from base64 import b64decode
|
||||
from datetime import datetime
|
||||
from typing import Union, Literal, List, Optional
|
||||
import pandas as pd
|
||||
@ -887,6 +888,15 @@ class AbstractChart(Candlestick, Pane):
|
||||
) -> Table:
|
||||
return self.win.create_table(width, height, headings, widths, alignments, position, draggable, func)
|
||||
|
||||
def screenshot(self) -> bytes:
|
||||
"""
|
||||
Takes a screenshot. This method can only be used after the chart window is visible.
|
||||
:return: a bytes object containing a screenshot of the chart.
|
||||
"""
|
||||
self.run_script(f'_~_~RETURN~_~_{self.id}.chart.takeScreenshot().toDataURL()')
|
||||
serial_data = self.win._return_q.get()
|
||||
return b64decode(serial_data.split(',')[1])
|
||||
|
||||
def create_subchart(self, position: FLOAT = 'left', width: float = 0.5, height: float = 0.5,
|
||||
sync: Union[str, bool] = None, scale_candles_only: bool = False,
|
||||
toolbox: bool = False) -> 'AbstractChart':
|
||||
|
||||
Reference in New Issue
Block a user