How to change Chart Theme dynamically

3 posts, 1 answers
  1. Chris
    Chris avatar
    26 posts
    Member since:
    Mar 2016

    Posted 22 Feb 2017 Link to this post

    I am attempting to change the chart theme dynamically, but am having some trouble.

    I am successfully able to change the Kendo.[theme].min.css sheet on a dropdownlist that dynamically changes the site's kendo widgets. However, this does not propagate to the charts inside the site, but instead sets the theme to "default". I have also tried to set the theme via JavaScript to no avail.

    However, if i set the theme statically in the widget using the html helper, it obviously works and changes the theme.

    Any ideas?

    $("#chart").data("kendoChart").options.theme = localStorageItem;
    //localStorageItem = "flat" for example.
  2. Answer
    Daniel
    Admin
    Daniel avatar
    2231 posts

    Posted 24 Feb 2017 Link to this post

    Hi,

    You should use the setOptions method to change the theme - example.

    Regards,
    Daniel
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Chris
    Chris avatar
    26 posts
    Member since:
    Mar 2016

    Posted 05 Apr 2017 in reply to Daniel Link to this post

    Thank you very much Daniel. It works well!
Back to Top