本帖最后由 alu 于 2017-5-24 11:30 编辑 为什么自定义标签的标记位置是错误的? 在单元格图表使用了标签自定义函数后,数字标签的标记位置是错误的:第11名的数字标签被标记到了第10个数据点上(图1) 标签自定义函数: function(){if(this.value==$("td[id^=R4-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top1-18.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R5-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top2-19.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R6-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top3-20.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R7-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top4.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R8-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top5.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R9-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top6.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R10-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top7.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R11-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top8.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R12-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top9.png" ></td> </tr></table>'; else if(this.value==$("td[id^=R13-]").text()) return '<table style="width:100%;height:100%;"> <tr valign=middle align=center> <td><img src ="picture/icon_top10.png" ></td> </tr></table>'; else return this.value;} 图1: 数据表: |