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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:06:15+00:00 2026-06-06T15:06:15+00:00

When I use a column type of date, the first and last bars in

  • 0

When I use a column type of date, the first and last bars in the ColumnChart are cut in half. It seems to be rendering from mid-bar. It doesn’t do this with non-date sets of data.

Is there any way to fix this so that the complete bars are rendered, with some extra padding?

http://jsfiddle.net/7tHVN/

  • 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-06T15:06:17+00:00Added an answer on June 6, 2026 at 3:06 pm

    I had this exact problem (my labels were also weirdly misaligned) and it drove me crazy trying to figure it out. hAxis.viewWindowMode usually fixes issues like this, but it’s not possible to use this with date values.

    What I ended up doing was just scrapping the date type entirely, specifying the string type for that column instead, and converting each JS date object to a string representation before adding it to the DataTable, thusly:

    data.addColumn('string', 'Date');
    data.addColumn('number', 'Performance');
    
    var dates = [new Date('2012-4-12'),
                 new Date('2012-4-13'),
                 new Date('2012-4-14')];
    var performance = [59, 35, 86];
    
    var dateString;
    for (var i=0; i<dataForChart.length; i++) {
        dateString = (dates[i].getMonth()+1)+'/'+ // JS months are 0-indexed
                      dates[i].getDate()+'/'+
                      dates[i].getYear();
        data.addRow([dateString, 
                    performance[i]]);
    }
    

    This forces the chart to render with a discrete rather than continuous axis, which fixes the cut-off bars problem. As long as your data and dates are spaced along even intervals (once a day, once a week, etc.) and you pass them in in the proper order, this approach should work.

    There’s more info on discrete vs. continuous axes in the Google Viz docs: https://google-developers.appspot.com/chart/interactive/docs/customizing_axes

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

Sidebar

Related Questions

What column type should I use for storing html content from a website with
I have an xts object, the first column of which is date-time, followed by
How can I use my column alias (lat and lng) from the two subqueries
I have a column of date datatype. The user may type in any date.
I have a MySQL database , with a column that is date type DATETIME
I have a table with a column date (type mysql date : yyyy-mm-dd) I
We have a Oracle Date column. At first in our Java/Hibernate class we were
I use jqGrid and my grid definition is like that: ... colNames:['Type','Date','Message','User Name','Host'], colModel:[{name:'type',index:'type',
I have strange effects when retrieving columns of type DATE from SQLServer2008 using the
I use the Dataset#max for a date and timestamp column ( DB[:data].max(:timestamp) , but

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.