Kibana version: 5.1.2
Elasticsearch version: 5.1.1
Server OS version: TBD
Browser version: 55.0.2883.95
Browser OS version: Mac OS X 10.12.3
Original install method (e.g. download page, yum, from source, etc.):
Description of the problem including expected versus actual behavior:
When entering into timelion the following expression: .es(q=name:my_thing,metric=sum:gauge.value,split=status:5).fit(none) I would like the fit() function to be applied on each of the 5 timeseries that are returned through the split. Instead I am receiving a red alert at the top with "Timelion: Error: in cell #1: Cannot read property '1' of undefined". When clicking on More info, I am getting this trace:
Error: in cell #1: Cannot read property '1' of undefined
at throwWithCell (/usr/share/kibana/src/core_plugins/timelion/server/handlers/chain_runner.js:30:11)
at /usr/share/kibana/src/core_plugins/timelion/server/handlers/chain_runner.js:192:11
at bound (domain.js:280:14)
at runBound (domain.js:293:12)
at tryCatcher (/usr/share/kibana/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/usr/share/kibana/node_modules/bluebird/js/main/promise.js:503:31)
at Promise._settlePromiseAt (/usr/share/kibana/node_modules/bluebird/js/main/promise.js:577:18)
at Promise._settlePromises (/usr/share/kibana/node_modules/bluebird/js/main/promise.js:693:14)
at Async._drainQueue (/usr/share/kibana/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/usr/share/kibana/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues (/usr/share/kibana/node_modules/bluebird/js/main/async.js:15:14)
at runCallback (timers.js:637:20)
at tryOnImmediate (timers.js:610:5)
at processImmediate [as _immediateCallback] (timers.js:582:5)
I think it's the presence of zeros in the data that causes .fit() to choke. Here is a simpler expression that triggers this error: .static(0).fit(none)
Any chance of this getting fixed? This prevents us from properly creating a lot of charts we'd need, and it's very hard to communicate to teams what to avoid doing.
Yes, it's the presence of zeros. One awful workaround for this is:
.add(0.0001).fit('average').subtract(0.0001)
Avoids the error. And surprisingly, it looks better. Here is a pic. Top chart shows the result with the trick, bottom chart shows it without it.

Please address this bug. While the workaround suggested by @carlosvega helps in some cases, it exacerbates Timelion's existing problems of sparse documentation and expressions that are esoteric/unreadable.
I'm also seeing Timelion: Error: in cell #1: Cannot read property '1' of undefined when a Timelion graph is added on a dashboard and a filter is applied which returns zero results.
Most helpful comment
Any chance of this getting fixed? This prevents us from properly creating a lot of charts we'd need, and it's very hard to communicate to teams what to avoid doing.