Hi,
I was wondering if there is a way of hiding a label if all the values in that series are either zero or null? For example I've got a test block of code below:
This is all fine and works as I'd expect however in my test data WebSite02 is all NULL and WebSite06 is all 0.00 value so there is no point in showing this information on a label, see the diagram attached. What I would like to do is hide the label for Website02 and Website06 as they will clutter the chart and in my real world example I could have 70+ items in there!
I've tried doing this from Javascript but run into issues getting a tool tip working as well as putting custom labels in under the chart so due to time constraints am settling with this way for this version.
If it helps, I've also included a screen grab of the raw data.
Thanks in advance
Mike
I was wondering if there is a way of hiding a label if all the values in that series are either zero or null? For example I've got a test block of code below:
@(Html.Kendo().Chart(Model)
.Name(
"ChartTest"
)
.Legend(l => l.Visible(
true
))
.Series(series =>
{
series.Column(x => x.WebSite01);
series.Column(x => x.WebSite02);
series.Column(x => x.WebSite03);
series.Column(x => x.WebSite04);
series.Column(x => x.WebSite05);
series.Column(x => x.WebSite06);
series.Column(x => x.WebSite07);
series.Column(x => x.WebSite08);
series.Column(x => x.WebSite09);
}
)
.SeriesDefaults(s => s.Column().Stack(
true
))
.Legend(l => l.Position(ChartLegendPosition.Bottom))
.CategoryAxis(axis => axis
.Categories(model => model.ChartDateStamp)
.MajorGridLines(lines => lines.Visible(
false
))
.Labels(l =>
{
l.Format(
"MM/yy"
);
l.Rotation(90);
})
)
.Tooltip(t => t
.Visible(
true
)
.Color(
"#FFFFFF"
)
.Background(
"#0000CC"
)
.Template(
"${series.name} : #= kendo.toString(value, 'n') #"
)
)
)
This is all fine and works as I'd expect however in my test data WebSite02 is all NULL and WebSite06 is all 0.00 value so there is no point in showing this information on a label, see the diagram attached. What I would like to do is hide the label for Website02 and Website06 as they will clutter the chart and in my real world example I could have 70+ items in there!
I've tried doing this from Javascript but run into issues getting a tool tip working as well as putting custom labels in under the chart so due to time constraints am settling with this way for this version.
If it helps, I've also included a screen grab of the raw data.
Thanks in advance
Mike