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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:43:09+00:00 2026-05-28T01:43:09+00:00

I believe that I may be missing something here, so please bear with me

  • 0

I believe that I may be missing something here, so please bear with me as I explain two scenarios in hopes to reconcile my misunderstanding:

My end goal is to create a dataset that’s acceptable by Highcharts via lazy_high_charts, however in this quest, I’m finding that it is rather particular about the format of data that it receives.

A) I have found that when data is formatted like this going into it, it draws the points just fine:

[0.0000001240,0.0000000267,0.0000000722, ..., 0.0000000512]

I’m able to generate an array like this simply with:

array = Array.new

data.each do |row|
  array.push row[:datapoint1].to_f
end

B) Yet, if I attempt to use the map function, I end up with a result like and Highcharts fails to render this data:

[[6.67e-09],[4.39e-09],[2.1e-09],[2.52e-09], ..., [3.79e-09]]

From code like:

array = data.map{|row| [(row.datapoint1.to_f)] }

Is there a way to coax the map function to produce results in B that more akin to the scenario A resultant data structure?


This get’s more involved as I have to also add datetime into this, however that’s another topic and I just want to understand this first and what can be done to perhaps further control where I’m going.

Ultimately, EVEN SCENARIO B SHOULD WORK according to the data in the example here: http://www.highcharts.com/demo/spline-irregular-time (press the “View options” button at bottom)

Heck, I’ll send you a sucker in the mail if you can fill me in on that part! 😉

  • 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-28T01:43:10+00:00Added an answer on May 28, 2026 at 1:43 am

    You can fix arrays like this

    [[6.67e-09],[4.39e-09],[2.1e-09],[2.52e-09], ..., [3.79e-09]]
    

    that have nested arrays inside them by using the flatten method on the array.

    But you should be able to avoid generating nested arrays in the first place. Just remove the square brackets from your map line:

    array = data.map{|row| row.datapoint1.to_f }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I believe that I couldn't find a proper title to explain my problem but
I believe that Agile is nothing but another implementation of Spiral Model. I am
I believe that quantifying the productivity increase (extra working hours) is the most effective
I believe that IDictionary classes works better with sortable objects. I believe also that
I believe that I have successfully impersonated my own user account while running an
I'm lead to believe that I cannot count on the order of items added
Premise I believe that there is a way to objectively define "Good" and "Bad"
I am beginning to believe that unit testing high level, well-written code, which requires
I was lead to believe that MVC apps were BIN-deployable, so could be deployed
I can't believe that the following statement seems to be still true So, I

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.