I have a similar post here https://www.telerik.com/forums/ideas-for-visualisation where we discuss the problem but the crux of the matter is that we want to be able to change the labels on a stacked bar chart after the render process. Does anyone know if this is possible?
1 Answer, 1 is accepted
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 29 Apr 2021, 07:10 PM
Hello Andrew,
There are a few label configurations in regards to the Kendo UI Stacked Bar Chart, so I have created a Progress Kendo UI Dojo where when the user presses a button, the labels will change using their templates in the legend, categoryAxis, valueAxis, and series.
$("#btnChange").kendoButton({
click: function(e){
//Reference the Kendo UI Chartvar chart = $("#chart").data("kendoChart");
//Change Legend labels
chart.options.legend.labels.template = "Legend: #: text #";
//Change ValueAxis Labels
chart.options.valueAxis.labels.template = "ValueAxis: #: value #";
//Change CategoryAxis Labels
chart.options.categoryAxis.labels.template = "CategoryAxis: #: value #";
//Change series.labels values in stack
chart.options.seriesDefaults.labels.template = "Series: #: value #";
//Repaints chart with newly loaded data
chart.redraw();
}
});
There are other options for changing the labels like color, background, and border. For example, the seriesDefaults.labels has a number of related properties which can be modified.
I hope this information helps! Please let me know if you have any questions regarding the label changes.