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

  • Home
  • SEARCH
  • 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 8431609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:54:04+00:00 2026-06-10T05:54:04+00:00

I have these array in javascript that is going to be the input data

  • 0

I have these array in javascript that is going to be the input data for a graph using highcharts

data = [20, 29, 25, 30, 21, 17, 20, 19, 18];

and what I need is to be able to concatenate certain strings to get in the end these

data = [{ color: ‘#55B647’, y: 20 }, 29, 25, 30, 21, 17, 20, { color: ‘#F15B49’, y: 19 }, 18];

I was trying to acces the array and assing the new value like these

data[0]= “{ color: ‘#55B647’, y:” + data[0] + “}”;

But is not working, how can I do it? What’s wrong with my code?

  • 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-10T05:54:06+00:00Added an answer on June 10, 2026 at 5:54 am

    This should be right:

    data[0] = { color: '#55B647', y: data[0] };
    

    Rememeber that an object in JS is declared like:

    var object = { key1: value1, key2: value2};
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JavaScript array that contains 150 JavaScript functions (these functions return financial
I have a javascript array of objects that I would like to use to
I'm having issues with javascript array sorting and integers. I have these functions defined:
I have these code in my views.py: array = [] p = Person.objects.filter(client=1,status='Complete').values('name', 'age',
I have 4 string arrays,each of these array's length is 4. I also have
I have these methods. I have defined a char array in stringcontent.h file and
I have an array of pointers to Objective-C objects. These objects have a sort
I have an array made of unlimited number of objects. These objects have the
I have a really tough situation in here. There is an array of these
I have an array of integers like these; dim x as integer()={10,9,4,7,6,8,3}. Now 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.