Views and pages
Put the chart on a view
Section titled “Put the chart on a view”In the Designer, drag PowerChart Ultra from the palette (category Mustry Solutions) onto a view. Give it room: in a flex container, let it grow. A new component starts with the 12 built-in quick ranges written out in its props, ready to change.
The props you set first:
| Prop | Set it to |
|---|---|
configuration |
The name of a configuration on the gateway. Default: default. |
initial |
The chart shown without a saved chart or link: {"pens": [{"path": "[default]Plant/Flow"}], "span": "8h", "live": true}. |
timeZone |
An IANA zone such as Europe/Brussels, if the chart must not follow the browser's. |
Every prop is listed in the props reference.
Give saved charts a page
Section titled “Give saved charts a page”A saved chart opens through a page whose URL holds its id. Add two pages to the project for the same view:
| Page URL | View parameter |
|---|---|
/trends |
(none) |
/trends/:chartId |
chartId |
Then:
- Add a view parameter
chartId(text, default empty). - Bind the component's
chartIdprop toview.params.chartId. - Leave
chartUrlat/trends/{chartId}andnewChartUrlat/trends, or change both to the pages you made.
After Open and Save the address bar follows chartUrl, so the address is the chart's link. After
New chart and Delete it goes to newChartUrl. Leave chartUrl empty and the address bar is
left alone: a saved chart then cannot be linked or kept over a reload on that page.
The full chart state is also kept in the address after #pcu= (urlState, default on), so an
unsaved chart survives a reload and can be shared as a link.
Choose the configuration
Section titled “Choose the configuration”The configuration prop names the gateway configuration the chart uses. The gateway ignores writes
to it from the browser, but it trusts bindings. Bind it only to values the browser cannot set: not
to a URL or page parameter, nor to a session property a client script writes. Otherwise a user could
pick a looser configuration.
When the prop changes, the chart reads everything again under the new configuration. A saved chart on
screen goes, unless the view asks for it through chartId or the page's path; then it opens again
under the new one.
A fixed trend
Section titled “A fixed trend”For an overview screen, set readOnly: true: no chart actions and no tag browser, only the pens in
initial (or the saved chart in chartId). Users can still zoom, pan and read traces. This is a
layout choice, not a permission: what a user may read and save is decided by the configuration.
For a dashboard tile with only the plot, see Dashboards.
Events
Section titled “Events”| Event | Payload |
|---|---|
onChartSaved |
{chartId, title} |
onChartDeleted |
{chartId} |
Output
Section titled “Output”The component writes props.output: start, end, dataStart (epoch ms), live, chartId,
title and changed. Bind other components to it, for example a label with the chart's title, or
the queries of bound pens to output.dataStart and output.end.
The side panel
Section titled “The side panel”panel sets whether the side panel starts open and its width: {"open": true, "width": 320}. On
screens under about 900 px wide it starts closed whatever the prop says.