Implement Touch Overlay and Info Boxes
mainTo enable interactive data inspection, use the following modifiers. Note that the visual behavior (where the box appears) is controlled by ChartStyle -> infoBoxPlacement within your chart data setup.
.touchOverlay(...): Detects touch or pointer input to find the nearest data point. Requires setup inChart Data -> Chart Style..infoBox(chartData:): Displays information from the touch overlay ifinfoBoxPlacementis set to.infoBox..floatingInfoBox(chartData:): Displays information from the touch overlay ifinfoBoxPlacementis set to.floating..headerBox(chartData:): Displays metadata (fromChart Data -> ChartMetadata) and touch overlay info ifinfoBoxPlacementis set to.header.
Touch Overlay Parameters:
chartData: The chart data model.specifier: Decimal precision for labels.unit: Unit to display before or after the value.
.touchOverlay(chartData: CTChartData, specifier: String, unit: TouchUnit)