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

The Archive Base Latest Questions

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

I’ve got a pie chart type thing and I need the value of it

  • 0

I’ve got a pie chart type thing and I need the value of it to change depending on what link is clicked (see link below and click button 70 to see what I mean)

http://fifamatchgenerator.com/dev/piechart/examples/

Here is the code which makes that work:

$('.updateEasyPieChart').on('click', function(e) {
    e.preventDefault();
    $('.percentage, .percentage-light').each(function() {
        var newValue = document.getElementById(1).innerHTML;
        $(this).data('easyPieChart').update(newValue);
        $('span', this).text(newValue);

The (1) gets the ID of 1 from one of the sequential links on the page:

<li><a href="#" id="1" class="button updateEasyPieChart">70</a></li>
<li><a href="#" id="2" class="button updateEasyPieChart">60</a></li>
<li><a href="#" id="3" class="button updateEasyPieChart">50</a></li>

It obviously only works with the first link as it is only calling that ID. Now this is where I need the help. I need that value inside the document.get to be defined by the id of the link that is clicked, if you understand what I mean. So when the second link with the id of 2 is clicked, I will need that to be passed to the document.get and update. It sounds simple enough, but my javascript skills simply aren’t good enough to work it out on my own. Ive done a tonne of googling and can’t seem to find anything of use or that works. I’m not really looking for someone to do it for me, just point me in the right direction!

p.s. pie chart code I got from a website …but the code which changes the value (kinda) was written by myself and a friend.

  • 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-17T15:39:21+00:00Added an answer on June 17, 2026 at 3:39 pm

    This code is dynamic for any amount of links in the unordered list. It will grab the number from inside the inner html and update the pie chart. You might have to tinker with the updating the pie chart part, as I haven’t seen all the code 🙂

    Here is the list, copied from your code

  2. 70
  3. 60
  4. 50
  5. Here is the code that binds a click function to each anchor tag in the unordered list.

            $('#myUnorderedList li a').click(function() {
    
                var newValue = $(this).html();
    
                $('.percentage, .percentage-light').each(function() {
    
                $(this).data('easyPieChart').update(newValue);
                $('span', this).text(newValue);
              });
            });
    
  • 0
  • Reply
  • Share
    Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp
    • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to

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.