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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:27:48+00:00 2026-06-03T05:27:48+00:00

Please take a look at the following example: http://www.jqplot.com/deploy/dist/examples/hiddenPlotsInTabs.html In the first example, the

  • 0

Please take a look at the following example:

http://www.jqplot.com/deploy/dist/examples/hiddenPlotsInTabs.html

In the first example, the hidden graphs are plotted by catching the “tabshow” event and finding which tab was selected:

$('#tabs').bind('tabsshow', function (event, ui) {
    if (ui.index === 1 && plot1._drawCount === 0) {
        plot1.replot();
    } else if (ui.index === 2 && plot2._drawCount === 0) {
        plot2.replot();
    }
});

This works fine but if you added more tabs and moved your plots to other tabs, you’d have to manually update the hard coded “ui.index” values, which I’d like to avoid in my project.

Does anybody know a good way to programmatically find under which tab your plot exists? I’d like to code in such a way that it doesn’t matter how many tabs you have and where you place your plot.

  • 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-03T05:27:50+00:00Added an answer on June 3, 2026 at 5:27 am

    You have to approach it in the following way:

    1. Take the chart id you want to find from somewhere.
    2. Use jQuery to select the chart.
    3. Find its parent using parent() method — this is the tab containing it.
    4. Use attr('id') of the parent to get its id.

    This is how I show it in jsfiddle sample available here.

    EDIT

    From what I understand you want to get the index of selected tab, which is effectively ui.index. Since I couldn’t find a ready method in the jQuery UI, this is how I achieved it (this code is also added to the previous jsfiddle sample):

        var tabIndex = -1;
        $("#tabs ul li").each(function(index){
            if('#'+tabId === $(this).find("a").attr('href')){
                tabIndex = index;
                return false;
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please take a look at the following example: http://jsfiddle.net/MVfVD/ I want the overlayedFrameFooter div
please take a look at the following website: http://www.solidcamxpress.co.uk/ If you look at it
I took the original 'Cart editor' example at http://knockoutjs.com/examples/cartEditor.html (jsFiddle - http://jsfiddle.net/rniemeyer/adNuR/ ) and
Please take a look on the following example: class Base { protected: int m_nValue;
Please take a look at the following .htaccess ErrorDocument 404 /404/ RewriteEngine On RewriteRule
Please take a look here: alt text http://img16.imageshack.us/img16/2810/errrp.jpg Why i got that error when
Please take a look at this example: #include <iostream> #include <vector> #include <string> using
Please take a look at this screenshot first: I would like to move the
Please take a look at following code: #include <stdio.h> #include <iostream> using namespace std;
Please, take a look at this example: import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Test

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.