user5949912
user5949912

Reputation:

How to display flot chart crosshair values in a <div> tag?

Being given this example: http://jsfiddle.net/ringstaff/k9FkZ/, how could I display sin and cos values in a <div></div>? I tried to append y like: $("#h2").eq(i).html(y.toFixed(2)); and H2: <div id="h2" />, but didn't work.

Thanks in advance!

Upvotes: 2

Views: 155

Answers (1)

Raidri
Raidri

Reputation: 17560

See this fiddle for a working version.

Added to the HTML:

<div id="h1"></div>
<div id="h2"></div>

Added to the updateLegend function:

    $('#h' + (i + 1).toString()).html(series.label.replace(/=.*/, "= " + y.toFixed(2)));

Upvotes: 1

Related Questions