kendo ui总是在饼图angularjs上显示工具提示

时间:2018-03-22 06:28:28

标签: javascript angularjs html5 charts kendo-ui

我使用kendoui创建了一个饼图,参考telerik上面的链接: -

https://demos.telerik.com/kendo-ui/pie-charts/angular

  

我试图在创建的饼图上显示工具提示,该工具提示将始终显示   没有悬停在饼图上。

我在下面提到了一些页面,但未找到任何解决方案: -

  1. https://demos.telerik.com/kendo-ui/line-charts/local-data-binding

  2. Kendo UI Chart - Want tooltip to always show

  3. http://dojo.telerik.com/@Iliana/OnINu

  4. Kendo-ui tooltip in Angularjs

  5. 我的代码如下: -

    
    
    <!-- Pie chart -->
    <div class="demo-section k-content" ng-if="widget.id === 'pie'" id="widgetPie">
        <div id="pieWrapper">
            <div kendo-chart
                k-rebind="firmwareDevices"
                k-title="{ text: 'SLC Firmware Distribution', position: 'top' }"
                k-series-defaults="{ type: 'pie', labels: { visible: true }}"
                k-series="[{
                                field: 'doc_count',
                                name: 'SLC',
                                categoryField: 'key',
                                padding: 0,
                                color: '#b8b8b8'
                            }]"
                k-data-source="deviceObject"
                k-series-hover="onSeriesHover"
                k-series-colors="['#66b3ff', '#b2d9ff']"
                k-tooltip="{ visible: true, template: '#= category # device_count: #= value #' }"
                k-legend = "{ position: 'left' }",
                style="height: 270px; width:450px;"
                id="ltxPie">
            </div>
        </div>
    </div> 
    &#13;
    &#13;
    &#13;

1 个答案:

答案 0 :(得分:0)

参考下面的演示示例:

http://demos.telerik.com/kendo-ui/line-charts/local-data-binding

尝试按如下方式设置k系列默认值: -

&#13;
&#13;
 k-series-defaults="{ type: 'pie', 
                      labels: {
                          visible: true,
                          format: '{0}%',
                          background: 'transparent'
                      }
                     }"
&#13;
&#13;
&#13;