kvs
kvs

Reputation: 466

Kendo Custom tooltip for chart, returns tooltip's showing as Undefined

When using the event which allows us to custom the tooltips for a bar\line chart. The DataItem that is passed to the event is returned as Undefined . So, is there is property which I can be set that allows custom the tooltip, even when their is alot of pionts in a small area. Example: template: "#= dataItem.employeeName #"

 Any help would be appreciated.

Upvotes: 1

Views: 4138

Answers (2)

Vel
Vel

Reputation: 200

Try this One:

 tooltip: {
                        visible: true,
                        template: "#= dataItem.title #: #= dataItem.percentage #%"
                    }

For me it is working perfect. Let me know if any issue.

Upvotes: 0

CodingWithSpike
CodingWithSpike

Reputation: 43718

I think you are looking for the tooltip.template option:

$("#chart").kendoChart({
     tooltip: {
         visible: true,
         template: "#=employeeName#"
     }
});

You shouldn't need to specify dataItem before the field name. Also, try checking data instead of dataItem.

Upvotes: 3

Related Questions