diff --git a/docs/widgets.md b/docs/widgets.md index 768d6a29..109bdf2a 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -236,6 +236,31 @@ Display current FX rates in your native currency - KPW ``` +### Stock Price History + +Shows recent price history for a given publicly-traded stock or share + +
+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`apiKey`** | `string` | Required | API key for [Alpha Vantage](https://www.alphavantage.co/), you can get a free API key [here](https://www.alphavantage.co/support/#api-key) +**`stock`** | `string` | Required | The stock symbol for the asset to fetch data for +**`priceTime`** | `string` | _Optional_ | The time to fetch price for. Can be `high`, `low`, `open` or `close`. Defaults to `high` + +##### Example + +```yaml +- name: CloudFlare Stock Price + icon: fas fa-analytics + type: stock-price-chart + options: + stock: NET + apiKey: PGUWSWD6CZTXMT8N +``` + --- ## Dynamic Widgets diff --git a/src/components/Widgets/StockPriceChart.vue b/src/components/Widgets/StockPriceChart.vue new file mode 100644 index 00000000..c4dcbf94 --- /dev/null +++ b/src/components/Widgets/StockPriceChart.vue @@ -0,0 +1,176 @@ + + + + + + + diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index 61275373..ba78aae4 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -18,6 +18,7 @@