Skip to content

Commit 38ce704

Browse files
authored
(DOCSP-22773): Update support for highlighting charts within embedded dashboards (#560)
* update highlighting to support embedded dashboards * copy review feedback * fix build error
1 parent 98601c7 commit 38ce704

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

source/embedded-dashboard-options.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ dashboards embedded with the :ref:`Embedding SDK
194194
dashboard.setAutoRefresh(true);
195195
dashboard.setMaxDataAge(30);
196196

197-
Use the following methods to set the theme and automatic
198-
refresh rate of the Dashboard instance returned by
199-
``DashboardsEmbedSDK.createDashboard({ ... })``.
200-
201197
.. list-table::
202198
:header-rows: 1
203199
:widths: 50 50
@@ -230,6 +226,12 @@ dashboards embedded with the :ref:`Embedding SDK
230226
your dashboard's background color has appropriate
231227
contrast so that the information is visible.
232228

229+
* - ``getChart('<chartID>')``
230+
- Retrieves a specific chart from the embedded dashboard
231+
using the chart's ``chartId`` string. After calling this
232+
method, you can :ref:`highlight elements <highlight-chart-elements>`
233+
or :ref:`filter data <filter-embedded-sdk>` on the chart.
234+
233235
.. seealso::
234236

235237
- `Embedding SDK API Documentation

source/highlight-chart-elements.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@ Highlight Chart Elements
1414

1515
The Charts Embedding JavaScript SDK enables you to programmatically
1616
highlight specific elements and :ref:`clicked events
17-
<handle-click-events>` on charts.
18-
19-
.. note::
20-
21-
You can highlight specific elements only on embedded charts. You
22-
can't highlight specific elements on charts within embedded
23-
dashboards.
17+
<handle-click-events>` on embedded charts and charts within :ref:`embedded
18+
dashboards <embedding-dashboards>`.
2419

2520
.. _highlight-chart-elements-prereqs:
2621

@@ -42,6 +37,16 @@ has the following syntax:
4237

4338
charts.setHighlight(selectionFilter);
4439

40+
.. note::
41+
42+
If you want to highlight charts within an embedded dashboard,
43+
first run the following method to retrieve a specific chart
44+
from the Dashboard instance:
45+
46+
.. code-block:: javascript
47+
48+
dashboard.getChart('<chartID>');
49+
4550
The ``setHighlight`` method takes an :abbr:`MQL (MongoDB Query
4651
Language` filter. You can provide the MQL filter directly to the
4752
``setHighlight`` method as shown in the example below or through the

0 commit comments

Comments
 (0)