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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:08:36+00:00 2026-05-26T19:08:36+00:00

I have a pie chart, I also have a legend with words that identifies

  • 0

I have a pie chart, I also have a legend with words that identifies what each color on the pie chart represents. I am trying to implement a hover element, so when the user hovers over each word in the legend, it highlights that section of the pie chart (basically by swapping images). So the users have a point of reference

I have seven words in the legend, each word represents its own div (id=legend1,2,3, etc.), I can’t get the HTML code to handle dynamically change the pie chart (div class=chart), based on a hover command coming from several different divs(id=legend1,2,3,etc.). In the link added, it works if I am only using one div(legend1) to change the div (class=chart) from it’s default image to another. But trying to add multiple divs (legend2,3,etc.)stops the first legend hover effect from working.

I think this calls for javascript, but I am not sure. Can someone please help me with this, I am not too skilled in javascript, if in fact it is the case.

http://jsfiddle.net/6BfR6/46/

  • 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-26T19:08:36+00:00Added an answer on May 26, 2026 at 7:08 pm

    How about using this technique:

    http://jsfiddle.net/KsYrH/1/

    Basically nested div tags absolute positioned that can be target with parent element hover. No javascript needed.

    <ol class="pie">
        <li class="slice1">Blueberries 37%
            <div class="drawing"></div></li>
        <li class="slice2">Raspberries 23% 
            <div class="drawing"></div></li>
        <li class="slice3">Cream 50% 
            <div class="drawing"></div></li>
    </ol>
    

    CSS

    .pie {
        background: #eeeeee;
        width: 7em;
        padding: 0.5em;
        position: relative; /* offset drawings relative to this element */
    }
    
    .pie .drawing {
        position: absolute; /* drawings are absoluted */
        height: 20px;
        bottom: -20px;
    }
    
    ol li {
        cursor: pointer;
    }
    
    .slice1 .drawing {
        left: 0px;
        width: 74px; /* 2 x percentage */
        background: #6666cc;
    }
    .slice1:hover .drawing {
        background: #6666ff;
    }
    
    .slice2 .drawing {
        left: 74px;
        width: 46px; /* 2 x percentage */
        background: #cc6666;
    }
    .slice2:hover .drawing {
        background: #ff6666;
    }
    
    
    .slice3 .drawing {
        left: 120px;
        width: 100px; /* 2 x percentage */
        background: #ccaaaa;
    }
    .slice3:hover .drawing {
        background: #ffeeee;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pie chart that I build using Core Plot. Also I used
I have some code that generates image of a pie chart. It's a general
I am trying to get a pie chart display correctly but have found there
I have a pie chart and want to specify an exact color for a
I have a ControlTemplate that contains a XamWebChart . For each pie slice created
I have a report that contains a pie chart within it. I would want
Say I have multiple detail bands containing pie charts. Each pie chart's JRXML looks
I am trying to display a pie chart that shows sales by company. However
I'm trying to make a pie chart that uses values from a user from
I'm trying to write a Windows Application that shows a pie chart with seven

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.