Hide a series without changing valueAxis

2 posts, 0 answers
  1. El Nacho
    El Nacho avatar
    16 posts
    Member since:
    May 2014

    Posted 04 Dec 2015 Link to this post

    Hi, when i use the label buttons to hide a series the valueAxis adjusts to the remaining series and it changes the proportion of areas which looks really weird in a graph that doesn't even show the valueAxis like the one i have in production. I've found a workaround and i have it in this dojo but it feels kinda hacky and weird, is there a simpler way to maintain the valueAxis value and hide a series from the user view?.

     the code of the solution is this:

    function onLegendItemClick(e) {
        var serie = e.sender.options.series[e.seriesIndex]
        serie.opacity = serie.opacity === 0 ? 0.4 : 0;
        serie.markers.size = serie.markers.size === 0 ? 6 : 0;
        serie.tooltip.visible = serie.tooltip.visible === false ? true : false;
        var chart = $("#chart").data("kendoChart");

  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 08 Dec 2015 Link to this post

    Hi Joseph,

    As another option I would suggest setting axis min / max values. For your convenience here is the updated dojo.

    Iliana Nikolova
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top