1
1
.. _embedded-chart-sdk-options:
2
2
.. _sdk-option-reference:
3
3
4
- ====================
5
- Embedded SDK Options
6
- ====================
4
+ ===========================
5
+ Embedded Charts SDK Options
6
+ ===========================
7
7
8
8
.. default-domain:: mongodb
9
9
@@ -56,12 +56,14 @@ interval and other aspects.
56
56
});
57
57
await chart.render(embedContainer);
58
58
59
+ .. _embedded-charts-options-table:
60
+
59
61
Embedded Chart Options
60
62
----------------------
61
63
62
64
.. please keep these alphabetized
63
65
64
- You can specify the following options for an embedded chart :
66
+ The ``createChart()`` method takes the following options:
65
67
66
68
.. list-table::
67
69
:header-rows: 1
@@ -79,7 +81,7 @@ You can specify the following options for an embedded chart:
79
81
omitted, charts don't automatically refresh.
80
82
81
83
Use this option with the ``maxDataAge`` option to
82
- configure how often the chart refreshes.
84
+ configure automatic dashboard refresh frequency.
83
85
- no
84
86
85
87
* - ``background``
@@ -89,10 +91,10 @@ You can specify the following options for an embedded chart:
89
91
90
92
- A color hex code
91
93
- A |css| color name
92
- - `` transparent`` for a transparent background
94
+ - A transparent background using the value ``transparent``
93
95
94
- If you don't provide the background the background color defaults
95
- to the current ``theme``:
96
+ If omitted, the background color defaults to the current
97
+ ``theme``:
96
98
97
99
- ``#FFFFFF`` for the ``light`` theme, or
98
100
- ``#21313C`` for the ``dark`` theme.
@@ -135,7 +137,7 @@ You can specify the following options for an embedded chart:
135
137
136
138
* - ``height``
137
139
- number
138
- - Height of the chart. If you don't provide the height , the chart defaults to
140
+ - Height of the chart. If omitted , the chart defaults to
139
141
the height of its container. If you provide a value without units,
140
142
the unit defaults to pixels (px).
141
143
- no
@@ -147,6 +149,12 @@ You can specify the following options for an embedded chart:
147
149
|charts| renders the chart with data from the cache if
148
150
the data is less than one hour old.
149
151
152
+
153
+
154
+ If the data from the cache is more than one hour old,
155
+ |charts-short| queries the data source for the latest data,
156
+ refreshes the cache, and renders the chart using this data.
157
+
150
158
To learn how |charts| loads data from the cache when
151
159
loading or refreshing the chart based on the
152
160
``autoRefresh`` and ``maxDataAge`` values, see
@@ -185,9 +193,9 @@ You can specify the following options for an embedded chart:
185
193
- number
186
194
- Width of the chart.
187
195
188
- If you don't provide the width , the chart defaults to
196
+ If omitted , the chart defaults to
189
197
the width of its container. If you provide a value without units,
190
- the unit defaults to pixels (px).
198
+ it defaults to pixels (px).
191
199
- no
192
200
193
201
Chart Configuration
@@ -199,69 +207,74 @@ After you create a chart, you can control the configuration
199
207
of the chart by calling methods on the ``Chart`` instance returned
200
208
by ``ChartsEmbedSDK.createChart({ ... })``.
201
209
202
- .. list-table::
203
- :header-rows: 1
204
- :stub-columns: 1
205
- :widths: 40 60
210
+ ``getCustomizableAxes()``
211
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
206
212
207
- * - Method
208
- - Description
213
+ Returns the chart axes for the embedded chart.
209
214
210
- * - ``getCustomizableAxes( )``
211
- - Returns the chart axes for the embedded chart.
215
+ ``setAutoRefresh(boolean )``
216
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
212
217
213
- * - ``setAutoRefresh(boolean)``
214
- - Specifies whether the chart automatically refreshes. If
215
- omitted, charts don't automatically refresh.
218
+ Specifies whether the chart automatically refreshes. If
219
+ omitted, charts don't automatically refresh.
216
220
217
- Use this method with the ``setMaxDataAge`` method to
218
- configure how often the chart refreshes.
219
-
220
- * - ``setFilter(object)``
221
- - Applies a :ref:`query filter <filter-embedded-charts>`
222
- to the embedded chart or chart within an
223
- :ref:`embedded dashboard <embedding-dashboards>`. This
224
- method expects an object that contains valid query
225
- operators. Any fields referenced in this filter must be
226
- added to the :guilabel:`Allowed filter fields`
227
- list in the ``Embed Chart`` modal window.
228
- An empty document ``{}`` is equivalent to no filter.
229
-
230
- See the :ref:`Embedding Tutorials
231
- <embedding-tutorials>` for
232
- more information about enabling embedding for a chart
233
- and allowing fields for filter use.
234
-
235
- * - ``setMaxDataAge(number)``
236
- - Specifies the maximum age of data to load from the cache
237
- when loading or refreshing the chart. If omitted,
238
- |charts| renders the chart with data from the cache if
239
- the data is less than one hour old.
221
+ Use this method with the ``setMaxDataAge`` method to
222
+ configure how often the chart refreshes.
240
223
241
- To learn how |charts| loads data from the cache when
242
- loading or refreshing the chart based on the
243
- ``setAutoRefresh`` and ``setMaxDataAge`` values, see
244
- :ref:`refresh-behavior`.
224
+ ``setFilter(object)``
225
+ ~~~~~~~~~~~~~~~~~~~~~
226
+
227
+ Applies a :ref:`query filter <filter-embedded-charts>`
228
+ to the embedded chart or chart within an
229
+ :ref:`embedded dashboard <embedding-dashboards>`. This
230
+ method takes an object with valid query
231
+ operators. Any fields referenced in this filter must be
232
+ added to the :guilabel:`Allowed filter fields`
233
+ list in the ``Embed Chart`` modal window.
234
+ An empty document ``{}`` is equivalent to no filter.
235
+
236
+ See the :ref:`Embedding Tutorials <embedding-tutorials>` for
237
+ more information about enabling embedding for a chart
238
+ and allowing fields for filter use.
239
+
240
+ ``setMaxDataAge(number)``
241
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
242
+
243
+ Specifies the maximum age of data to load from the cache
244
+ when loading or refreshing the chart. If omitted,
245
+ |charts| renders the chart with data from the cache if
246
+ the data is less than one hour old.
247
+
248
+ If the data from the cache is more than one hour old,
249
+ |charts-short| queries the data source for the latest data,
250
+ refreshes the cache, and renders the chart using this data.
251
+
252
+ To learn how |charts| loads data from the cache when
253
+ loading or refreshing the chart based on the
254
+ ``setAutoRefresh`` and ``setMaxDataAge`` values, see
255
+ :ref:`refresh-behavior`.
256
+
257
+ ``setRenderingSpecOverride(object)``
258
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259
+
260
+ Specifies how to customize a chart.
245
261
246
- * - ``setRenderingSpecOverride(object)``
247
- - Specifies how to customize a chart.
262
+ For a list of available customizations, see
263
+ :ref:`rendering-spec-options`.
248
264
249
- For a list of available
250
- customizations, see :ref:`rendering-spec-options`.
265
+ ``setTheme("dark" | "light")``
266
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251
267
252
- * - ``setTheme("dark" | "light")``
253
- - Sets the current theme of the embedded chart. When setting the
254
- theme to ``dark``, you need to ensure that a chart's
255
- background color has appropriate contrast so that the information
256
- remains visible.
268
+ Sets the current theme of the embedded chart. When setting the
269
+ theme to ``dark``, you need to ensure that a chart's
270
+ background color has appropriate contrast so that the information
271
+ remains visible.
257
272
258
- .. seealso::
273
+ .. seealso::
259
274
260
- - `Charts Embedding SDK API Documentation
261
- <https://www.npmjs.com/package/@mongodb-js/charts-embed-dom>`__
275
+ - `Charts Embedding SDK API Documentation <https://www.npmjs.com/package/@mongodb-js/charts-embed-dom>`__
262
276
263
- - `Charts Embedding SDK examples
264
- <https://github.com/mongodb-js/charts-embed-sdk/blob/master/examples>`__
277
+ - `Charts Embedding SDK examples <https://github.com/mongodb-js/charts-embed-sdk/blob/master/examples>`__
265
278
266
279
Example
267
280
~~~~~~~
0 commit comments