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 7982209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:36:45+00:00 2026-06-04T10:36:45+00:00

Trying to run a very simple flot.js example, I have the following code to

  • 0

Trying to run a very simple flot.js example, I have the following code to render the flot chart. (I am omitting all the non-essential HTML and CSS on purpose.)

<div id="chartWrapper1">
<div id="placeholder"></div>
<div id="legendholder">Legend Container</div>
</div>

<script type="text/javascript">
$(function () {
var disk1 = [[0, 3], [4, 8], [8, 5], [9, 13]];
    $.plot($("#placeholder"), [{
      legend: { show: true, container: $('#legendholder') },
      label: "Disk 1",
      data: disk1,
      lines: { show: true, fill: true }
    }]);
});
</script>

The result looks like this:

enter image description here

http://bit.ly/JTR3Bd

(StackExchange does not allow me to post images yet, so the link above gets you straight to a screenshot of the chart.)

The little part next to the chart, where it says Legend, is another div (id=”legendholder”), and that’s where I want the legend to show up.

I have had similar issues with grid options, and here’s the part I don’t understand:

When I specify the option in the JavaScript, nothing seems to happen. The legend remains inside the chart. Then, I hard-code the legend settings in jquery.flot.js and everything works. Obviously, that’s a total hack, but does anyone see what I’m doing wrong here?

Yes, I have read the API documentation, poked around the flot.js github pages, but I have not been able to figure out what’s causing my issues.

Anyone?

  • 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-06-04T10:36:47+00:00Added an answer on June 4, 2026 at 10:36 am

    The flot plot function should be called like this $.plot(placeholder, data, options);
    Legend is part of the options and not data which is what you have done in your code. Try this:

    $(function () {
        var disk1 = [[0, 3], [4, 8], [8, 5], [9, 13]];
        $.plot($("#placeholder"), [{
          label: "Disk 1",
          data: disk1,
          lines: { show: true, fill: true }
        }], 
        {legend: { show: true, container: '#legendholder' }})
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run a very simple Oracle procedure from PHP, using the following
Im trying to get to run a very simple example in liquibase 1.9.5 (see
I am trying to run a very simple server/client ssl code with a self
I'm trying to run very simple view in backbone.js Here is the code: (function($){
I have two very similar programs each trying to run two threads OddThread and
Trying to run my program in FreeBSD OS, I have the following results: $
I am just trying to compile and run a very simple test program, but
All I'm trying to do is open a very simple application that is supposed
I'm trying to wrap my head around MSBuild. I have a very simple script
I'm trying to run a very simple 2D animation when I fling an image

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.