I have a chart, which uses the group function, in order to display a dynamic number of series. Unfortunately, in order for this to work properly, each series must contain a record for each category (in this case, month). If not, columns are displayed in the incorrect category, and the chart has missing x-axis labels.
However, I also want each column to have a label showing the value, but the chart also shows labels for the 0 value items.
How can I remove these zero labels (or show dynamic series without adding the values in, in the first place!)?
The chart definition is:-
@(Html.Kendo().Chart<WLI_Payments.Models.SummaryChartItem3>()
.Name(
"SummaryDirectorateChartThree"
)
.Title(ti => ti.Text(
"Requests by Month and Type"
).Font(
"11px Arial"
))
.Theme(
"bootstrap"
)
.Legend(l => l.Visible(
true
).Position(ChartLegendPosition.Bottom))
.ChartArea(c => c.Background(
"transparent"
).Height(250))
.DataSource(ds => ds.Read(read => read.Action(
"GetRequestTypeData"
,
"Dashboard"
))
.Group(g => g.Add(v => v.RequestTypeDescription))
.Sort(s =>
{
s.Add(
"Year"
).Ascending();
}
)
)
.Series(series =>
{
series.Column(model => model.YIntValue).Name(
"#=group.value#"
).Spacing(0).Labels(l => l.Visible(
true
).Font(
"9px Arial"
));
})
.CategoryAxis(axis => axis
.Categories(model => model.Month)
.Labels(labels => labels.Rotation(-45).Font(
"10px Arial"
))
.MajorGridLines(lines => lines.Visible(
false
))
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Font(
"10px Arial"
))
)
.Tooltip(tooltip => tooltip
.Visible(
true
)
.Background(
"White"
)
.Template(
"#=tooltipTemplate3(dataItem)#"
)
)
.Pannable(p => p.Lock(ChartAxisLock.Y))
.Zoomable(zoomable => zoomable
.Mousewheel(mousewheel => mousewheel.Lock(ChartAxisLock.Y))
.Selection(selection => selection.Lock(ChartAxisLock.Y))
)
)
Thanks