Can a Kendo chart legend automatically delete an empty series?

I have a Kendo user interface diagram (defined as a razor).

I could not find anything in the documentation, is it possible to establish a legend to ignore an empty series from the diagram data, or am I forced to add only the corresponding series to the diagram data?

+5
source share
1 answer

Although there is no option in the legend, there is an option in the objects of the series: visibleInLegend , this can be set dynamically against a collection or other logical test, for example:

new {
    category = "Some Category",
    value = Model.SomeCollection.Count,
    color = "#FF9900", //Amber
    visibleInLegend = Model.SomeCollection.Count > 0
}, 
+6
source

All Articles