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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:45:46+00:00 2026-06-09T12:45:46+00:00

I have some data that I am trying to display using the Google Visualization

  • 0

I have some data that I am trying to display using the Google Visualization API (Google Chart Tools). I have been able to create the graph and it looks great except that the Secondary Y-Axis should be displayed as percentages instead of regular numbers. Here is my code and an image of what is produced.

google.load('visualization', '1', {packages: ['corechart']});

function drawVisualization() {
    //Some raw data (not necessarily accurate)'
    var data = google.visualization.arrayToDataTable([
        ['AuditPeriod', 'Audit Count', 'Fail Percentage'],
        ['02-11-2012',  0,      0],
        ['02-18-2012',  0,      0],
        ['02-25-2012',  0,      0],
        ...
        ['07-21-2012',  1476,   .233062],
        ['07-28-2012',  1651,   .253180],
        ['08-04-2012',  2217,   .210645]
    ]);

    var options = {
        vAxis: [0: {format: '#,###'}, 1: {format: '#%'}],
        hAxis: { title: "Week", format: 'm/d/y'},
        series: {
            0:{ type: "bars", targetAxisIndex: 0 },
            1: { type: "line", targetAxisIndex: 1}
        }
    }

    var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
    chart.draw(data, options);
}        
google.setOnLoadCallback(drawVisualization);

enter image description here

If I set vAxis:{format: '#%'} then both axes are formated as Percentages which I don’t want. Is there a way to format the second axis different form the first?

  • 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-09T12:45:48+00:00Added an answer on June 9, 2026 at 12:45 pm

    Posted this question on the Google Visualization Group and got the answer.

    asgallant

    You almost had it, use vAxes instead of vAxis when formatting multiple axes:

    vAxes: {
    0: {format: ‘#,###’},
    1: {format: ‘#%’}
    }​

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

Sidebar

Related Questions

I have some data about a day's events that I'm trying to visualise as
I have a form that is trying to insert some data into an SQL
i have a simple template that i populate with some data then im trying
I have some data that I have to display as a table. I think
Hi, i have been having some problems using JSON data in flash builder lately
I am trying to display some xml data from remote URL using jquery and
I have been trying to display a MySQL table for some time and I
I have a php script that I'm trying to pull some data from a
I`m trying to display classes that have properties of type some custom class inside
im currently trying to parse some json data on the iphone. I have been

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.