| timechart count by message_data_type
| addtotals col=f row=t
| eval failedratio=failed/Total
| fields _time failedratio Total
failed/Total events
| timechart count by message_data_type
| addtotals col=f row=t
| eval failedratio=failed/Total
| fields _time failedratio Total
Is that what you really want to do? What if there are zero failed events - Success/zero is infinity, or Failed/zero is infinity if there are zero Success events?