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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:12:21+00:00 2026-06-13T12:12:21+00:00

I’m using the awesome Google Chart Wrapper to create charts as part of my

  • 0

I’m using the awesome Google Chart Wrapper to create charts as part of my Django project. Right now I’m creating the chart instance using Python in my views, and then adding the instance to the template context and displaying the charts in my templates successfully.

What I’m having trouble doing is displaying a dynamic set of X-Axis labels. Here is the relevant code from Google Chart Wrapper:

def label(self, index, *args): 
    """ 
    Label each axes one at a time 
    args are of the form <label 1>,...,<label n> 
    APIPARAM: chxl 
    """ 
    self.data['labels'].append( 
    str('%s:|%s'%(index, '|'.join(map(str,args)) )).replace('None','') 
    ) 
    return self.parent 

and how I’m currently creating the chart in my view:

from GChartWrapper import *

chart = Sparkline([1,2,3,4,5,6,7], encoding='text')
chart.axes.label(...) # need to set labels here

I have a list of date strings that I’d like to display as the x-axis labels, does anyone know how I would go about doing that?

  • 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-13T12:12:21+00:00Added an answer on June 13, 2026 at 12:12 pm

    In order to understand how to properly pass the labels it’s important to know what *args means.

    *args (which is an asterisk + an arbitrary argument name) in a function (or method as in this case) definition means any number (including 0) of anonymous arguments.

    See this answer for a more thorough explanation.

    This means that the method in question accepts one obligatory argument index which is the index of the axis to be labelled and any number of anonymous arguments (actual labels).

    Knowing this, it should already be clear that the proper way to call label() is as follows:

    chart.axes.label( 0, 'date 1', 'date 2', 'date 3', ... )
    

    where 0 is the index of the X-axis and all the other arguments are respective labels.

    The reason why this is implemented in this manner is that the number of lables is unknown – it depends on the chart, so accepting any number of labels seems like a good idea.

    You may also want to take a look at the example here

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

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

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.