Events
The StockChart exposes a variety of events that you can handle and further customize the behavior of the UI component.
Handling by Handler Name
The following example demonstrates how to subscribe to events by a handler name.
@(Html.Kendo().StockChart<StockDataPoint>()
.Name("stockChart")
.Events((Action<Kendo.Mvc.UI.Fluent.StockChartEventBuilder>)(e => e.Render("onDataBound")))
)
<kendo-stockchart name="stockChart" on-render="onRender">
</kendo-stockchart>
<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.
@(Html.Kendo().StockChart<StockDataPoint>()
.Name("stockChart")
.Events((Action<Kendo.Mvc.UI.Fluent.StockChartEventBuilder>)(e => e.Render(@<text>
function() {
// Handle the render event inline.
}
</text>))
)
)
<kendo-stockchart name="stockChart"
on-render="function() {
// Handle the render event inline.
}">
</kendo-stockchart>