Using Charts

View as Markdown

Summary

  • Run-time users can save and re-open AG Grid charts they have created
  • If Charting locations have been provided, they can choose where to display these charts

Run-time users of AdapTable can manage the charts which they create using AG Grid.

Saving Charts

AdapTable users can name and save charts into Adaptable State.

Note

This requires the saveChartBehaviour property in Charting Options to be set to manual or auto (not none, the default)

With manual, a Notification prompts the user to provide a name for the Chart, whereupon the Chart is saved.

With auto, new charts are saved into State without that popup (AdapTable assigns naming behaviour as configured in the Charting flow).

Opening Charts

Any AG Grid charts which have been named and saved will appear in a dropdown in:

Selecting a chart in any of these and clicking 'Open' will display the Chart.

Hint

  • If specified Chart locations have been provided in Charting Options, users can select where to display the Chart
  • See Configuring Charts for more details on how to provide Chart locations

Opening Saved Charts on Restart

By default, AdapTable does not store details of which Charts are currently opened in which Containers.

For many applications, use restoreChartsOnReady in Charting Options to open persisted chart definitions when AdapTable loads — see Configuring Charts.

Alternatively, you can track open charts yourself using the Chart Changed Event and the Application section of Adaptable State.

Hint

The demo below uses Application State and Layouts to re-open charts when the application restarts or when the user switches layout

Displaying Saved Charts
Fork
  • This example uses Application State to store details of which Charts were displayed
  • Chart definitions (bar, pie) are registered in Adaptable Ready; Layout OpenCharts references those names
  • Charts have been placed in 2 Layouts
Try It Out
  • Switch between the 2 Layouts to see the Charts display in different Containers
Loading demo…

Closing Charts

Any open chart can be closed from the same locations which can open it.

Editing Charts

Charts can be edited by clicking the Edit button for that Chart in the Charts Settings Panel.

This will open the Wizard for that Chart allowing it to be edited as required.

Deleting Charts

Charts can be deleted by clicking the Delete button for that Chart in the Charts Settings Panel.

ReadOnly Charts

Individual Charts can be set to be read-only if required.

Note

Read-only on a chart definition can restrict edit and delete actions in Charting UI independently of Module Entitlements

Read-Only Charts can be displayed and closed but they cannot be deleted or edited through the standard Charting UI.

There are 2 ways to set a Chart to Read-Only:

Hint

  • To let end users mark a chart read-only during a session, expose setChartReadOnly from your own UI (for example a Custom Toolbar button)
Read-Only Charts
Fork
  • This example contains 2 Charts:
    • Bar Chart — can be displayed, edited, and deleted
    • Pie Chart — marked read-only via setChartReadOnly in Adaptable Ready; it can be displayed but not edited or deleted
Try It Out
  • Switch between the 2 Charts and note how the Edit and Delete buttons in the Toolbar are alternately enabled / disabled
Loading demo…