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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:04:04+00:00 2026-06-06T21:04:04+00:00

This is probably quite a simple answer however I’m very new to jQuery/JavaScript so

  • 0

This is probably quite a simple answer however I’m very new to jQuery/JavaScript so please bear with me.

At the moment I have a drop down with 4 options and then a <button> next to it that changes a chart based on what the user has selected. Basically all I’m trying to achieve is to remove the need of a button and just refresh the chart when the user clicks on one of the options.

The following is the jsfiddle that I have based it on.

http://jsfiddle.net/jlbriggs/EmMxH/92/

Any help would be great, thanks

Henry

  • 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-06T21:04:06+00:00Added an answer on June 6, 2026 at 9:04 pm

    You want the “change” event on the select list, not the click event. (based on your fiddle code)

    <select id="list">
      <option value="A">Data Set A</option>
      <option value="B">Data Set B</option>
      <option value="C">Data Set C</option>
      <option value="D">Data Set D</option>    
    </select>
    
    $("#list").change(function(){
      //... do stuff
      var selVal = $(this).val();
      if(selVal == "A" || selVal == ''){
        options.series = [{name: 'A', data: [1,2,3,2,1]}]
      } else if(selVal == "B"){
        options.series = [{name: 'B', data: [3,2,1,2,3]}]
      } else if(selVal == "C"){
        options.series = [{name: 'C', data: [5,4,8,7,6]}]
      } else {
        options.series = [{name: 'D', data: [4,7,9,6,2]}]
      }
      var chart = new Highcharts.Chart(options);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably something really simple, however I am quite new to PHP, and
Sorry, I'm new to Java and there's probably a very simple answer to this.
This is probably quite simple but I've googled and can't find an answer. I
this is probably quite a simple problem, however, I can't figure out how to
I have a probably quite simple to solve problem. I'm trying to parse this
ANSWER: Allright, that was quite simple (probably I made this mistake coz I need
There is probably a very simple answer to this, but I want to be
This is probably quite a simple question but very hard to google! I'm loading
This is probably quite a simple problem, but Im quite new to R. I
I have what I think is probably quite a simple question to answer (for

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.