Hi there,
On my bar chart individual bars trigger JS code via the onSeriesClick which is working fine. If you hover over the bar it slightly changes the colour which is helpful so the end user knows it's clickable. However, sometimes bars are really short and it's therefore hard for them to tell they can click it and it's hard to click as it's such a small area to click.
I also have labels on each bar. I would like to extend the onSeriesClick event so that if you click the label it also triggers the event. I noticed it does this by default on high resolution screens, but on small screens this functionality seems to disappear.
Is it possible to make this behaviour work for all resolutions somehow?
Below is my view code, and I've attached a screenshot of the graph. The arrow on the screenshot is an example - the red bar is the only clickable part for low resolution screens, but I'd like to be able to click the label text over the top too to trigger the event.
@( Html.Kendo().Chart<Models.RecommendedActionItemsBarChartModel>()
.Name("recommendedActionItems")
.ChartArea(chartArea => chartArea.Background("#F5F5F5"))
.Title(title => title
.Text("Recommended Action Items")
.Position(ChartTitlePosition.Top))
.DataSource(ds => ds
.Read(read => read.Action("RecommendedActionItemsBarChart", "Reporting"))
.Group(g => g.Add(d => d.category))
)
.Series(series => series
.Bar(d => d.Share, d => d.Color).CategoryField("category")
.Name("#:group.value#")
.Stack(true)
.Labels(labels => labels
.Visible(true)
.Template("#= dataItem.category # #= value # (#= dataItem.PercentageField #)")
.Position(ChartBarLabelsPosition.InsideBase)
)
)
.CategoryAxis(axis => axis
.Visible(false)
)
.ValueAxis(axis => axis
.Numeric()
.Labels(labels => labels
.Visible(false)
)
)
.Tooltip(tooltip => tooltip
.Visible(false)
)
.Legend(legend => legend
.Visible(false)
.Position(ChartLegendPosition.Bottom)
.Labels(x => x.Font(font: "9px Arial,Helvetica,sans-serif"))
)
.Events(events => events
.SeriesClick("onSeriesClick_recActionItems")
.DataBound("onDataBound_recActionItems")
)
)
Thanks,
Mark