Change pie to bar in active poll

What Don showed you should be correct.

myPoll = Poll.find_by(post_id: Topic.find_by(id: 7068).posts.first.id)
myPoll.chart_type = 'pie'
myPoll.save

You want to find the Topic data based on the topic ID (7068).
You retrieve the poll data based on the first post ID.
You change the chart type and save.