Thank you. I like your thinking!!!!
That works perfectly with a few tweaks but you got me on the right track.
http://imgur.com/a/QdEMp
Here is the actual dashboard in all its glory. Essentially it is charting the average speed for traffic on freeways over the last 6 months with percentiles to give an idea of variability then comparing to today traffic speeds.
<dashboard stylesheet="liveworm.css" refresh="300">
<label>Foyer 1 - Live Freeway Speeds</label>
<description>* Upper and lower bands indicate the 95th and 5th percentile of the average speed.</description>
<search id="base">
<query>| tstats count AS "Count of BluetoothLinks" avg(BluetoothLinks.speed) AS speed from datamodel=Customer_Bluetooth_Averaged.BluetoothLinks where (nodename = BluetoothLinks) (BluetoothLinks.Freeway="Y") (BluetoothLinks.WORKDAY_FLG= "Y ") (BluetoothLinks.bluetooth_id="*") (BluetoothLinks.date_hour>=5) (BluetoothLinks.date_hour<=20) groupby BluetoothLinks.TIME_KEY_30M, BluetoothLinks.DATE_KEY
| rename BluetoothLinks.TIME_KEY_30M AS TIME_KEY
| rename BluetoothLinks.DATE_KEY AS DATE_KEY
| fields TIME_KEY, DATE_KEY, speed
| stats avg(speed) AS "Average speed" perc95(speed) AS "95th Percentile speed" perc5(speed) AS "5th Percentile speed" by TIME_KEY
| join type=left TIME_KEY
[ search index=Customer* sourcetype=json_bluetooth_links bluetooth_id="*" Freeway="Y" earliest=@d latest=now
| eval speed = (length/1000)/(travel_time/60)
| eval timeSegmentMin=floor(date_min/30) * 30
| eval timeSegmentMin=if(length(timeSegmentMin)<2,"0"+timeSegmentMin,timeSegmentMin)
| eval TIME_KEY = date_hour + ":" + timeSegmentMin
| eval today_metric = if (strftime(time(), "%Y%m%d") == strftime(_time, "%Y%m%d"), speed, NULL)
| fields today_metric, speed, name, bluetooth_id, _time, TIME_KEY
| stats avg(today_metric) as "Today speed" by TIME_KEY ]
| eval _lower = "5th Percentile speed"
| eval _upper = "95th Percentile speed"
| eval _predicted = "Average speed"
| rename TIME_KEY AS "Time of Day"
| eventstats min("5th Percentile speed") as min max("95th Percentile speed") as max |eval max=max+5 |eval min=min-5</query>
<earliest>-6mon</earliest>
<latest>@day</latest>
<done>
<set token="maxaxis">$result.max$</set>
<set token="minaxis">$result.min$</set>
</done>
</search>
<row>
<panel>
<chart id="liveworm">
<title>Min $minaxis$ and Max $maxaxis$</title>
<search base="base">
<query>fields "Time of Day", "Average speed", "5th Percentile speed", "95th Percentile speed", "Today speed", _lower, _upper, _predicted</query>
</search>
<option name="charting.axisLabelsX.majorLabelStyle.rotation">-90</option>
<option name="charting.axisY.includeZero">0</option>
<option name="charting.chart">line</option>
<option name="charting.axisY.minimumNumber">$minaxis$</option>
<option name="charting.axisY.maximumNumber">$maxaxis$</option>
<option name="charting.chart">line</option>
<option name="charting.fieldColors">{"Today speed": 0xE51010, "Average speed": 0x1E93C6, "Median speed":0x9DD1F9}</option>
<option name="height">750</option>
</chart>
</panel>
</row>
</dashboard>
... View more