paneDefaults.title.visualFunction
A function that can be used to create a custom visual for the title. The available argument fields are:
- text - the label text.
- rect - the
kendo.geometry.Rectthat defines where the visual should be rendered. - sender - the chart instance (may be undefined).
Example - set the default pane title visual
<div id="chart"></div>
<script>
$("#chart").kendoChart({
series: [
{ data: [1, 2, 3] },
{ data: [1, 2, 3, 4], axis: "bottom" }
],
valueAxis: [
{ pane: "top-pane" },
{ pane: "bottom-pane", name: "bottom" }
],
paneDefaults: {
title: {
visual: function(e) {
var rect = new kendo.geometry.Rect(e.rect.origin, [200, 30]);
var layout = new kendo.drawing.Layout(rect, {
spacing: 5,
alignItems: "center"
});
var text = new kendo.drawing.Text(e.text, [0, 0], {
fill: {
color: "red"
}
});
layout.append(text);
return layout;
}
}
},
panes: [
{ name: "top-pane",
title: {
text: "Top"
}
},
{ name: "bottom-pane",
title: {
text: "Bottom"
}
}
]
});
</script>
- options - the label options.
- createVisual - a function that can be used to get the default visual.
In this article