自定义突出显示jqPlot堆积条形图 [英] Custom highlight to jqPlot stacked bar chart

查看:157
本文介绍了自定义突出显示jqPlot堆积条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jqPlot图表中添加自定义突出显示时,我只需使用

When adding a custom highlight to the jqPlot chart, I simply use

$('#chart').bind('jqplotDataHighlight', function (ev, sIndex, pIndex, data) {
    var chart_top = $('#chart').offset().top,
        y = plot1.axes.yaxis.u2p(data[1]); // convert y axis units to pixels
    $('#tooltip').css({ top: chart_top + y });
}

如上例所示这里。这在我的简单条形图上效果很好。然后我在堆积的条形图上尝试相同的操作,并且x值关闭。有谁知道我如何获得这些值或什么我做错了?

as seen in the last example here. This works great on my simple bar chart. I then try the same on a stacked bar chart, and the x-values are off. Does anyone know how I can get these values or what I am doing wrong?

推荐答案

查看我如何在堆积条形图上进行自定义工具提示。

Check out how I do a custom tooltip on my stacked bar chart.

这里有jsfiddle样本。

这篇关于自定义突出显示jqPlot堆积条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆