Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 435473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:22:47+00:00 2026-05-12T20:22:47+00:00

I got the Flot-created graph. What I wanted to acomplish is to get some

  • 0

I got the Flot-created graph. What I wanted to acomplish is to get some kind of information when user moves the mouse over it – best would be to show the data (from x and y axis) in some kind of javascript popup.

It’s probably trivial question, but I can’t figure it out…

Right now my javascript looks like this:

<script  id="source" language="javascript" type="text/javascript">
$(function () {
    var data = [[1251756000000, 122.68],[1251842400000, 122.68],[1251928800000, 125.13],[1252015200000, 112.62],[1252101600000, 122.76]]
    $.plot($("#graph_placeholder"), [ data ], { 
        xaxis: { mode: "time", minTickSize: [1, "day"], timeformat : "%y/%m/%d", },
        lines: { show: true },
        points: { show: false },
    } );
});
</script>

So best would be to get the x: 1251756000000 y: 122.68 when hovering the point (x: 1251756000000, y: any). Or even have the x value formatted as defined in the timeformat (2009/11/14).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:22:47+00:00Added an answer on May 12, 2026 at 8:22 pm

    This example shows how to enable a tooltip (if you click the Enable Tooltip checkbox). Here’s a starting point using your example code:

    <script  id="source" language="javascript" type="text/javascript">
    $(function () {
    var data = [[1251756000000, 122.68],[1251842400000, 122.68],[1251928800000, 125.13],[1252015200000, 112.62],[1252101600000, 122.76]]
    $.plot($("#graph_placeholder"), [ data ], {
        xaxis: { mode: "time", minTickSize: [1, "day"], timeformat : "%y/%m/%d", },
        lines: { show: true },
        points: { show: true },
        grid: { hoverable: true },
    } );
    });
    
    var previousPoint = null;
    $("#graph_placeholder").bind("plothover", function (event, pos, item) {
    if (item) {
        if (previousPoint != item.datapoint) {
            previousPoint = item.datapoint;
            $("#tooltip").remove();
            showTooltip(item.pageX, item.pageY, '(' + item.datapoint[0] + ', ' + item.datapoint[1]+')');
        }
    } else {
        $("#tooltip").remove();
        previousPoint = null;
    }
    });
    
    function showTooltip(x, y, contents) {
        $('<div id="tooltip">' + contents + '</div>').css( {
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 5,
            border: '1px solid #fdd',
            padding: '2px',
            'background-color': '#fee',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a javascript 101 question. I'm using a nice graphing library (flot), and
I'm trying to use Flot to plot a graph with dates. I've followed the
Got an application (C# WPF) that needs to call home and get updated stuff
I have already asked this question in offical Flot google groups, but got no
Got a newbie CSS question, just beginning to get into CSS so please bear
Got an application wich read some infos in a specific XML file. I would
I got this part inside my json object. But I couldn't get this as
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now
got a new blog at wordpress few days ago ( http://ghads.wordpress.com ) and I
Got a class that serializes into xml with XMLEncoder nicely with all the variables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.