条形图中的提示未显示html特殊字符(例如<cable>)中的文本

时间:2015-10-09 07:21:02

标签: javascript jquery wijmo

提示未显示'&lt;'之间的文字和'&gt;'

require(["wijmo.wijbarchart"], function () {$(document).ready(function () {
$("#wijbarchart").wijbarchart({
hint: {
content: function () {return  this.x + '<cable>' + '\n ' + this.y + '';}
/* here the axis labels enclosed in < and > are not displaying.*/
}

条形图中的提示未显示html特殊字符中的文字&lt;和&gt;

2 个答案:

答案 0 :(得分:0)

我认为它的三角括号填满了它。试试没有他们。如果它工作,那么你需要转义括号。

&lt;  and    &gt;

给你

'&lt;cable&gt;'

答案 1 :(得分:0)

您应首先转义括号,然后将isContentHtml设置为true。就像下面的代码一样:

hint: {
    isContentHtml: true,
    content: function () {
        return  this.x + '&lt;cable&gt;' + '\n ' + this.y + '';
    }
}