I am trying to add percentages as labels to my Kendo bar chart - I have got this working for Pie Charts fine but the same code isn't working for bar charts. For the pie charts I use the .Template property of the label, and the "percentage" property is inherently available (I've not defined it in my model I'm binding to anywhere). This is what I am using for the series for my pie chart (working) :-
.Series(series => series
.Pie(model => model.Share, model => model.SiteSurveyed.ToString(), model => model.Color)
.Padding(0)
.Labels(labels => labels
.Visible(true)
.Template("#= category # - #= value # (#= kendo.format('{0:P}', percentage)#)")
.Align(ChartPieLabelsAlign.Column)
.Position(ChartPieLabelsPosition.Center)
)
)
And this is what I am using for my bar charts (not working - the UI just puts undefined in the label) :-
.Series(series => series
.Bar(d => d.Share, d => d.Color)
.Labels(labels => labels
.Visible(true)
.Template("#= value # (#= kendo.format('{0:P}', percentage)#)")
.Position(ChartBarLabelsPosition.Center)
)
)
Please can you advise how I can make this work.
Thanks, Mark