Charts 编辑p:图表中的数据提示位置

Charts 编辑p:图表中的数据提示位置,charts,primefaces,tooltip,jqplot,Charts,Primefaces,Tooltip,Jqplot,我正在使用PrimeFaces 6.0,我想在条形图上显示工具提示。我试过datatipeditor,效果很好。问题是,我可能会使用长文本作为工具提示,而最左侧的栏不会显示全文 我试图用这个代码移动这个位置 function toolTip(str, seriesIndex, pointIndex, plot){ var val = plot.data[seriesIndex][pointIndex]; return "<div style='position

我正在使用PrimeFaces 6.0,我想在条形图上显示工具提示。我试过datatipeditor,效果很好。问题是,我可能会使用长文本作为工具提示,而最左侧的栏不会显示全文

我试图用这个代码移动这个位置

function toolTip(str, seriesIndex, pointIndex, plot){
     var val = plot.data[seriesIndex][pointIndex];
     return "<div style='position:relative; left:80px; bottom:15px;'>1aaaaaaaaaaaaaaaaaaaa: " + 
        (pointIndex +1) + "<br/>2bbbbbbbbbbbbbbbbbb: " + val + "</div>";
}
函数工具提示(str、serieIndex、pointIndex、plot){
var val=绘图数据[seriesIndex][pointIndex];
返回“1AAAAAAAAAAAAAAA:”+
(点索引+1)+“
2bbbbbbb:“+val+”; }
文字随着我的设计移动,但盒子仍然在那里

我本来想使用extender,但在文档页面上我不知道该使用哪个属性,以及如何将bean中的数据作为工具提示的文本传递

你知道如何将框和文本移动到我用datatipeditor设计的位置吗?

在bean中:

CartesianChartModel barModel = new BarChartModel();
barModel.setExtender("myExtender");
在我的js中,我使用highlighter的tooltipContentEditor,代码如下:

function myExtender(){
     this.cfg.highlighter = {
          tooltipContentEditor: function (str, seriesIndex, pointIndex, plot) {
             var val = plot.data[seriesIndex][pointIndex];
             return "this value is: " + val + "<br/>this is a looooooooooooong text";
          },
     show: true, 
     useAxesFormatters: false,
     tooltipLocation: 'n'
     };
}
函数myExtender(){
this.cfg.highlighter={
tooltipContentEditor:函数(str、serieIndex、pointIndex、plot){
var val=绘图数据[seriesIndex][pointIndex];
return“此值为:“+val+”
这是一个长文本”; }, 秀:没错, useAxesFormatters:false, 工具提示位置:“n” }; }

这里有一个提示。

这更像是一个提示,如果你使用Extender(你可以找到人们使用的例子),工具提示是由JqPlot Highlighter插件设置的,也许“SizedJust”属性就是你想要的。我用jqplot扩展器解决了这个问题,谢谢。请你把你的答案贴在下面作为“答案”,然后把它标记为已解决的答案。这是下一个人的一个好公民!我发布了我的解决方案,但不能将其标记为自动取款机,它说我明天可以接受