Skip to main content

Magic Visual

The Magic Visual feature is a dynamic tool that helps you create visual representations of your data with minimal effort. It is particularly useful when you need to quickly generate Visuals without working through complex configurations.

note

To use the Magic Visual feature, AI must be enabled in the Administration AI settings.

Creating a Magic Visual

To create a Magic Visual, navigate to the Dataset's Visuals page and select Magic Visual from the New Visual dropdown.

The New Visual menu on a Dataset with the Magic Visual option
Creating a new Magic Visual.

Selecting this option opens the Magic Visual dialog. Here you can use one of the generated prompts to start a Magic Visual, or instruct the AI to create a Visual of your choosing.

The Magic Visual dialog with suggested prompts and a chat box
The Magic Visual dialog.

For example, you could ask the Magic Visual to create a chart that analyzes sales data over time.

The Magic Visual chat producing a line chart of total sales by order date
Creating a chart to analyze sales data.

Customizing your Magic Visual

Once your Magic Visual is created, you can continuously refine it. For example, you could ask the AI to split the original Magic Visual into three charts, one for each year, then ask it to use green lines when sales increase and red when they decrease.

The Magic Visual refined into three small-multiple line charts colored green and red by trend
Refining your Magic Visual.

Magic Visual: Data tab

Use the Data tab to view the underlying Elasticsearch query generated by the AI. If you are familiar with Elasticsearch, you can edit the query and see the changes reflected in the Magic Visual.

The Magic Visual Data tab showing the generated Elasticsearch aggregation query next to the charts
The Magic Visual Data tab.

For example, changing the following:

"date_histogram": {
"field": "OrderDate",
"calendar_interval": "month"
}

to this:

"date_histogram": {
"field": "OrderDate",
"calendar_interval": "quarter"
}

shows the sales data by quarter instead of by month. In the resulting Magic Visual, there are no longer data points for each month; instead there are up to four data points, one for each quarter.

The Magic Visual Data tab after changing the calendar interval to quarter
The resulting Magic Visual after changing month to quarter.

Magic Visual: Transform tab

Use the Transform tab to view the code that transforms the results of the Data tab's Elasticsearch query into a usable form for the Magic Visual. You can alter the code and see the changes reflected in the Magic Visual.

The Magic Visual Transform tab showing JavaScript that builds a Highcharts line config
The Magic Visual Transform tab.

For example, changing the colors on lines 14 and 15 and the chart type on line 22:

14 if (index === 0) return 'green';
15 return point.y >= monthlyData[index - 1].y ? 'green' : 'red';
...
22 chart: { type: 'line', height: 200 }

to this:

14 if (index === 0) return 'orange';
15 return point.y >= monthlyData[index - 1].y ? 'orange' : 'blue';
...
22 chart: { type: 'spline', height: 200 }

changes both the Magic Visual's chart type and colors.

The resulting Magic Visual after changing the chart type to spline and the colors to orange and blue
The resulting Magic Visual after changing chart type and colors.

Magic Visual: Model tab

Use the Model tab to view a sample output of the Magic Visual's model. The code on the Model tab should not be edited; use it only for debugging.

The Magic Visual Model tab showing the final visual component JSON
The Magic Visual Model tab.

Interacting with Magic Visuals

When you are satisfied with your Magic Visual, click Apply to save it to the Dataset's Visuals list. Once saved, you can interact with it the same way as any other Visual: filter it, add it to the Homepage, or add it to a Dashboard.

A Magic Visual added to a Dashboard with an Order Date input filter applied
Using input filters on a Magic Visual added to a Dashboard.
Also available through the REST API
Everything on this page is built on Informer's public REST API, the same one the product uses, so your scripts and integrations can do it too. Developer reference: Datasets.