django - How to use Date values in charts made with gRaphael? -


A small base: I am on a diet and I am trying to make a weight loss chart.

To do this, I am using a little Demo app to store the weight readings and the Grafle Charting Library to read the report. You can see wipes here:

Currently I'm printing dates to order them properly using the 'ymd' format in X-axis, but I'm not quite satisfied (actually Also, make sure the chart is perfect ...) and I am wondering what is the best way to present the dates.

The main questions are:

< Ol>
  • Is the use of labels other than '100610' or '20100610' Is there any way to do this?
  • Does the x and y axis labels determine the label of every N-day or N-Kig?
  • Can you recommend some best practices in presenting this type of chart (I
  • Thank you in advance for any help! >

    Teo

    one x with a date < / Code> object, I was able to get it using the following steps:

    1. Assume the minimum date and its getTime () Cache into a variable of the method ( originX )
    2. Change each date ( to curDate ), it originX . <<>> < against

        var time passed = curdate.getTime () - originX  
    3. Y .

    The above graph gives you where the labels are milliseconds from UTC time. To fix this, do as per alière's suggestion.

    Here is some sample jQuery code (note that you will need to provide the formatDate () function to render the date correctly)

      $ Each (chart.axis [0] .text if (old) {var newLabel = formatDate (originX + x); if (newLabel) {label.attr ({text: newLabel}});}}});  

    I hope this helps!


    Comments

    Popular posts from this blog

    windows - Heroku throws SQLITE3 Read only exception -

    lex - Building a lexical Analyzer in Java -

    python - rename keys in a dictionary -