Highcharts charts
Interactive Highcharts (JavaScript) charts. Each class builds a
Highcharts options / series dict that the template hands off to the
highcharts Vue component.
The classes are grouped below by where they appear in the UI.
Transaction charts
Charts used across the Transactions views (overview, basic stats,
per-transaction detail).
-
class richy.core.charts.TransactionOverviewChart(user, df)[source]
Bases: object
Highcharts transaction overview chart used in transaction open overview pages.
TransactionsBasicChart is the shared base for the next two
column / pie chart variants and provides the
get_investments / get_revenues / get_market_values
data-shaping helpers used by both.
-
class richy.core.charts.TransactionsBasicChart(df, pile)[source]
Bases: object
-
class richy.core.charts.TransactionsBasicColumnChart(df, pile)[source]
Bases: TransactionsBasicChart
Highcharts transaction basic charts for each type and currency - investment
vs. market value column chart.
-
class richy.core.charts.TransactionBasicPieChart(df, pile)[source]
Bases: TransactionsBasicChart
Highcharts transaction basic charts for each type and currency - profits
column chart.
-
class richy.core.charts.TransactionDetailColumnChart(df)[source]
Bases: object
Highcharts transaction detail column chart for a specified transaction.
Dashboard and coin overview
Top-of-funnel summary charts – the dashboard’s net-worth pie and
the coin-list staking ratio pie.
-
class richy.core.charts.DashboardMarketValueRatioPieChart[source]
Bases: object
Highcharts dashboard market value ratio pie chart on a dashboard.
-
class richy.core.charts.OpenStakingsRatioPieChart(user)[source]
Bases: object
Staking pie chart used on coin list page.
Item-detail charts
Per-item visualizations used on the item-detail page (and reused
across shares / ETFs / indexes / coins): annual performance candles,
drawdown timeline, and historical ATH periods.
-
class richy.core.charts.PerformanceChart(item)[source]
Bases: object
Highcharts candle chart of item performance year by year.
-
class richy.core.charts.DrawdownChart(item)[source]
Bases: object
Drawdown chart for item detail page.
-
class richy.core.charts.AthPeriodsChart(item)[source]
Bases: object
Highcharts ATH periods chart.
Share-specific charts
Highcharts builders used exclusively by the share Financials view.
Each class reads from one or more Asset
records (populated by Scraper) and returns a
Highcharts options dict ready for the template’s Vue component.
-
class richy.core.charts.ShareRevenueEarningsEpsChart(user_item)[source]
Bases: object
Highcharts Revenue and Earnings (and EPS) chart for shares.
-
ShareRevenueEarningsEpsChart.get_data()[source]
Fetches and converts revenues + earnings + eps data from the database
to pandas dataframe sorted by date in descending order.
Also return EPS rows except “announcement date” column sorted by date - in descending order.
- Returns:
Dataframe with “revenues” and “earnings” series and data as index and EPS rows.
- Return type:
tuple
-
static ShareRevenueEarningsEpsChart.get_options(df)[source]
Compiles Highcharts chart options which is later passed to
highcarts vue component.
- Parameters:
df (pd.DataFrame) – Dataframe with earings and revenues returned by self.get_data().
- Returns:
Highcharts options as a dict.
- Return type:
dict
-
class richy.core.charts.ShareEpsChart[source]
Bases: object
Highcharts EPS chart for shares.
-
ShareEpsChart.get_options(rows)[source]
Compiles Highcharts chart options (which is later passed to
highcarts vue component) with data sorted by date (first column).
- Parameters:
rows (list) – Table EPS rows without headers and Announcement date column.
- Returns:
Highcharts option dict.
- Return type:
dict
-
class richy.core.charts.ShareAnalystRatingsChart(user_item)[source]
Bases: object
Highcharts analyst ratings chart for shares.
-
ShareAnalystRatingsChart.get_options()[source]
Compiles Highcharts chart options (which is later passed to
highcarts vue component) for each ratings record in the
database.
- Returns:
List of Highcharts option dicts.
- Return type:
list
-
class richy.core.charts.SharePriceRatingsChart(user_item)[source]
Bases: object
Highcharts Price ratings chart for shares.
-
SharePriceRatingsChart.get_options(rows)[source]
Compiles Highcharts options (which is later passed to
highcharts vue component) for price ratings.
- Parameters:
rows (list) – Table price ratings rows.
- Returns:
Highcharts option object.
- Return type:
dict