# Events

The StockChart exposes a variety of [events](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/stockcharteventbuilder) that you can handle and further customize the behavior of the UI component.

For a complete example on basic Chart events, refer to the [demo on using the events of the Chart](https://demos.telerik.com/aspnet-core/chart-api/events).

## Handling by Handler Name

The following example demonstrates how to subscribe to events by a handler name.

```Razor HtmlHelper
    @(Html.Kendo().StockChart<StockDataPoint>()
         .Name("stockChart")
         .Events((Action<Kendo.Mvc.UI.Fluent.StockChartEventBuilder>)(e => e.Render("onDataBound")))
    )
```

```Razor TagHelper
    <kendo-stockchart name="stockChart" on-render="onRender">
    </kendo-stockchart>
```

```JavaScript
    <script>
        function onRender(e) {
            // Handle the "render" event.
        }
    </script>
```

## Handling by Template Delegate

The following example demonstrates how to subscribe to events by a template delegate.

```Razor HtmlHelper
    @(Html.Kendo().StockChart<StockDataPoint>()
         .Name("stockChart")
         .Events((Action<Kendo.Mvc.UI.Fluent.StockChartEventBuilder>)(e => e.Render(@<text>
                function() {
                    // Handle the render event inline.
                }
           </text>))
        )
    )
```

```Razor TagHelper
    <kendo-stockchart name="stockChart" 
                      on-render="function() {
                        // Handle the render event inline.
                      }">
    </kendo-stockchart>
```

## Next Steps

* [Binding the StockChart to Data](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/charts/stockchart/data-binding)
* [Creating a Stock History Dashboard (Demo)](https://demos.telerik.com/aspnet-core/financial/stock-history)

## See Also

* [Client-Side API of the StockChart](https://docs.telerik.com/kendo-ui/api/dataviz/ui/stock-chart)

* [Server-Side HtmlHelper API of the StockChart](https://www.telerik.com/aspnet-core-ui/documentation/api/stockchart)

* [Server-Side TagHelper API of the StockChart](https://www.telerik.com/aspnet-core-ui/documentation/api/taghelpers/stockchart)
