I have a requirement for BOTH axes to show a string label. My problem is that I need the value axis to show a string label the way the category axis does by default. The column chart below renders the tooltips correctly when I use the: template: "#= dataItem.ProductName #". If I try to use the dataItem property in the LABELS template section, it's not there. I realize that the value axis must be numeric. That is fine. What I need is to replace the y-axis numeric value label with it's non-numeric label contained in the model. There simply must be a way to intercept that label and convert it to a string. For example.. template : #= (value==3) ? 'string' : 'string' # . Or maybe an event, even an internal event. Do I have to examine the chart AFTER it is rendered and find labels and then replace them with jQuery?
The model is
CategoryName(string) category axis
ProductName(string) // need THIS label
ProductId(int) //value axis
The model is
CategoryName(string) category axis
ProductName(string) // need THIS label
ProductId(int) //value axis
$("#Chart").kendoChart({
theme: "default",
title: {
text: "Product Categories"
},
legend: {
position: "bottom"
},
seriesDefaults: {
type: "column"
},
series: [{
name: "Product",
field: "ProductId"
}],
valueAxis: {
labels: {
template: "#=value#" // I need to replace with a NAME
// template: "#= dataItem.ProductName #" // this does NOT work
}
},
categoryAxis: {
field: "CategoryName"
},
tooltip: {
visible: true,
template: "#= dataItem.ProductName #" // THIS works
},
... omitted