wrobstory / vincent

A Python to Vega translator
MIT License
2.04k stars 227 forks source link

Dates in Line charts #131

Closed Rockyyost closed 9 years ago

Rockyyost commented 9 years ago

How do I get the line chart to understand that I have a date value as my x? It turns into into a number and plots it all wrong.

I query MongoDB and convert the results into a pandas data frame. I've given the line chart objects like: Timestamp('2014-11-05 00:00:00') and as datetime.datetime(2014, 11, 12, 0, 0) and nothing work. If I get a plot, it just treats the time as a number.

Thanks!

wrobstory commented 9 years ago

What happens if you use a DatetimeIndex as the dataframe index?

Rockyyost commented 9 years ago

It works! Sorry, I didn't even think about doing it that way. Thanks so much!