If a variable is expected to be fetched every minute, and it doesn't happen, the graph shows the last known value for all the timespan until the next known value.
The expected behavior for me is that the graph showed no line, or a line next to the zero, where there is no data.
How to achieve this with Zabbix?
This depends on item interval and item type. If this is a trapper item, that can't be done currently. If it is a "normal" item with retrieval interval, Zabbix will show empty area when enough values will be missing.
Not sure I understood the question. If it's about custom parameters that don't always return some value, you can use something like this:
Thus the
| grep . || echo 0
will output either the found value or 0 if stdout is empty.