---
source: https://qlik.dev/embed/qlik-embed/examples/analytics-chartonfly-example/
last_updated: 2026-01-19T14:21:00Z
---

# analytics/chart on the fly

The `analytics/chart` ui for qlik-embed accepts additional properties to
create a chart on the fly. This is a visualization which doesn't
exist in the source Qlik Sense app, and is instead generated for the current
session when you supply the chart type, dimensions, and measures.

> **Note:** Supports visualizations that work with the `analytics/chart` UI only.
> Review [the visualization support table](https://qlik.dev/embed/foundational-knowledge/visualizations/) for compatibility information.

Here's an example of a chart on the fly definition using qlik-embed web components.

> **Tip:** When defining arrays or objects in HTML attributes, use either single quotes around the
> attribute and standard double quotes inside, or encode double quotes as `&amp;quot;` for valid
> static HTML. This example uses single quotes for readability.

```html
<qlik-embed
  ui="analytics/chart"
  app-id="<appid>"
  type="barchart"
  dimensions='["[CategoryName]", "[Product Name]"]'
  measures='["=Sum(Sales)", "=Sum([Cost of Goods Sold])", "=Sum([GrossMargin])"]'
  properties='{orientation: "horizontal"}'
  state-name="name_of_the_state"
  theme="breeze"
></qlik-embed>
```

To create a chart on the fly, supply values for these properties:

- `app-id`: a unique Id representing a Qlik Analytics application.
- `type`: The type of visualization to render. Here's a list of
  [available visualizations](https://qlik.dev/embed/foundational-knowledge/visualizations)
  to choose from.

Depending on chart type, add:

- `dimensions`: An array field names or master dimension names wrapped with
  square brackets for Qlik script compatibility.
- `measures`: An array of expressions pre-fixed with an equal sign, or square
  brackets for Qlik script compatibility.

You can also add additional properties:

- `state-name`: A string for the name of the alternate state to apply to the chart (must
  exist in the app).
- `properties`: An object setting specific properties to control the presentation
  of the rendered object.

Want to explore more qlik-embed? Explore all [qlik-embed UIs and params](https://qlik.dev/embed/qlik-embed/parameters/).
