Search code examples
javascriptkendo-uikendo-datavizkendo-chart

How to set a category axis title dynamically?


I need to set a Kendo UI stock chart category axis and value axis titles dynamically using options or setoptions.

Can any one provide me a working example?


Solution

  • You can dynamically change the titles like this:

    var stockChart = $("#stock-chart").data("kendoStockChart");
    stockChart.options.valueAxis[0].title.text = "Your new value axis title here";
    stockChart.options.categoryAxis[0].title.text = "Your new column axis title here";
    stockChart.refresh();