Common charts parameters
HTTP(s) and WebSockets
You can define your Warp 10 endpoint at the dashboard level and also at the Tile level with endpoint
.
{
'title' 'Dashboard with timer'
'vars' {
'start' NOW
}
'tiles' [
{
'endpoint' 'wss://sandbox.senx.io/api/v0/mobius' // Uses WebSockets
'options' { 'autoRefresh' 1000 'timeMode' 'custom' } // refresh each second
'x' 0 'y' 0 'w' 6 'h' 1
'type' 'hidden'
'macro' <%
NOW 'now' STORE
{ 'data' '' 'events' [ { 'tags' [ 'start' ] 'type' 'variable' 'value' { 'start' $now } } ] }
%>
}
{
'title' 'Timer'
'options' { 'eventHandler' 'type=variable,tag=start' }
'x' 3 'y' 0 'w' 6 'h' 1
'type' 'display'
'macro' <%
$start 'Europe/Paris' ->TSELEMENTS [ 3 5 ] SUBLIST <% TOSTRING 'v' STORE <% $v SIZE 2 < %> <% '0' $v + %> <% $v %> IFTE %> F LMAP ':' JOIN
%>
}
]
}
Those setting are available on most charts.
Zoom and image download toolbox
{
'data' 20 @senx/rand/RANDOMWALK
'globalParams' {
'showControls' true
}
}
Show legend
{
'data' 20 @senx/rand/RANDOMWALK 'data' RENAME
'globalParams' {
'showLegend' true
}
}
Custom dataset names and colors
{
'data' 0 3 <% 20 @senx/rand/RANDOMWALK %> F FOR 4 ->LIST
'params' [
{ 'key' 'My temp sensor' 'datasetColor' '#8A2BE2' }
{ 'key' 'My humidity sensor' 'datasetColor' '#7FFF00' }
NULL
{ 'key' 'My other sensor' }
]
'globalParams' {
'bgColor' 'darkblue'
'fontColor' 'cyan'
'showLegend' true
}
}
Display Errors
<discovery-dashboard url="https://sandbox.senx.io/api/v0/exec">
{
'options' { 'showErrors' true }
'tiles' [
{
'type' 'display'
'x' 0 'y' 0 'w' 12 'h' 1
'macro' <% 'blah' MSGFAIL %>
}
]
}
</discovery-dashboard>
Custom labels for axis
{
'data' 10 @senx/rand/RANDOMWALK
'globalParams' {
'yLabelsMapping' {
'0' 'zero' '1' 'one'
'2' 'two' '3' 'three'
'4' 'four' '5' 'five'
}
}
}
Display values
{
'data' 10 @senx/rand/RANDOMWALK
'globalParams' {
'showValues' true
}
}
Autorefresh
{
'tiles' [
{
'type' 'display'
'x' 0 'y' 0 'w' 12 'h' 1
'options' { 'fontColor' '#ffffff' 'autoRefresh' 3 }
'macro' <%
RAND 100 * ROUND 'v' STORE
{
'data' $v
'globalParams' {
'bgColor' <% $v 50 < %> <% 'red' %> <% 'green' %> IFTE
}
}
%>
}
]
}
Found an issue on this page or something missing?
Tell us on
The Lounge, the Warp 10 Community Slack.