# hitTestSlice

Pie-only — hit-test slice at canvas-relative coordinates.

Canonical: https://chart.syidax.com/docs/methods/hitTestSlice/

<a id="definition"></a>

## Definition

```typescript
hitTestSlice(cssX: number, cssY: number): Promise<{ sliceIndex: number; sliceId: string } | null>
```

| Arguments | Type | Required |
| --- | --- | --- |
| `cssX` | `number` | Required |
| `cssY` | `number` | Required |

Return type: `Promise<{ sliceIndex: number; sliceId: string } | null>`. Call the method after element registration and await its Promise result.

<a id="related"></a>

## Related charts

- [sy-pie-chart](https://chart.syidax.com/docs/components/pie.md#method-hitTestSlice)
