Skip to main content

chart.changeConfig()

Type: function(config)
Returns: Promise<void>

Change the configuration of the chart. Currently supported parameters are:

  • objectColor
  • objectLabel
  • numberOfPlacesToSelect
  • maxSelectedObjects
  • extraConfig
  • availableCategories
  • unavailableCategories
  • filteredCategories
  • pricing
  • channels

The chart is re-rendered after configuration changes.

chart.changeConfig({
objectColor: object => object.selectable ? 'green' : 'red'
});
chart.changeConfig({
objectLabel: object => object.label
});
chart.changeConfig({
numberOfPlacesToSelect: 3
});
chart.changeConfig({
numberOfPlacesToSelect: null // unset numberOfPlacesToSelect
});
chart.changeConfig({
maxSelectedObjects: 3
});
chart.changeConfig({
maxSelectedObjects: null // unset maxSelectedObjects
});
chart.changeConfig({
pricing: [
{ category: 1, price: 25 },
{ category: 2, price: 30 }
]
});
chart.changeConfig({
extraConfig: {
vipSeats: ['A-1', 'A-2', 'A-3']
}
});
chart.changeConfig({
unavailableCategories: ['Stalls', 'Choir'] // this will deselect objects that belong to an unavailable category
});
chart.changeConfig({
availableCategories: ['Stalls', 'Choir'] // this will deselect objects that belong to an unavailable category
});
chart.changeConfig({
filteredCategories: ['Stalls', 'Choir']
});
chart.changeConfig({
channels: ['54a1649b-732f-4fb9-9403-ef52dc2f7722'] // pass in `null` instead of an array to remove all configured channels
});