Open this page in the API Guide
Legend.invalidateCustomLegendItems Method
Notifies the legend of changes to the order of customLegendItems.
Remarks
This method does not replace calling addCustomItems or removeCustomItems when
adding or removing custom legend items.