You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be no way to render a chart using pyplot.plot, you have to use the figure which doesn't allow for xticks or set_xticks.
I'm running into a block to label the data with custom tick labels as a result of this.
Steps to reproduce
I've got user generated data from a function that just records input to a sqlite db.
data = cursor.execute("SELECT * FROM emotion_tracking ORDER BY datetime DESC limit 20").fetchall()
if data:
dates = [len(data) - data.index(row) for row in data]
print(dates)
states = [row[1] for row in data]
self.dates = np.array(dates)[::-1]
self.states = np.array(states)[::-1]
self.labels = self.dates
self.data = data
I've organised it so that the most recent will be displayed on the right hand side of the chart
The chart is built using this function.
def draw_chart(self, chart, figure, *args, **kwargs):
print("in draw chart")
# Draw the chart
ax = figure.add_subplot(1,1,1)
# ax.set_xticks(rotation = 90)
ax.plot(self.dates, self.states)
ax.set_xlabel('Date')
ax.set_ylabel('EQ Score')
ax.set_title('Daily Average Emotions Over Time')
This displays the chart:
When I change it to use dates, we get a big mess.
I'm wanting to a aggregate the data (a numpy function I'm sure) but more importantly and the point of the ticket, display the days in a readable way, ideally roation=vertical.
Expected behavior
I was hoping to use plotly.plot but this creates a new window.
using add_sublot doesn't allow for xticks or set_xticks on a subplot.
Screenshots
No response
Environment
Operating System: Mac OS 12.2
Python version: 3.9.12
Software versions:
Briefcase:0.3.11
Toga:0.3.0.dev39
Toga_chart: 0.1.1
Logs
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
There seems to be no way to render a chart using pyplot.plot, you have to use the figure which doesn't allow for xticks or set_xticks.
I'm running into a block to label the data with custom tick labels as a result of this.
Steps to reproduce
I've got user generated data from a function that just records input to a sqlite db.
I've organised it so that the most recent will be displayed on the right hand side of the chart
The chart is built using this function.
This displays the chart:
When I change it to use dates, we get a big mess.
I'm wanting to a aggregate the data (a numpy function I'm sure) but more importantly and the point of the ticket, display the days in a readable way, ideally roation=vertical.
Expected behavior
I was hoping to use plotly.plot but this creates a new window.
using add_sublot doesn't allow for xticks or set_xticks on a subplot.
Screenshots
No response
Environment
Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: