2017-07-24 101 views
0

我正在尝试为我的图表设置工具提示。该值是一个百分比,但我希望“实际”数字不是显示百分比。字段名称是“moduleCount”,并且它具有正确的值。但是,当我将鼠标悬停在图表上时,我收到来自Angular的''moduleCount'undefined“错误。我假设我没有正确定义工具提示,因为'moduleCount'被定义并且有价值。Angularjs剑道图工具提示字段“未定义的错误”

我的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> 

任何帮助是非常感谢!

回答

0

想出这一个。我需要包含“dataItem”和该字段的名称。工作定义为:

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