【问题标题】:Angularjs Kendo Chart Tooltip field "undefined error"Angularjs Kendo 图表工具提示字段“未定义的错误”
【发布时间】:2017-07-24 16:56:27
【问题描述】:

我正在尝试为我的图表设置工具提示。该值是一个百分比,但我想要“实际”数字而不是要显示的百分比。字段名称是“moduleCount”,其中包含正确的值。但是,当我将鼠标悬停在图表上时,我收到来自 Angular 的“'moduleCount'未定义”错误。我假设我没有正确定义工具提示,因为“moduleCount”已定义并具有价值。

我的 HTML:

<div kendo-chart
                     k-series-defaults="{type: 'column', labels:{visible: true, background: 'transparent', field: 'modulePercentage', format:'p0', template: '#= value#%'}}"
                     k-series="[{field: 'modulePercentage', colorField: 'BackGroundColor', name: 'SSQScore', type: 'pie'}]"
                     k-plot-area="{margin:{top: 5, left: 25, right: 25, bottom: 5}}"
                     k-category-axis="{field: 'Score', labels:{font: 'bold 8px sans-serif', rotation: '-45'},majorGridLines:{visible: true}, line:{visible: true}}"
                     k-value-axis="{majorGridLines: {visible: true}, visible: true}"
                     k-tooltip="{visible: true,format: '{0}',template: '#=moduleCount #'}"
                     k-data-source="contractorStatus">

                </div>

非常感谢任何帮助!

【问题讨论】:

    标签: angularjs kendo-chart


    【解决方案1】:

    想出了这个。我需要在字段名称中包含“dataItem”。工作定义是:

     k-tooltip="{visible: true,format: '{0}',template: ' #=dataItem.moduleCount # '}"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多