Skip to content

Instantly share code, notes, and snippets.

@dceejay
Created April 5, 2018 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dceejay/9d407ebf23b1f9214720dd9360445b6e to your computer and use it in GitHub Desktop.
Save dceejay/9d407ebf23b1f9214720dd9360445b6e to your computer and use it in GitHub Desktop.
simple scatter chart - line chart without lines

Sometimes you may just want to plot points rather than lines (or curves) on a chart.

A feature of the lines chart is that we can break the lines by sending a null or false as the payload, so we can break all the points into pieces by using this trick.

The simple way to do this is to use a trigger node to pass though the original message and then also send a boolean false a few milliseconds later.

You will also need to tick the enlarge points option in the line chart so that the points are visible.

[
{
"id": "45518a88.0a5c34",
"type": "inject",
"z": "66742658.e5d518",
"name": "",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 150,
"y": 400,
"wires": [
[
"54f0a7ca.c0b728"
]
]
},
{
"id": "54f0a7ca.c0b728",
"type": "random",
"z": "66742658.e5d518",
"name": "",
"low": "1",
"high": "10",
"inte": "true",
"property": "payload",
"x": 320,
"y": 400,
"wires": [
[
"49d0f9f1.54e0b8"
]
]
},
{
"id": "49d0f9f1.54e0b8",
"type": "trigger",
"z": "66742658.e5d518",
"op1": "",
"op2": "false",
"op1type": "pay",
"op2type": "bool",
"duration": "10",
"extend": false,
"units": "ms",
"reset": "",
"bytopic": "all",
"name": "",
"x": 490,
"y": 400,
"wires": [
[
"2224575e.8f4f38"
]
]
},
{
"id": "2224575e.8f4f38",
"type": "ui_chart",
"z": "66742658.e5d518",
"name": "",
"group": "5003631.3bc729c",
"order": 0,
"width": 0,
"height": 0,
"label": "chart",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": true,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "60",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"useOldStyle": false,
"x": 650,
"y": 400,
"wires": [
[],
[]
]
},
{
"id": "5003631.3bc729c",
"type": "ui_group",
"z": "",
"name": "Default",
"tab": "44904efc.96d75",
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "44904efc.96d75",
"type": "ui_tab",
"z": "",
"name": "Home",
"icon": "dashboard"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment