Files
lightgui_python/tests/data/ohlcv_30.csv
cnmcdee 11493b5f22 Stock charts: CSV data loading (load_csv/set_series/clear/populate)
Every chart widget rendered only the baked-in 250-bar demo series:
no set_series existed in Python despite the docstring naming it, so
there was no way to plot real data at all. Now StockWidget holds up
to three series slots (primary + two extra for the multi-symbol
charts) via set_series (the C API), get_series, add_point, clear /
populate, item_count, and load_csv; all 37 draw paths read the
widget series through _bars(widget) instead of module DEMO_SERIES,
so derived series (Heikin-Ashi, Renko, VWAP, OBV, ...) rebuild from
the loaded data and the drawing tools inherit it as background.

load_csv reads date,open,high,low,close,volume with the stdlib csv
module: header optional (matched by name, any order, extra columns
ignored), dates YYYY-MM-DD / YYYY/MM/DD / DD-MM-YYYY / ISO datetime
/ epoch seconds (validated, not stored -- the x-axis is bar index),
ValueError naming the row on bad data. A cleared series draws a
no-data placeholder; a one-bar series draws (Price: flat change).

Tests: tests/test_stock_csv.py, 27 tests (parsing, API, headless
renders of all 24 chart kinds incl. CSV-vs-template pixel diff).
Fixture tests/data/ohlcv_30.csv (30 weekday bars). Full suite 311
tests pass; visreg 24/24 stock charts pixel-identical to template
goldens. Docs: docs/stock-charts-data.md. Screenshots:
tools/stock_csv_shots.py (Xvfb, RMSE 9-35% vs template goldens).
2026-12-02 09:55:14 +00:00

1.3 KiB

1dateopenhighlowclosevolume
22026-01-05100.00100.1898.8099.40530827
32026-01-0699.4099.9499.3099.581196376
42026-01-0799.58100.0097.8197.92558790
52026-01-0897.9298.6797.5397.69761555
62026-01-0997.6999.0797.1598.211026921
72026-01-1298.21100.1197.43100.02863102
82026-01-13100.02100.1798.4498.751668673
92026-01-1498.7599.2997.0397.62989768
102026-01-1597.6297.9597.5297.85735116
112026-01-1697.8598.9897.5398.571315909
122026-01-1998.5798.8797.7298.451489461
132026-01-2098.4598.9997.0597.551758960
142026-01-2197.5598.7496.6798.45600640
152026-01-2298.4599.1498.0298.201168113
162026-01-2398.2098.8295.8596.551296729
172026-01-2696.5598.3195.9197.991329385
182026-01-2797.9998.7897.2398.341865362
192026-01-2898.3498.9598.1998.291493282
202026-01-2998.2999.7797.5498.88855431
212026-01-3098.8899.5098.4498.511126393
222026-02-0298.5198.6697.2397.331595396
232026-02-0397.3397.5995.6396.011753275
242026-02-0496.0196.4493.9994.511771577
252026-02-0594.5196.5294.2295.741055403
262026-02-0695.7496.5494.4195.27650908
272026-02-0995.2795.5293.8794.121161992
282026-02-1094.1294.7794.0794.501060988
292026-02-1194.5095.0393.2194.071476455
302026-02-1294.0794.7593.4594.18502609
312026-02-1394.1896.4293.3995.711640745