External Chart Libraries

View as Markdown

Summary

  • Most charting users access the charts provided by AG Grid
  • However AdapTable can work with any charting library

AdapTable integrates closely with AG Grid's charts, and is the most common charting use case.

But AdapTable can be used in conjunction with any charting library.

AdapTable's rich Adaptable API and the many Adaptable Events make it easier to synchronise data in the Grid with your preferred Charting library.

Two Patterns

Context menu charts (first demo) — Custom context-menu actions call your charting library directly from the current cell selection. This is useful for ad hoc charts without persisting a definition in Adaptable State.

Persisted external definitions (second demo) — Register External Charting Options (onShowChart, onHideChart, isChartOpened, and related callbacks), store external chart definitions in State, and open them from Charting UI into chartContainers — the same persistence model as AG Grid charts.

Find Out More

Callback signatures and types are documented in Charts Technical Reference

Feedback

  • We are keen to add additional support for external charting and to meet all use cases
  • So please contact us if there is specific functionality that you would like us to make available
External Charts Library
Fork
  • This demo shows how to use the Highcharts Charting library from AdapTable
  • From any valid selection (one string and one numeric column) we are able to use the Context Menu to create 3 different chart types:
    • Pie Chart
    • Line Chart
    • Bar Chart
Try It Out
  • Select a range that includes a numeric and a string column (we pre-select a range using the Grid API)
  • Create a Highcharts chart by selecting Show Charts from the Context Menu (the first item, and only enabled if there is a valid selection) and choose a Chart type
Loading demo…

Saving Charts

External charts can also be saved into Adaptable State.

Similar to the configuration for AG Grid Charts, External Charts can be:

  • defined in Initial Adaptable State (i.e. configured at design-time)
  • created at run-time and then saved into State to be available when the application restarts
  • displayed in custom locations provided by the users
Saving External Charts
Fork
  • This example shows how External Charts can be saved into Adaptable State and then displayed in AdapTable
  • 2 external (Highcharts) charts are defined in Initial Adaptable State:
    • Github Stars Line Chart
    • Frameworks Pie
  • 2 custom Charting Containers are defined in Charting Options:
    • Above Grid
    • Below Grid
  • externalChartingOptions wires show, hide, and preview behaviour to the Highcharts service (see adaptableOptions.ts)
Try It Out
  • In the Charting Toolbar select an External Chart and a Container
  • Click the Show Chart (Eye icon) button to display / hide the Charts
Loading demo…