New to Telerik UI for ASP.NET Core? Download free 30-day trial

Events

The StockChart exposes a variety of events 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.

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>

Next Steps

See Also

In this article