This is a migrated thread and some comments may be shown as answers.

Hide a series without changing valueAxis

1 Answer 35 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 04 Dec 2015, 05:59 PM

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) {
    e.preventDefault();
    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");
    chart.refresh();
    console.log(serie);
    console.log(e.sender);
}

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 08 Dec 2015, 01:44 PM
Hi Joseph,

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

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Ryan
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or