Use the <inmydata-aichart> component to embed charts produced by AI conversations (such as those carried out via the inmydata Agent SDK, see Querying Structured Data with the inmydata Agent API). The user logged in to inmydata must be specified by the agent code for the event to fire and the chart to be shown.
The component can be emedded with the <inmydata-aichart> HTML tag, e.g.:
<inmydata-aichart tenant="example" />
Attributes (all are optional):
- read-only: if "true", don't show the editor tools, just the chart and the share panel. Default is false.
- show-toolbar: "true" or "false" to show or hide the Toolbar (default is true). Use with show-tools to initially only show the chart.
- show-tools: "true" or "false" to show the tool area (default is true). Use with show-toolbar to initially only show the chart.
- show-tool-toggle: "true" or "false" (default is true) to show or hide the toggle button that expands the tool area.
- suppress-drilldown: override the default behaviour of showing the drilldown inside the component. Allows the embedding app to handle the drilldown in its own way. If there are circumstances where you do not wish to handle the drilldown event youself, indicate to the component by calling its method "drilldownHandled(false)" inside your event handler for the inmydata-drilldown event (see Events below).
The component will show a chart placeholder image until there is a real chart to display. When a chart is produced as part of an agentic AI session in progress by the user, the component will automatically display the latest chart.
You may wish to hide the component until there is a real chart to display; to do so, use CSS such as "display:none". The component must be rendered in the HTML in order for it to receive and emit events, therefore you should not programmatically omit the component from the DOM.
NB. Charts generated as part of Copilot conversations will not be shown here. See the Visualisation component for details on showing those charts.
Events
When an AI conversation produces a chart, the event "inmydata.ai.chart.update" will be emitted from this component. The event has three arguments:
- EventName: "inmydata.ai.chart.update"
- User: the id of the logged in user
- SessionId: the id of the agentic AI session.
For other events, see the article on the Visualisation component.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article