Options for individual legend entry.

Hierarchy

  • LegendEntryOptions

Properties

buttonFillStyle?: FillStyle

FillStyle for the entry button.

buttonRotation?: number

Rotation of the entry button in degrees.

buttonShape?: Icon | PointShape

Entry button shape.

buttonSize?: number

Entry button size.

buttonStrokeStyle?: LineStyle

LineStyle for the entry button.

events?: {}

Event callbacks for the entry. Can be used to add entry specific event handlers:

 // Example syntax, click handler for all legend entries
const chart = lc.ChartXY({
legend: {
entries: {
events: {
click: (event, info) => {}
}
}
}
})
 // Example syntax, click handler for a specific entry
chart.legend.setEntryOptions(series, {
events: {
click: (event, info) => {}
}
})

Most frequently used event keys:

  • 'click'
  • 'contextmenu'
  • 'pointerenter'
  • 'pointermove'
  • 'pointerleave'

Type declaration

    highlight?: boolean

    Highlighting on hover enabled?

    lut?: null | LUT

    LUT element to be displayed on the legend. By default, LUT is automatically displayed if the associated entry is styled using a LUT. This behavior can be prevented by setting lut to null.

     // Example syntax, prevent LUT from being displayed in legend
    const chart = lc.ChartXY({
    legend: {
    entries: {
    lut: null
    }
    }
    })
    lutDisplayProportionalSteps?: boolean

    Whether distances between LUT step values are displayed, or if the displayed LUT steps should be split equal distances apart.

    lutLength?: number

    Length of the LUT element as pixels.

    lutStepValueFormatter?: ((step: LUTStep, lut: LUT) => string)

    Type declaration

      • (step: LUTStep, lut: LUT): string
      • Callback function for LUT element value formatting.

        Parameters

        Returns string

    lutThickness?: number

    Thickness of the LUT element as pixels.

    matchStyleExactly?: boolean

    Whether buttonFillStyle should be matched exactly with the style of the represented component.

    Defaults to false, which results in button fill style being displayed as a linear gradient calculated around the represented component color.

    show?: boolean

    Whether to show the entry on the legend.

    text?: string

    Text to be displayed on the legend entry.

    textFillStyle?: FillStyle

    FillStyle for the entry text.

    textFont?: Partial<FontSettings>

    FontSettings for the entry text.