Uptime percentage from zabbix

Hi,

I have Zabbix plugin installed and a custom item in zabbix that returns either 1 or 0. I need to calculate percentage of time when the value was 1.

I already have a graph that shows uptime as a line, but the requirement is to get it as percentage as well, in addition to what I have. It can be in the same graph or in a new one.

Is this possible to do?

Thanks in advance
Pavol