How to use children as decorators in charts
devStarting from version 5.0, chart components (and axes) accept React children to act as decorators. This replaces the old extras and decorators props.
Rules for using children:
- Component Type: All children must be a
react-native-svgcomponent to be rendered. - Ordering: The order in which you declare children determines the rendering order (z-index).
- Positioning: By default, children are rendered on top of the chart. To render a child below the chart, add the prop
belowChart={true}to the child component.
This pattern allows you to declare exactly how and where decorators should appear relative to the chart data.