How to conditionally set chart axis title

2 posts, 0 answers
  1. Xiaoyi
    Xiaoyi avatar
    1 posts
    Member since:
    Oct 2015

    Posted 12 Jan 2016 Link to this post

    Hi, i am using MVC CHART CONTROL.  Is it possible set the categoryAxis title according to a dropdown list's selected value.

     when the user click the update button, It will call


     var ochart = $("#chart").data("kendoChart");;


    that works well and chart area will be updated accoriding settings. based on it, I would like to change the axis title as well. but if i tried to

    ochart.options.categoryAxis.title = "something else";

    the title just disappeared.

    I have spent a few hours on it. please anyone can give me a hand?



  2. Dimiter Topalov
    Dimiter Topalov avatar
    633 posts

    Posted 13 Jan 2016 Link to this post

    Hi Xiaoyi,

    The text property that you are referring to is one of the properties of the category-axis title object (you can get a reference to it by using "ochart.options.categoryAxis.title.text" instead of "ochart.options.categoryAxis.title").

    In order to set a new value to this property, you need to pass an object, containing the new options, to the setOptions method of the Kendo UI Chart:

    // in the handler of the submit button click event:
    categoryAxis: [
    title: {
    "Some text"

    If you would like to modify other properties of category axis title, you can just list them in the title object with their corresponding new values.

    I hope this helps.

    Dimiter Topalov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top