# `ECharts.Events`
[🔗](https://github.com/Mateus-M-Reis/echarts/blob/main/lib/echarts/events.ex#L1)

Names of the ECharts browser events that the integrations can forward.

Every name works with the `:events` option of `ECharts.new/2`. Pass `:all`
to forward all of the events listed by `all/0`, or pass an explicit list to
keep the event traffic minimal.

    chart = ECharts.new(option, events: [:click, :datazoom])
    ECharts.new(option, events: :all)

The payload delivered to LiveView (`handle_event/3`) and to Livebook
subscribers is a map with `"type"` (the event name) and `"data"` (a
JSON-safe summary of the ECharts parameters). The summary keeps the fields
that are useful for interaction — `seriesIndex`, `seriesName`, `name`,
`dataIndex`, `data`, `value`, `percent`, `start`, `end`, `selected` — plus
the cursor position as `"x"`/`"y"` when the browser event provides it.

# `all`

```elixir
@spec all() :: [String.t()]
```

Returns every event name known to this library.

# `defaults`

```elixir
@spec defaults() :: [String.t()]
```

Returns the default events forwarded by the integrations.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
