Storing result in TinyDB and using its data for bar chart