-
Notifications
You must be signed in to change notification settings - Fork 74
Chart: Add "timestamp" type for x-property #1389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This is a good idea, but there is the risk of breaking existing Dashboard. |
It will not break existing Dashboards, I've even added an E2E test in using a config from an older chart to make sure it doesn't. If you still choose the "key" type, but pass no "key", it will still fall back to a timestamp |
| yAxisProperty: { value: 'payload' }, | ||
| yAxisPropertyType: { value: 'msg' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is changing the default to msg.payload sane?
I am struggling to grasp why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, the first/easiest use case for a chart is to use a numerical value coming in via msg.payload (e.g. a slider) with the x-value being generated as a timestamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, in a case where they have sensor data via MQTT, the payload may be a raw value, or an object, at which point msg.payload.sensor (or equivalent) is appropriate too.
Steve-Mcl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved (with question)
Description
keymeant that the x-value would then be a timestamp - it made no sense. So I stopped recording, and fixed it instead.This now means the config for a slider plugged straight into a chart looks like this:
Which reads far better.
xAxisPropertyTypedefaults totimestamp, and legacy charts, where thexAxisPropertyTypeis stillproperty, but the value is blank.Related Issue(s)
No issue raised, was a frustration/confusion, and came straight in with the fix.