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>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:
- Assume the minimum
date
and itsgetTime ()
Cache into a variable of the method (originX
) -
Change each
date
(to curDate
), itoriginX . <<>> <
against
var time passed = curdate.getTime () - originX
-
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
Post a Comment