Class ODSChartsLegendHolderDefinition

Definition of a container used to display legends.

Example of use:

themeManager.externalizeLegends(
myChart,
[{ legendHolderSelector: '#results_stack_legend', seriesRef: ['result'], orientation: 'vertical' },
{ legendHolderSelector: '#goals_stack_legend', seriesRef: ['goals'], orientation: 'vertical' },
{ legendHolderSelector: '#line_legend' }]
);

Constructors

  • Parameters

    • legendHolderSelector: string

      Legends container CSS selector

    • Optionalorientation: "vertical" | "horizontal"

      Optionally indicates whether captions are displayed horizontally or vertically. By default, the value of the legend.orient option in Apache ECharts will be used. If legend.orient does not exist, the default value will be 'horizontal'.

    • OptionalseriesRef: string[]

      Array referencing the series whose legends are to be displayed in this legend container. The reference can be the series name, the series label or simply the stack name in the case of stacked bars. If seriesRef is absent, this container will be the default container for non-referenced legends.

    Returns ODSChartsLegendHolderDefinition

Properties

legendHolderSelector: string

Legends container CSS selector

orientation?: "vertical" | "horizontal"

Optionally indicates whether captions are displayed horizontally or vertically. By default, the value of the legend.orient option in Apache ECharts will be used. If legend.orient does not exist, the default value will be 'horizontal'.

seriesRef?: string[]

Array referencing the series whose legends are to be displayed in this legend container. The reference can be the series name, the series label or simply the stack name in the case of stacked bars. If seriesRef is absent, this container will be the default container for non-referenced legends.