# Financial Chart

## **Overview**

The financialchart block enables rich visualization of stock market data within chat messages using a JSON structure. This feature supports time-series price charts along with detailed financial metrics — perfect for financial bots, stock monitoring tools, or investment platforms.

## Comparative view

When multiple instruments are provided, the chart displays a **comparative view**, showing the relative performance of each instrument over time. This allows for direct comparison between stocks or other financial assets within the same visual context.

## **Syntax**

Wrap your JSON payload in a code block with the financialchart tag:

````
```financialchart
// JSON payload (see below)
```
````

The payload must be an **array of objects**, each describing a single financial instrument.

```
[\
  {\
    "info": {\
      "companyName": "Apple",\
      "instrumentName": "Apple Rg",\
      "ticker": "AAPL",\
      "exchange": "NASDAQ",\
      "currency": "USD"\
    },\
    "priceHistory": [\
      {\
        "date": "2025-01-02",\
        "value": 243.85\
      },\
      ...\
    ],\
    "metrics": [\
      {\
        "name": "Open",\
        "value": 221.45,\
        "timestamp": "2025-03-27T09:30:01-04:00"\
      },\
      ...\
    ],\
    "lastUpdated": "2025-03-28T16:10:09.243846",\
    "version": 1\
  }\
]
```

## Supported Metric Names

| **Name** | **Description** |
| -------- | ---------------- |
| Open     | Opening price of the last session |
| High     | Highest price during the session |
| Close    | Closing price |
| Market Cap | Market capitalization |
| Price Earnings Ratio | P/E ratio |
| Volume   | Trading volume |
| Year High | Highest price in past year |
| Year Low | Lowest price in past year |
| Dividend Yield | Dividend yield % |
| Volatility 30 Days | 30-day price volatility |
