cliStocksTracker
cliStocksTracker copied to clipboard
Portfolio table width
Currently it just prints each portfolio entry as one line - regardless of what width the user has set in their config file. This table should follow the same restrictions the graphs do.
Looking at pull #30, I think that scaling the table should follow these steps:
- If user_width > default_width:
- Increase cell_width until desired width is reached.
- if user_width < default_width:
- Reduce cell width down to a minimum of two spaces between each cell or until user width is reached.
- If width not reached, split main table into two sub tables (see details below) and increase cell_width back to default.
- If width not reached, repeat first step for both tables.
- If width not reached, split main table into three sub tables (see details below) and increase cell_width back to deafult.
- If width not reached, repeat first step for all tables.
Two table approach:
1st table has the following columns*:
Ticker, Last, Change, Change%, Low, High, Daily Avg
2nd table has the following columns*:
Ticker, Owned, Mkt Value, Avg Share, Total Cost
Three table approach:
1st table has the following columns*:
Ticker, Last, Change, Change%
2nd table has the following columns*:
Ticker, Low, High, Daily Avg
3rd table has the following columns*:
Ticker, Owned, Mkt Value, Avg Share
Note that yes, "Total Cost" is missing from the three table approach. Had to cut a column somewhere so that the three table approach would have at most four columns per table.
*columns are based off the table from pull #30
This is all a just a ballpark idea - if whoever takes this ticket can think of a better way to do things that by all means! I love seeing creative solutions.