Plot Tag's Alarm to a chart

For a given Tag's Alarm.
Is it possible to plot when it became Active and Not Active.

I guess I would need to create a query against alarms' database table?