Kendo Barchart custom tooltip

1.4k views Asked by At

Is it possible to use a custom tooltip text from datasource?

i have a datasource schema like this:

           schema: {
                data: "d",
                model: {
                    fields: {
                        text: { type: "string" },
                        value: { type: "number" },
                        desc: { type: "string " }
                    }
                }
            }

and I want to use text for base bar values, and desc for tooltip so I have this configuration:

            series: [{
                field: "value",
                categoryField: "desc"
            }],
            categoryAxis: [{
                field: "text"
            }]

and in the tooltip configuration:

            tooltip: {
                visible: true,
                template: "#= category # : #= value # minutes"
            }

this configuration does not seem to work. Is there any way I can use desc field only for tooltip?

1

There are 1 answers

0
Jarosław Kończak On BEST ANSWER

Just use dataItem object in kendo template:

tooltip: {
    visible: true,
    template: "#= dataItem.desc # minutes"
}

Here is dojo example: http://dojo.telerik.com/IYOZO.