After some experimenting and reading related questions I solved this problem by a slightly indirect route, hence writting up this question/answer to help anyone running into the same issue, and to see if there is a better alternative way to achieve the same result.
As indicated in the question, I found that due to the rows for the chart being real rows, the conditional check for resultCount would always be true, and therefore never hide the panel. Therefore, by using an additional always hidden single value panel, I performed a sum of all the values that go into the timechart and only keep the result if the sum of all values is > 0 (or, != or <, whatever your use case requires), this panel can then have a conditional statement of match="'job.resultCount' > 0" to set a token that is used to hide the other chart based. I've produced a complete demo dashboard to show how this works:
<form>
<label>Hide Flat Timechart Demo</label>
<description>Demo to show how to hide a timechart when all input values are zeros.</description>
<fieldset submitButton="false">
<input type="dropdown" token="val_a">
<label>second chart value</label>
<choice value="a">visible (value=a)</choice>
<choice value="b">hidden (value=b)</choice>
<default>a</default>
<initialValue>a</initialValue>
</input>
</fieldset>
<row>
<panel>
<chart>
<title>Never Hidden</title>
<search>
<query>
| makeresults
| eval a=1
| timechart span=1h count AS a
| fields _time, $val_a$
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">line</option>
<option name="charting.chart.nullValueMode">zero</option>
<option name="charting.drilldown">none</option>
</chart>
</panel>
</row>
<row>
<panel>
<title>Always hidden</title>
<single depends="$hidden$">
<search base="may_be_hidden">
<query>
| stats sum(a) AS number
| where number > 0
</query>
<done>
<condition match=" 'job.resultCount' > 0 ">
<set token="show_chart_b">true</set>
</condition>
<condition>
<unset token="show_chart_b">true</unset>
</condition>
</done>
</search>
</single>
</panel>
</row>
<row>
<panel>
<chart depends="$show_chart_b$">
<title>Sometimes Hidden</title>
<search id="may_be_hidden">
<query>
| makeresults
| eval a=1
| timechart span=1h count AS a
| fields _time, $val_a$
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">line</option>
<option name="charting.chart.nullValueMode">zero</option>
<option name="charting.drilldown">none</option>
</chart>
</panel>
</row>
</form>
... View more