Handle the event sent from embedded app.
Send message to embedded app.
Sets an event listener
the event you are subscribing to
the callback to be executed when the event is triggered
optional options object, can be used to customise when handler is called
Get the channel data from the current chart
a promise that resolves to the channel data on the current chart
Get the customizable axes data from the current chart
a promise that resolves to the axis data on the current chart
the data of the embedded chart or dashboard chart
Returns the current filter applied to the embedded chart The filter value is taken from the state of the chart entity in the Charts app component.
a promise that resolves once the filter is taken from the Charts state
Returns the current highlight applied to the embedded chart or dashboard chart The highlight value is taken from the state of the chart entity in the Charts app component.
a promise that resolves once the highlight is taken from the Charts state
Get the image data of embeded entity in base64 or binary encoding
options for image generation
image encoded with base64 or binary
the number of seconds before a chart or dashboard's data expires
Returns the current pre-filter applied to the embedded chart The filter value is taken from the state of the chart entity in the Charts app component.
a promise that resolves once the filter is taken from the Charts state
the number of seconds a chart will wait before refreshing
Gets the customizations applied to a chart after initial render
the customized rendering spec or undefined.
the current theme applied to the chart or dashboard
whether auto refreshing is enabled
Triggers a refresh of the chart or dashboard (if it has been embedded).
a promise that resolves once the chart or dashboard updated its data
Removes an event listener
the event you are unsubscribing from
the event listener function you are unsubscribing from
optional options object used when addEventListener
Sends the ready
event to Charts to render the embedded chart in the component
where the chart will render
Enable/Disable auto refreshing.
Sets a filter to the state of the chart/dashboard entity in the Charts app component. The chart entity can be an embedded chart, embedded dashboard chart or embedded dashboard. The filter gets applied to the embedded chart/dashboard.
This expects an object that contains a valid query operators. Any fields referenced in this filter are expected to be allowed for filtering in the "Embed Chart" dialog or "Embed Dashboard" dialog for each chart/dashboard you wish to filter on.
The filter object to be applied to the chart/dashboard
a promise that resolves once the filter is saved and the component rerendered
Sets a highlight to the state of the chart entity in the Charts app component. The chart entity can be an embedded chart or an embedded dashboard chart. The highlight gets applied to the embedded chart or dashboard chart.
This is the exact same object that can be used in 'setFilter'. However, it [doesn't support some query expressions] (https://www.mongodb.com/docs/charts/filter-embedded-charts/#filter-syntax) And there are some specifics about what is highlightable (https://www.mongodb.com/docs/charts/highlight-chart-elements/)
The highlight object to be applied to the chart
a promise that resolves once the highlight is saved and the component rerendered
Set the number of seconds a chart or dashboard's data expires.
Sets a filter which will be applied as the first stage on the Data Source. The chart entity can be an embedded chart, embedded dashboard chart or embedded dashboard. If a Charts View is defined in the UI, then this filter will be applied after the defined pipeline.
This expects an object that contains a valid query operators. Any fields referenced in this filter are expected to be allowed for filtering in the "Embed Chart" dialog or "Embed Dashboard" dialog for each chart/dashboard you wish to filter on.
If filtering is required on a dynamic field defined via a Lookup, Calculated or Query Bar, then setFilter
is the appropriate method.
The filter object to be applied after the defined Charts View in the UI
a promise that resolves once the filter is saved and the component rerendered
Set the number of seconds a chart will wait before refreshing.
The minimum refresh interval is 10 seconds. To disable, set the refresh interval to 0.
Sets a set of customizations on the rendered chart
customization settings and values
a promise that resolves once the rendering spec is saved and the component rerendered
Sets the color scheme to apply to the chart or dashboard.
If the theme is set to 'dark' and you have specified a custom background color, you should ensure that your background color has appropriate contrast.
Send message to embedded app.
Generated using TypeDoc
Chart
Allows you to interact and embed charts into your application.
const sdk = new EmbedSDK({ ... }); const chart = sdk.createChart({ ... }); // renders a chart chart.render(document.getElementById('embed-chart')); // dynamically set a filter chart.setFilter({ age: { $gt: 50 } });