Min Max limits on Y-axis on ui-chart

Hi,

I just upgrade DB2 to 1.28.0 and I saw some good improvements but also noticed a strange behaviour for the Y-axis Min Max limits in ui-chart when it's left the blank.

If the Min and Max value of the plotted data are below 10 and the difference between them is >1, then the Y-axis in 0 to 10, if the difference is <1 then then Y-axis Min Max limits takes a smaller range.

example flow where by changing the input node a fraction (0.19 to 0.21) the axis limit will change significantly

[
    {
        "id": "57eeafaf51639c49",
        "type": "inject",
        "z": "b442be85913426c0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "1",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0.19",
        "payloadType": "num",
        "x": 1430,
        "y": 440,
        "wires": [
            [
                "163c91835c750286"
            ]
        ]
    },
    {
        "id": "163c91835c750286",
        "type": "ui-chart",
        "z": "b442be85913426c0",
        "group": "e1c6e6cb771c2108",
        "name": "test",
        "label": "Today's prices",
        "order": 1,
        "chartType": "line",
        "category": "a",
        "categoryType": "str",
        "xAxisLabel": "",
        "xAxisProperty": "",
        "xAxisPropertyType": "timestamp",
        "xAxisType": "category",
        "xAxisFormat": "",
        "xAxisFormatType": "custom",
        "xmin": "",
        "xmax": "",
        "yAxisLabel": "Price (€/kWh)",
        "yAxisProperty": "payload",
        "yAxisPropertyType": "msg",
        "ymin": "",
        "ymax": "",
        "bins": 10,
        "action": "append",
        "stackSeries": false,
        "pointShape": "circle",
        "pointRadius": 4,
        "showLegend": false,
        "removeOlder": 1,
        "removeOlderUnit": "86400",
        "removeOlderPoints": "20",
        "colors": [
            "#74a7fe",
            "#32b934",
            "#ff7f0e",
            "#2ca02c",
            "#a347e1",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "textColor": [
            "#666666"
        ],
        "textColorDefault": true,
        "gridColor": [
            "#e5e5e5"
        ],
        "gridColorDefault": true,
        "width": 6,
        "height": "6",
        "className": "",
        "interpolation": "linear",
        "x": 1650,
        "y": 420,
        "wires": [
            []
        ]
    },
    {
        "id": "6486d71f2f4b91ae",
        "type": "inject",
        "z": "b442be85913426c0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "1",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1.21",
        "payloadType": "num",
        "x": 1430,
        "y": 400,
        "wires": [
            [
                "163c91835c750286"
            ]
        ]
    },
    {
        "id": "e1c6e6cb771c2108",
        "type": "ui-group",
        "name": "test",
        "page": "cf478244c05a3ad7",
        "width": "3",
        "height": 1,
        "order": 1,
        "showTitle": false,
        "className": "",
        "visible": "true",
        "disabled": "false",
        "groupType": "default"
    },
    {
        "id": "cf478244c05a3ad7",
        "type": "ui-page",
        "name": "Tasks",
        "ui": "8071e69eb67e4e66",
        "path": "/page1",
        "icon": "home",
        "layout": "grid",
        "theme": "6cf98fc8cedde7c6",
        "breakpoints": [
            {
                "name": "Default",
                "px": "0",
                "cols": "3"
            },
            {
                "name": "Tablet",
                "px": "576",
                "cols": "6"
            },
            {
                "name": "Desktop",
                "px": "1024",
                "cols": "12"
            }
        ],
        "order": 11,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "8071e69eb67e4e66",
        "type": "ui-base",
        "name": "Tamariu",
        "path": "/dashboard",
        "appIcon": "",
        "includeClientData": false,
        "acceptsClientConfig": [
            "ui-control",
            "ui-notification"
        ],
        "showPathInSidebar": false,
        "headerContent": "dashboard",
        "navigationStyle": "temporary",
        "titleBarStyle": "default",
        "showReconnectNotification": false,
        "notificationDisplayTime": 5,
        "showDisconnectNotification": false,
        "allowInstall": true
    },
    {
        "id": "6cf98fc8cedde7c6",
        "type": "ui-theme",
        "name": "Green",
        "colors": {
            "surface": "#ffffff",
            "primary": "#01bb0c",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#b1dd8c"
        },
        "sizes": {
            "density": "comfortable",
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "9px",
            "widgetGap": "18px"
        }
    }
]

I’d like to avoid putting fixed limit for my use case.
Is this a minor bug or expected behaviour?

Any chance you could paste in a couple of screenshots that highlight this?

Also, if you have a good idea how things should be handled, please do say.

The upper input value is 1.21 and the lower is 0.2 in the first image and 0.22 in the second.

My thinking is that the upper limit should be the input values rounded (up or down) to the next significant integer, ten, hundred, etc., depending on its size

Example
Max input = 3.45, max limit sets 4
Max input = 34.5, max limit sets 40
Max input = 345, max limit sets 400
Min input = 3.45, min limit sets 3
Min input = 34.5, min limit sets 30
Min input = 345, min limit sets 300

I hope this helps

1 Like

Excellent info. Would you be kind enough to copy that over to a GitHub issue as a feature request and link back to this thread?

Sure, never done it so a good opportunity to learn

Thank you.

Please note, raising the FR does not 100% guarantee it will happen any time soon (or at all if it gets negative feedback, also, resources are limited) however, contributions are welcome so you never know.

Lets see if it gets any feedback (good or bad) from the community.