Connect
connect
- Type: {
url?: string,method?: string,headers?: Record<string, string>}
Connection settings for the backend API.
| Property | Type | Default | Description |
|---|---|---|---|
url | string | - | Endpoint URL for the chart API |
method | string | "POST" | HTTP method |
headers | Record<string, string> | {"Content-Type": "application/json"} | Request headers |
<prompt-chart connect='{"url": "https://api.example.com/chart"}' prompt="Show sales by region"></prompt-chart>
prompt
- Type:
string
The natural language prompt to send to the backend.
<prompt-chart prompt="Show monthly revenue trend" demo></prompt-chart>
autoFetch
- Type:
boolean
When true, automatically fetches the chart when the component mounts (requires prompt and either connect.url or demo).
<prompt-chart prompt="Show user growth" demo autoFetch></prompt-chart>