问题
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 });
}
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?
回答1:
Check out how I do a custom tooltip on my stacked bar chart.
The jsfiddle sample is available here.
来源:https://stackoverflow.com/questions/10578204/custom-highlight-to-jqplot-stacked-bar-chart