# setWordWeight

Word-cloud-only — set a word's weight.

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

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

## Definition

```typescript
setWordWeight(idOrIndex: string | number, weight: number): Promise<boolean>
```

| Arguments | Type | Required |
| --- | --- | --- |
| `idOrIndex` | `string \| number` | Required |
| `weight` | `number` | Required |

Return type: `Promise<boolean>`. Call the method after element registration and await its Promise result.

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

## Related charts

- [sy-word-cloud](https://chart.syidax.com/docs/components/word-cloud.md#method-setWordWeight)
