Chart Builder UI
Chart Generation
This document assumes you have already applied the appropriate configuration to set up the MCP server and have it communicating with the dashboard, i.e. the MCP server URL and its trusted hosts have already been configured. Additionally, ensure you have the chart builder specific settings mentioned in the AI setup documentation applied.
The chart generation feature lives within the same chatbox as the chart search feature, in its own tab. Each of these tabs has its own beta flag required in order to be presented to the user - the pre-existing AI_CHART_SUGGESTION flag, and the new AI_CHART_GENERATION flag. If only one of these flags is present, the chatbox will appear without the tabs but with the functionality pertaining to the enabled feature. With both flags present, both tabs will be active.
The AI chatbox is now navigable via keyboard - the search and generate tabs, the three buttons on the top right of the navigation bar, the user input text box and the send button can all be navigated to via the tab key.
Once you have entered a query within either the ‘search’ or ‘generate’ tab, the AI chatbox becomes locked and tab switched is disabled until a response has been returned. Once the response has been returned, you can once again switch freely between the two tabs. When the chatbox is ‘locked’, it can still be minimised or closed.
Outcomes Based On Provided Prompt
Based on what information you provide to the AI within your query to generate a chart, it may behave in one of several different ways:
The user provides a chart type, provides the correct column configuration for that chart type, and provides column names which all exist within the same data connection, but does not specify a data connection OR specifies the correct data connection name i.e. “Create me a bar chart about departments and numbers”. If the AI finds a dimension called “Department” and a measure called “Numbers” within the same data connection - it will generate a chart.
The user provides a chart type, provides the correct column configuration for that chart type, and provides column names which all exist within the same data connection, but specifies the wrong data connection - the chart generation request will be rejected.
The user provides a chart type, provides the correct column configuration for that chart type, does not specify a data connection, and provides column names which exist within different data connections - the chart generation request will be rejected.
The user provides a chart type, provides the correct column configuration for that chart type, and provides column names, all of which exist within the same data connection, and does not specify a data connection - but some of the columns have duplicates (columns with the same name) found within other data connections. It will use columns from the same data connection (the one which has ALL the matching column names based on the user’s request) to generate the chart.
The user provides a prompt completely unrelated to chart generation or any data which exists within the dashboard - the chart generation request will fail.
For the rest of these examples, we will assume that the user is providing information relating to columns coming from the same data connection:
The user provides a chart type, but provides too much or too little information pertaining to columns for that chart type i.e. “Create me a bar chart about departments, people, numbers and decimals”. This request implies 2 dimensions and 2 measures - which is not supported by bar charts - the chart generation request will be rejected.
The user provides information relating to data columns, but no chart is specified - the AI will automatically create a chart based on a matching pattern. This will ALWAYS result in a chart being generated as table chart types support ALL patterns - i.e. the user inputs “Create me a chart about departments, people, numbers, decimals and years” - it will look for an appropriate chart pattern, realise that this request specifies 5 columns (which is too much for something like a bar or line chart - unless of course if 4 of them are measures, but for this example we will assume this is not the case), it will realise that only tables support this configuration, and therefore generate you a table chart.
Actions After Chart Generation:
If chart generation fails, you will be asked to repeat your initial request from scratch with updated information i.e. include column names which you omitted in your previous request.
Edit button - this will take you to the chart editor to view and edit your generated chart.
Delete - this will allow you to delete your generated chart from within the chatbox.
Refresh - similarly to the refresh icon that is provided within a response from the chart search tool, this will allow you to refresh the chart in the case of any data having been updated.
Capabilities:
The AI will tell you exactly why chart generation has failed if it does.
The AI will automatically choose an appropriate category to place your chart in if you do not specify one - this will be based on the chart’s data and name and the chosen category’s name.
It will always try to use columns from the same data connection.
If it attempts to create a chart with a chart name that already exists within the system, it will add a random suffix at the end of the chart name and try again.
The chart generation tool is lenient when it comes to spelling mistakes and casing, so if you mention ‘departments’ or ‘deppartmments’ in your request, it will automatically assume you are looking to generate a chart with a found data column called ‘Department’.
You are able to create charts with multiple hierarchies (drill down levels) with this feature.
Limitations:
Generating the following chart type is unsupported: merged chart, merged table,
Merged chart
Merged table
Custom map
Card
IFrame
Combined chart
URL link
Drill to API
Drill to chart
Drill to category
Chart generation currently does not support context and therefore requires a one-shot request to create a chart. If enough information is provided, you will be asked to re-type your query from scratch. You cannot say something like “Try again but add the ‘Numbers’ column”.
You are not currently able to edit generated charts via prompts. You must use the chart editor button provided within the response of a successfully generated charts and do this manually.
The following advanced features are not supported, and must be applied within the chart editor: Styling, Colours, Filters, Attributes, Additional Data, Targets & Custom SQL.
The chart generation tool currently has no knowledge of table joins within data connections - you must ensure that your tables have been appropriately joined in order for chart to be generated with visible data based on the columns the user asks to use in their query.