kivy-garden / graph

Displays plots on a graph.
MIT License
50 stars 18 forks source link

Feature Request: Datetime support #2

Open meequz opened 9 years ago

meequz commented 9 years ago

It would be nice to be able to plot data by dates (datetime instances) on X axis, like in matplotlib. Useful for plotting some logs, for example. Something like this:

import datetime base = datetime.date.today() date_list = [base - datetime.timedelta(days=x) for x in range(0, 5)] points_x = date_list points_y = [2, 3, 3, 2, 1] plot = MeshLinePlot(color=[1, 1, 0]) plot.points = zip(points_x, points_y) graph.add_plot(plot)

carlosporta commented 7 years ago

Hi meequz, have you solved your problem? I need a solution for that too.

meequz commented 7 years ago

@caaarlos Hi. No, I'm not. I had also wanted to rotate the date X ticks, because they can be long, but I hadn't found this feature too. So I had decided to start from it, and implemented it: #41. But no feedback received since. It seems kivy developers are not interested in developing this widget at all.

You may also look at https://github.com/kivy-garden/garden.touchgraph

Chao-Jen commented 7 years ago

@meequz and @caaarlos Hi I added a TimeSeriesGraph class to support datetime X axis. You may take a look at the example screenshot at https://github.com/Chao-Jen/garden.graph