# selectSlice

Pie-only — select a slice by id or index.

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

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

## Definition

```typescript
selectSlice(idOrIndex: string | number, selected?: boolean): Promise<boolean>
```

| Arguments | Type | Required |
| --- | --- | --- |
| `idOrIndex` | `string \| number` | Required |
| `selected` | `boolean` | Optional |

Return type: `Promise<boolean>`. 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-selectSlice)
