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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:17:19+00:00 2026-06-12T06:17:19+00:00

I’ve read at least half a dozen other questions about doing this, and I

  • 0

I’ve read at least half a dozen other questions about doing this, and I can’t figure out how mine is different: http://jsfiddle.net/JakobJingleheimer/Z5UFg/1/

I added a function LoadGraph.check_data which I run from the console. The data that it output after running load_data(1,"199 Water St",7); is:

#mine
[ { label:"coffee",  data:[ [1659] ] },
  { label:"cocoa",  data:[ [717] ] },
  { label:"tea",  data:[ [206] ] }
]

That looks exactly the same to me as the example in the doc (just above Plot Options):

#doc example
[ { label: "Foo", data: [ [10, 1], [17, -14], [30, 5] ] },
  { label: "Bar", data: [ [11, 13], [19, 11], [30, -7] ] }
]

I also tried modelling my structure after SO answer 5661134, but that didn’t fly either (exact same outcome as seen in the fiddle).

The 2nd graph in the fiddle should either have 3 bars next to each other or (better yet) have the 3 bars stacked on top of each other.

UPDATE: I added an x-value to get the following (but it still doesn’t work, fiddle):

#http://jsfiddle.net/JakobJingleheimer/Z5UFg/3/
[ { label:"coffee",  data:[ [7, 1659] ] },
  { label:"cocoa",  data:[ [7, 717] ] },
  { label:"tea",  data:[ [7, 206] ] }
]
#http://jsfiddle.net/JakobJingleheimer/Z5UFg/2/
[ { label:"coffee",  data:[ [0, 1659] ] },
  { label:"cocoa",  data:[ [1, 717] ] },
  { label:"tea",  data:[ [2, 206] ] }
]

If I take out the object-ness (eg, the labelling), it works (but I’ll need to figure out why f_opts.series.stack=true doesn’t work—I think, since all 3 bars are blue, it’s treating all three as the same series): v4

UPDATE 2 Are these supposed to be in 2 different places? By that I mean should that label+data array-object be in the options object and the data also be in the data array? The documentation is kind of difficult to figure out because it never says what the parent object is.

  • 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-12T06:17:20+00:00Added an answer on June 12, 2026 at 6:17 am

    I believe this version of the fiddle might be what you’re trying to do.

    The problem was in your treatment of f_data as a single object {} instead of an array of objects, specifically series objects. (You got around this by forcing it into an array in the plot call with [f_data], but this limits you to a single series.). What you want to do instead of setting f_data = tmp is instead push a complete series object into f_data with tmp as its data array:

    f_data.push({label:cat, stack:true, data:tmp});
    

    Each series object (each element in your f_data array) has its own data and label, as you can see in my example.

    There were two reasons why you weren’t seeing any stacking working:

    1. You need to include the jquery.flot.stack.js file to get stacking functionality. (I’ve added the linked resource in the fiddle.)
    2. Stacking only makes sense with multiple series. Your “depth” view was adding 3 overlapping data points to a single series, rather than creating 3 individual series with 1 data point each.

    I believe my example achieves the result you were aiming for. Let me know if I am mistaken.
    I’ve tagged new lines I added with //NEW to highlight the changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there's a lot of other questions out there that deal with this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the

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.