Kendo-ui tooltip in Angularjs

被刻印的时光 ゝ 提交于 2019-12-25 07:59:37

问题


I wrote a simple kendo-ui app, which displays a pie chart from JSON. I used AngularJS and i couldn't find a reference on how to display a tooltip when the user hovers on the chart.

Coding snippet:

<div kendo-chart
                 k-title="{ text: 'DemoProg', position: 'bottom' }"
                 k-series-defaults="{ type: 'pie' }"
                 k-series="[{
                                field: 'solar',
                                categoryField: 'year',
                                padding: 0
                              }]"
                 k-data-source="yearSource"
                 k-series-hover="onSeriesHover"
                 ></div>

and i also found out in the official tutorial page, we can show the tooltip by setting it's visibility to true but it's in jQuery.

tooltip: {
                    visible: true,
                    format: "{0}%"
                }

My question is how can we show a tooltip in angularjs? Any help would be appreciated. Thank you.


回答1:


Just add the k-tooltip attribute:

<div kendo-chart
             k-title="{ text: 'DemoProg', position: 'bottom' }"
             k-series-defaults="{ type: 'pie' }"
             k-series="[{
                            field: 'solar',
                            categoryField: 'year',
                            padding: 0
                          }]"
             k-data-source="yearSource"
             k-series-hover="onSeriesHover"
             k-tooltip="{visible: true, format: '{0}%'}">
</div>


来源:https://stackoverflow.com/questions/28164886/kendo-ui-tooltip-in-angularjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!