Chart Settings
Chart settings management for the dashboard.
Reads and writes per-run chart display settings from
~/.onesecondtrader/chart_settings.json.
SETTINGS_PATH = Path.home() / '.onesecondtrader' / 'chart_settings.json'
module-attribute
VALID_STYLES = {'line', 'histogram', 'dots', 'dash1', 'dash2', 'dash3', 'background1', 'background2'}
module-attribute
VALID_COLORS = {'black', 'red', 'blue', 'green', 'orange', 'purple', 'cyan', 'magenta', 'yellow', 'teal'}
module-attribute
VALID_WIDTHS = {'thin', 'normal', 'thick', 'extra_thick'}
module-attribute
DEFAULT_COLOR_CYCLE = ['blue', 'red', 'green', 'orange', 'purple', 'cyan', 'magenta', 'teal', 'black', 'yellow']
module-attribute
_read_all()
Read the entire settings file, returning empty dict on failure.
Source code in src/onesecondtrader/dashboard/chart_settings.py
_write_all(data)
Write the entire settings file, creating parent dirs as needed.
Source code in src/onesecondtrader/dashboard/chart_settings.py
load_chart_settings(run_id)
Load chart settings for a run.
Returns:
| Type | Description |
|---|---|
dict
|
Settings dict for the run, or empty dict if none exist. |
Source code in src/onesecondtrader/dashboard/chart_settings.py
save_chart_settings(run_id, settings)
Save chart settings for a run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_id
|
str
|
Unique identifier of the backtest run. |
required |
settings
|
dict
|
Chart settings dict to persist. |
required |