11.. _embedded-chart-sdk-options:
22.. _sdk-option-reference:
33
4- ====================
5- Embedded SDK Options
6- ====================
4+ ===========================
5+ Embedded Charts SDK Options
6+ ===========================
77
88.. default-domain:: mongodb
99
@@ -56,12 +56,14 @@ interval and other aspects.
5656 });
5757 await chart.render(embedContainer);
5858
59+ .. _embedded-charts-options-table:
60+
5961Embedded Chart Options
6062----------------------
6163
6264.. please keep these alphabetized
6365
64- You can specify the following options for an embedded chart :
66+ The ``createChart()`` method takes the following options:
6567
6668.. list-table::
6769 :header-rows: 1
@@ -79,7 +81,7 @@ You can specify the following options for an embedded chart:
7981 omitted, charts don't automatically refresh.
8082
8183 Use this option with the ``maxDataAge`` option to
82- configure how often the chart refreshes.
84+ configure automatic dashboard refresh frequency.
8385 - no
8486
8587 * - ``background``
@@ -89,10 +91,10 @@ You can specify the following options for an embedded chart:
8991
9092 - A color hex code
9193 - A |css| color name
92- - `` transparent`` for a transparent background
94+ - A transparent background using the value ``transparent``
9395
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``:
9698
9799 - ``#FFFFFF`` for the ``light`` theme, or
98100 - ``#21313C`` for the ``dark`` theme.
@@ -135,7 +137,7 @@ You can specify the following options for an embedded chart:
135137
136138 * - ``height``
137139 - 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
139141 the height of its container. If you provide a value without units,
140142 the unit defaults to pixels (px).
141143 - no
@@ -147,6 +149,12 @@ You can specify the following options for an embedded chart:
147149 |charts| renders the chart with data from the cache if
148150 the data is less than one hour old.
149151
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+
150158 To learn how |charts| loads data from the cache when
151159 loading or refreshing the chart based on the
152160 ``autoRefresh`` and ``maxDataAge`` values, see
@@ -185,9 +193,9 @@ You can specify the following options for an embedded chart:
185193 - number
186194 - Width of the chart.
187195
188- If you don't provide the width , the chart defaults to
196+ If omitted , the chart defaults to
189197 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).
191199 - no
192200
193201Chart Configuration
@@ -199,69 +207,74 @@ After you create a chart, you can control the configuration
199207of the chart by calling methods on the ``Chart`` instance returned
200208by ``ChartsEmbedSDK.createChart({ ... })``.
201209
202- .. list-table::
203- :header-rows: 1
204- :stub-columns: 1
205- :widths: 40 60
210+ ``getCustomizableAxes()``
211+ ~~~~~~~~~~~~~~~~~~~~~~~~~
206212
207- * - Method
208- - Description
213+ Returns the chart axes for the embedded chart.
209214
210- * - ``getCustomizableAxes( )``
211- - Returns the chart axes for the embedded chart.
215+ ``setAutoRefresh(boolean )``
216+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
212217
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.
216220
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.
240223
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.
245261
246- * - ``setRenderingSpecOverride(object)``
247- - Specifies how to customize a chart.
262+ For a list of available customizations, see
263+ :ref:`rendering-spec-options`.
248264
249- For a list of available
250- customizations, see :ref:`rendering-spec-options`.
265+ ``setTheme("dark" | "light")``
266+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251267
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.
257272
258- .. seealso::
273+ .. seealso::
259274
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>`__
262276
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>`__
265278
266279Example
267280~~~~~~~
0 commit comments