objectLabel

Type: function(object, defaultLabel, extraConfig)
Default: no label

A function that determines the label that's rendered inside an object on the chart. Can be based on object.status, object.category, object.isSelectable() or on other criteria. By default, no label is shown.

The size of an object label is calculated automatically, based on the size of the object. For tables and booths, there usually is more than enough space. For seats, however, you'll probably want to limit the label to 3 characters maximum, or else the label will become too small to read without zooming in.

Multi-line labels are not supported.

The parameters that are passed to objectLabel are:

  • object: the current object
  • defaultLabel: the default object label (i.e. an empty string)
  • extraConfig: see extraConfig
Warning

this function is called for each object on the chart; make sure it's fast, or chart rendering times will suffer. Avoid using slow methods such as Array.indexOf. Read more here.

info

To show seat labels, pass in

objectLabel: object => object.labels.own