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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:33:22+00:00 2026-06-14T04:33:22+00:00

I am creating charts through Google Chart Tools, in a webpage using the Twitter

  • 0

I am creating charts through Google Chart Tools, in a webpage using the Twitter Bootstrap framework. There are three types of charts shown – pie, line and column charts, each in individual tab. The chart data is received through Ajax.

Immediately on receiving the data through Ajax, the chart is displayed fine. But if i move to another tab, i.e., another chart, and return back to the first one, the labels in the chart get re-aligned incorrectly.

Included herein are the images that show the problem, before and after tab change:
Chart before Tab Change
Chart after Tab Change

This problem occurs for the line and column charts too.

But the problem does not occur if i change the window and then get back, or if i hide and then re-show the charts. It occurs only if i change the tabs.

The mark-up for the tabs is like this:

    <div class="charts-div" style="text-align: center">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#tab-pie" data-toggle="tab">Pie</a></li>
                <li><a href="#tab-line" data-toggle="tab">Line</a></li>
                <li><a href="#tab-column" data-toggle="tab">Columns</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="tab-pie">
                    <div class="chart pie-chart" id="pie-prt"></div>
                </div>
                <div class="tab-pane" id="tab-line">
                    <div class="chart line-chart" id="line-prt"></div>
                </div>
                <div class="tab-pane" id="tab-column">
                    <div class="chart column-chart" id="column-prt"></div>
                </div>
            </div>

    </div>

Checked in Chrome 22, IE9 and Firefox 12. The result is the same. There is no additional code/event programmed at my end for tab change or tab focus events.

  • 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-14T04:33:23+00:00Added an answer on June 14, 2026 at 4:33 am

    As mohitp has pointed out there are some downsides to davidkonrad’s solution. If you still want the charts to remain functional after drawing them, (i.e., tooltips) then you’ll have to use Javascript to re-draw the chart.

    Given David’s example (minus the dummy displacement code) simply move the the chart variable with it’s options & datatable intact to a global scope and call the draw method again, you can see an example of this in action here: redraw-google-chart

    With David’s example, once you have your chart and charting information on a global scope you need to bind the following to the shown event of your tab as so:

    $('a[data-toggle="tab"]').on('shown', function (e) {
        chart.draw(data, options);
      })
    

    In my own application I draw my charts based on server-side json requests & there would be instances where I might have many charts on a single page so instead I appended my charts & charting information to global-scoped arrays that could be re-processed client-side as many times as needed.

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

Sidebar

Related Questions

I'm using Jfreechart for creating charts. I'm creating BufferedImage of chart and writing it
Is there a good third party framework available for creating animated charts and graphs
Are there any libraries or APIs for creating different types of charts on the
I'm trying out the HighStock library for creating stock charts. To fill the chart
I'm using fusioncharts free and creating some 3d pie charts like so... <div style=margin:0
I am creating an XPS Document using XPSDocumentWriter and The XPS document contains charts.
I am creating a chart using mxml. The mxml tags only create a chart
I'm creating an Excel chart using C++. My problem is that I want to
I'm creating interactive charts in java for android environment. Google visualisation API is very
I'm creating charts in Microsoft Word using C#. I can successfully do most of

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.