-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
date time format %Y-%m-%d %H:%M:%S to create line chart #17
Comments
Hi, another Pyxley user here. At Tamedia Digital (Zurich), the data science team is planning to use Pyxley for quick dashboard implementation. We'd love to see datetimes supported for line charts. Thanks! |
Another user who is using Pyxley and ran into this same issue. One should be allowed to specify the date format of the data. |
I think the problem is that I'm casting a string to a Date. You should be able to format however you like, it just needs to be a string when it's transmitted to the javascript. I can probably force that in the default request function. |
No. I tried string and it did not work. If I recall right the problem is Thanks On Thu, Jan 7, 2016 at 8:23 AM, Nick Kridler [email protected]
|
Here's the javascript code that does the conversion. _update: function(params) {
d3.json(this.props.options.url.concat("?",$.param(params)),
function(error, data){
var options = this.props.options.params;
if(data.date){
for(var i=0; i < data.result.length; i++){
data.result[i] = MG.convert.date(data.result[i], "x");
}
}
options.data = data.result;
MG.data_graphic(options);
}.bind(this));
}, https://github.com/stitchfix/pyxleyJS/blob/master/src/metricsgraphics.js I'll have to look in to it and try it with different date formatting. |
Right. On this line data.result[i] = MG.convert.date(data.result[i], "x"); is https://github.com/mozilla/metrics-graphics/wiki/Convenience-Functions Thanks for your help. On Thu, Jan 7, 2016 at 8:47 AM, Nick Kridler [email protected]
|
This worked for me:
My date in database looks like this: 2018-04-28T13:24:55Z |
Hi Pyxley Team ,
first of all congratulation for the Wonderfull framework . I have one query here if i would like to create a line chart given in example metricsgraphics with date - time(x- axis) so what should be format of Date Column in the csv file for date - time(x axis) .
dateparse = lambda x: pd.datetime.strptime(x, '%Y-%m-%d %H:%M:%S')
df = pd.read_csv("fitbit_data.csv", parse_dates=['Date'], date_parser=dateparse)
sf = df.set_index("Date").stack().reset_index()
i have already tried but line charts failed with Date as %Y-% m-%d %H:%M:%S. line charts only works well with date format as %Y-% m-%d .
The text was updated successfully, but these errors were encountered: