Trigger function when Picker changes

Hi,


I have a picker of style SegmentedPickerStyle and based on the selection (Inbound, Outbound) a chart below displays different data. How can I send an event to my chart model to reload the data based on the picker selection? I know how to send the picker value to the model but how do I trigger it every time when the picker changes?


I have tried something like


SunburstView(configuration: self.sunburstController.configuration).onAppear{
  self.sunburstController.loadNodes(countMode: self.selectedCountMode, direction: self.selectedDirection)
  }


but that obviously only works first time the view is loading and not after every picker change.


Thanks for any hints!


Max

Trigger function when Picker changes
 
 
Q