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

  • Home
  • SEARCH
  • 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 626897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:28:09+00:00 2026-05-13T19:28:09+00:00

I see this link to use google chart api for putting multiple line charts

  • 0

I see this link to use google chart api for putting multiple line charts together

What is the recommended way to have dates on the bottom line as it seems like each row in the chart has the same level of space so if i have charts where their are dates and values i want the correct spacing to be there between date values (1 day difference should be different than 1 month apart data points).

It seems like of you put dates in the first column it keep every “row” the same distance apart horizontally.

EDIT: I have added my code below


function drawChart() {

        var data = new google.visualization.DataTable();
        data.addColumn('date', 'Date');
        data.addColumn('number', 'Target');
        data.addColumn('number', 'Actual');

        data.addRows(9);

        data.setValue(0, 0, new Date(2010, 1, 1));
        data.setValue(0, 1, 215);
        data.setValue(0, 2, 215);

        data.setValue(1, 0, new Date(2010, 2, 1));
        data.setValue(1, 2, 213);

        data.setValue(2, 0, new Date(2010, 2, 4));
        data.setValue(2, 2, 213);

        data.setValue(3, 0, new Date(2010, 2, 8));
        data.setValue(3, 2, 213);


        data.setValue(4, 0, new Date(2010, 3, 1));
        data.setValue(4, 2, 220);

        data.setValue(5, 0, new Date(2010, 4, 1));
        data.setValue(5, 2, 190);
  • 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-13T19:28:09+00:00Added an answer on May 13, 2026 at 7:28 pm

    That example uses a string to store the year, so no "smart" spacing will occur. However, the Google DataTable does support Date and DateTime column types, so that should suffice for your needs.

    http://code.google.com/apis/visualization/documentation/reference.html#DataTable

    Basically, instead of calling

    ...
    data.addColumn('string', 'Year');
    ...
    

    You would do

    ...
    data.addColumn('date', 'TheDate'); // or datetime, depending on your needs
    

    Edit: in that case, you probably need to pad the date values yourself. It looks like the fixed spacing comes from the row index in the DataTable. For instance, you can see that this code generates differently-spaced data points in the chart:

    function drawVisualization() {
      var data = new google.visualization.DataTable();
      data.addColumn('date', 'Date');
      data.addColumn('number', 'Target');
    
      data.addRows(9);
    
      data.setValue(0, 0, new Date(2010, 1, 1));
      data.setValue(0, 1, 213);
    
      data.setValue(3, 0, new Date(2010, 2, 1));
      data.setValue(3, 1, 213);
    
      data.setValue(4, 0, new Date(2010, 2, 4));
      data.setValue(4, 1, 213);
    
      data.setValue(5, 0, new Date(2010, 2, 8));
      data.setValue(5, 1, 213);
    
      new google.visualization.LineChart(document.getElementById('visualization')).draw(data, null);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 356k
  • Answers 356k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Redis supports both lists and sets. You can disable disk… May 14, 2026 at 8:51 am
  • Editorial Team
    Editorial Team added an answer Why not just use WPF windows that are borderless (and… May 14, 2026 at 8:51 am
  • Editorial Team
    Editorial Team added an answer Yes you can, but it "doesn't grok". Take a look… May 14, 2026 at 8:51 am

Related Questions

I'm using the feedparser library in python to retrieve news from a local newspaper
here is a regex i got from: a blog i can't link to because
Someone has to be able to explain what I'm doing wrong here! I'm trying
I have an application that loads external SWF files and plays them inside a
Before answering this question, understand that I am not asking how to create my

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.