kivy.garden.Graph
from numbers to date values or at least change text of x_ticks of the graph.I can create my plot and graph but i don't know how to change x_ticks text values.
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy_garden.graph import Graph, LinePlot
import math
class MyGrid(GridLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cols = 1
self.plot = LinePlot(line_width=1.5, color=[1, 0, 0, 1])
self.graph = Graph(xlabel='Date', ylabel='Y', x_ticks_minor=5,
x_ticks_major=25, y_ticks_major=1,
y_grid_label=True, x_grid_label=True, padding=5,
x_grid=True, y_grid=True, xmin=0, xmax=200, ymin=-2, ymax=2,
x_ticks_angle=90)
self.plot.points = [(x, math.sin(x / 10.)) for x in range(0, 201)]
self.graph.add_plot(self.plot)
self.add_widget(self.graph)
class MyKivy(App):
def build(self):
return MyGrid()
if __name__ == "__main__":
MyKivy().run()