externalizeLegends() configure the manager to externalize the legends from the graphs to put it directly in your HTML document.
The generated legends
the initialized eCharts object
legendHolderSelector can be:
the theme manager object itself to be able to chain calls.
externalizePopover() configure the manager to externalize the management of popover or tooltip.
The generated tooltips or popover will implement the Orange Design System.
the configuration of the externalizePopover feature ODSChartsPopoverConfig
Optional
popoverDefinition: ODSChartsPopoverDefinitionrenderer ODSChartsPopoverDefinition of the popover/tooltip. ODSChartsPopoverManagers is used to specify preconfigured renderer for Apache ECharts, Boosted 5 or Boosted 4.
Default value is ODSChartsPopoverManagers.NONE, that means it uses default Apache ECharts template to externalize tooltip/popover HTML element, implementing Orange Design system.
WARNING: Boosted 4 or Boosted 5 rendering requires dependency on the boosted library and access to the boosted global variable.
the theme manager object itself to be able to chain calls.
getChartOptions() build the eCharts options merging
indicates if the specificities of the global theme used in the chart init method must be added in the options of the chart
the Apache ECharts options to use in Apache Echarts setOption()
call.
manageChartResize() ensures that the graph resizes correctly when its container is resized
the initialized eCharts object.
an unique id that identify the chart container in the DOM.
the theme manager object itself to be able to chain calls.
manageThemeObserver() is used to enable auto-switch between dark and light mode. It observe the closest element with a data-bs-theme indicator to adapt the graph colour to the new theme.
the initialized eCharts object
returns back the theme manager object
Set the original Apache Echarts data options of your graph.
Example:
lineChartODSTheme
.setDataOptions({
xAxis: {
data: ['shirt', 'cardigan', 'chiffon', 'pants', 'heels', 'socks'],
},
series: [
{
name: 'sales',
type: 'bar',
data: [5, 20, 36, 10, 10, 20],
},
],
})
the Apache Echarts data options of your graph.
the theme manager object
Static
getEntry point of the library.
Once the library integrated, via
<script src="...ods-charts.js">
import \* as ODSCharts from 'ods-charts'
use ODSCharts.getThemeManager
(ODSChartsThemeOptions) to get the ODSChartsTheme.
It returns the generated theme manager.
Optional
options: ODSChartsThemeOptionsoptions used to generate the theme.
the theme manager. This manager is used to retrieve the Apache ECharts theme and manage the chart options in accordance with the Orange Design System. It is used to add features:
ODSChartsTheme is the object get by
ODSCharts.getThemeManager
(ODSChartsThemeOptions), refer to ODSChartsTheme.getThemeManagerThis manager is used to
See ODSChartsTheme.getThemeManager for details.