HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.45k stars 529 forks source link

hover on point in line chart #282

Open JimSteinhart opened 9 years ago

JimSteinhart commented 9 years ago

I have a Flotr2 barchart with linecharts on them, when you hover the linechart you should see the coordinates in a tooltip.

The problem is that the tooltips are not show for the 2 lowest points in the linechart on top of the green bar chart.

See this jsfiddle: http://jsfiddle.net/P855Q/1/

This is the javascript for the charts:

(function basic_bars (container, horizontal) {

var NumberOfBars = 3;

var barcenters = [];
var barWidth = ( (1 / NumberOfBars) * 0.8 )
var barcenterAdjust =  (barWidth * (NumberOfBars/2)) - (barWidth/2.2);

for (i = 0; i < NumberOfBars; i++) {
    var barcenter = (i *(( 1 / NumberOfBars ) * 0.8));
    barcenter = barcenter - barcenterAdjust;
    barcenters.push(barcenter);
}

var dummyVar,
d0=[
    [barcenters[0] + 3, 5],
    [barcenters[0] + 3, 8.1333],
    [barcenters[0] + 3, 9]
],
d7=[
    [barcenters[1] + 3, 5],
    [barcenters[1] + 3, 8.1333],
    [barcenters[1] + 3, 9]
],
d14=[
    [barcenters[2] + 3, 5],
    [barcenters[2] + 3, 8.1333],
    [barcenters[2] + 3, 9]
];
var a =  [[3,8.303000]];
var b =  [[3,8.574500]];
var c =  [[3,8.222200]];