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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:27:32+00:00 2026-06-02T20:27:32+00:00

I want to create a stacked bar graph as in url below (source: jpowered.com

  • 0

I want to create a stacked bar graph as in url below

image
(source: jpowered.com)

I want to make hyperlink for each of the red ,violet and blue boxes.The graph is possible with jfree chart but i don’t know how to make each of the individual bars as URL so that a click on it can refresh the page.
Is it possible to do it with jfree chart?

Does Jquery plot help in this case to make each box url enabled ?Please suggest.

  • 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-02T20:27:35+00:00Added an answer on June 2, 2026 at 8:27 pm

    I know that you can achieve something like this in jqPlot without much trouble.
    The only think you need to remember, after you create your plot, is to bind your function to jqplotDataClick event. In your function you would need to map your clicks to a structure of urls. I have presented this in a sample example, where only the first series’ bars take you to some websites. The sample is on jsfiddle — it could be found here.

    Effectively all comes down to this piece of code:

      var urls = ["www.yahoo.com", "www.google.com", "www.java.com", "www.w3schools.com/js/js_obj_date.asp"];
      $('#chart').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
          if(seriesIndex === 0){
              var url = urls[pointIndex];
              window.open("http://"+url);
          }
      });
    

    EDIT

    I do not know an easy way, i.e. that wouldn’t involve changing the script of jqPlot, of identifying the clicked bar by highlighting its background. Though I figured out a way to get a similar effect by coloring background of point labels which are on bars, the code would also need to be in the jqplotDataClicked, something like:

    var prevClicked;
    var prevBackgroundColor;
    $('#chart').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
        var str = ".jqplot-point-label.jqplot-series-"+seriesIndex+".jqplot-point-"+pointIndex;
        $(str).each(function(){
            if(prevClicked)
                $(prevClicked).css('background-color', prevBackgroundColor);
            prevClicked = this;
            prevBackgroundColor = $(prevClicked).css('background-color');
            $(prevClicked).css('background-color', 'red');
        });
    });
    

    You just find the clicked point label using jQuery and apply your style, e.g. changing background color, remembering the previous label so you can remove its color to previous state on click on another bar. First I tried using addClass/removeClass functions but it didn’t change a label’s style, thus I had to use the css function instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a horizontal 100% stacked bar graph using HTML and CSS.
I would like to create a horizontal proportional stacked bar chart, using R. My
I am trying to create a Stacked Bar Chart. My requirement is I need
I need to set a unique color to each bar in the stacked bar
I want to create 4 rectangles stacked to one row. |----|--|------|------------| The width of
I want create subdomains like this: domain.com/type/city An examples: domain.com/restaurants/new_york domain.com/hotels/new_york domain.com/restaurants/chicago I have
I need a lightweight javascript library to create a stacked line graph (a bit
I want create a loading progress bar like Gmail in center and top of
Possible Duplicate: Create a bar graph with pre-summarized data using ggplot2 On ggplot2 reference
I want create a excel with Apache POI in java and I must insert

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.