Sharing data across components
When a map, chart, and/or feature table use the same layer, pass the same layer instance to each component so they share the same underlying data and state.
arcgis-feature-table: Setmap-layer-idandreference-elementto use a layer from the map component.arcgis-chart:- In SDK v5.2 or later, set
reference-elementto the map component's ID andmap-layer-idto the layer'sid, not its portal item ID. A chart inside the map component can omitreference-element. - Set
chart-indexto select a saved chart. If omitted, the first chart is used. An out-of-range index also uses the first chart and emits a warning. layer-item-idsearches the connected map for a matching portal item ID first. If no layer matches, it creates a separate layer from the portal item.- For older SDKs or layers inside group layers, set
layerto the map's layer instance andviewto the map's view. The ID lookup added in SDK 5.2 searches only top-level layers. - When setting
modeldirectly, use one of the layer's savedchartsentries. Setlayer,view, and render options first. Clearmodelin teardown so a re-render does not leave an orphaned chart instance. - Check that the chart's layer is in the map:
viewElement.map.allLayers.includes(chartElement.layer). UseallLayers, notlayers, which omits layers nested in group layers.
- In SDK v5.2 or later, set