Comments (4)
I'm suffering on the same issue.
from node-red-dashboard.
If You want, I have a "hacky" solution. But! note that this way, it refreshes the whole chart every time it gets a new value, so if You are using phone data and have a big chart with a fast refresh rate, it will chew your data out in no time.
In the chart set series to key: bar and y to key: value. You can change those names obviously.
And before the chart, create a function with this code:
var data = context.get("data") || [];
//init data if does not exist yet
if (data.length === 0)
for (var i = 0; i < 60; i++) {
const bar = ("0" + i).slice(-2) + ".";
data.push({ bar, value: 0 });
}
//update value
var index = data.findIndex(d => d.bar == msg.bar);
if (index != -1) data[index].value = msg.payload;
context.set("data", data);
msg.payload = data;
return msg;
It is pretty self-explanatory, but in any case, the code stores all the chart data in context, and when a message arrives with a bar value, it finds its column, updates the value, saves it in context, and sends it to the chart.
Btw. when setting the series to JSON, something similar happens - it always expects all the data and redraws the whole chart.
It would be really cool if it would just init the chart on the first time and then updates the columns depending on the payload.
Now, if any value is missing in the payload, but is specified in the series, it treats it as 0.
from node-red-dashboard.
@Martin12350 Yes: this is a kind of workaround
But it happens also with line diagrams!
If you press several times F5 to reload the page, sporadically the sequence of the lines in the legend is changed and so the colors of the lines are exchanged.
from node-red-dashboard.
I have also a cool proposition, but that should be probably in another thread.
When passing a new value to the chart, it could check for msg.options, where could be specified options for that specific value, such as color of the bar, color of the line, line width for the segment etc.
It is similar idea, that somebody already mentioned as advanced config (#58), but the difference is, it would be specific to the value, not the whole chart. That way we could have multicolored charts based on value, instead of the group.
from node-red-dashboard.
Related Issues (20)
- Dynamic Properties: UI Form
- Variable `--layout-columns` not defined for `Fixed` Layout HOT 1
- Dashboard Page set to `hide` after updating parameters
- dynamic Grafana plugin in iframe did not work HOT 3
- v1.12.0: Size of widget not respected for Fixed layout HOT 4
- New Nodes: In/Out User-Specific Context Store HOT 2
- ui-dropdown - topic is lost when using Accept Client Data
- ui-dropdown - Dropdown shows "No options available" when options are provided dynamically HOT 6
- File Input: Add examples HOT 2
- Updating to @flowfuse/[email protected] a bug occurred in "ui-group node" HOT 24
- ui-dropdown - Not parsing `options` when widget is reload based on message `widget-load` HOT 1
- Third party ui node, in onInput: function (msg, send, done), send(object) sends original msg, not object HOT 2
- Can be overriden at runtime by sending a particular msg to the ui-form node ? HOT 2
- Item text not showing in dropdown menus HOT 3
- HowTo: Use button from dashboard 2.0 to get an external Link. HOT 3
- ui-text-input, multiline text area does not fill available space. HOT 1
- File Input: Support larger file uploads
- ui-dropdown doesnt display selected value when sent via. msg HOT 4
- ui-dropdown doesnt pass correct value for multiple select options - and when msg pass through is enabled. HOT 2
- ui text box - when user clears the data - no event gets generated. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-dashboard.