Custom Highlight for jqPlot Bar Graph

When adding custom highlight to jqPlot chart, I just 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 shown in the last example here . This works fine on my simple histogram. Then I try to do the same on a stacked histogram, and the x values ​​are off. Does anyone know how I can get these values ​​or what am I doing wrong?

+2
source share
1 answer

See how I make a custom tooltip on my stacked bar chart.

A jsfiddle sample is available here.

+2
source

Source: https://habr.com/ru/post/1501459/


All Articles