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
  • listings
  • listingTypes

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
});
// Note that showSectionPricingOverlay is currently not supported in changeConfig, and has no effect.
chart.changeConfig({
pricing: {
priceFormatter: price => price + '€',
prices: [
{ 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
});
// Update the chart's listings. See https://docs.seats.io/docs/renderer/config-listings
chart.changeConfig({
listings: [
{ id: 'vip', objects: ['A-1', 'A-2'], listingType: 'premium' }
]
});
chart.changeConfig({
listings: [] // pass in an empty array to remove all listings
});
// Update the chart's listing types. See https://docs.seats.io/docs/renderer/config-listingtypes
chart.changeConfig({
listingTypes: {
premium: { icon: 'star', label: 'Premium' }
}
});