Modifying the y.axis of a graph

Hello, a query, it is possible to eliminate these points from the y-axis of a graph. I would like to be able to do that since I only want to graph two boolean states 0 or 1.
I'd appreciate your help.

This is my function node:

It is possible.
But it does override all about the scales configuration. Ticks, grid, colors .... All that needs to be also configured.

[
    {
        "id": "ce96a4b5901ad0ef",
        "type": "ui_chart",
        "z": "2e6686c4918f199d",
        "name": "",
        "group": "c7a27394.057878",
        "order": 15,
        "width": 0,
        "height": 0,
        "label": "chart",
        "chartType": "line",
        "legend": "false",
        "xformat": "HH:mm:ss",
        "interpolate": "step",
        "nodata": "",
        "dot": false,
        "ymin": "",
        "ymax": "",
        "removeOlder": 1,
        "removeOlderPoints": "",
        "removeOlderUnit": "60",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 710,
        "y": 310,
        "wires": [
            []
        ]
    },
    {
        "id": "e283fc5fde025a95",
        "type": "random",
        "z": "2e6686c4918f199d",
        "name": "",
        "low": "0",
        "high": "1",
        "inte": "true",
        "property": "payload",
        "x": 470,
        "y": 300,
        "wires": [
            [
                "ce96a4b5901ad0ef"
            ]
        ]
    },
    {
        "id": "3ba79bebb39971a4",
        "type": "inject",
        "z": "2e6686c4918f199d",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "2",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 300,
        "wires": [
            [
                "e283fc5fde025a95"
            ]
        ]
    },
    {
        "id": "f5e78a2878ead886",
        "type": "change",
        "z": "2e6686c4918f199d",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "ui_control",
                "pt": "msg",
                "to": "{\"options\":{\"scales\":{\"yAxes\":[{\"ticks\":{\"max\":1,\"min\":0,\"stepSize\":1}}],\"xAxes\":[{\"type\":\"time\"}]}}}",
                "tot": "json"
            },
            {
                "t": "delete",
                "p": "payload",
                "pt": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 450,
        "y": 340,
        "wires": [
            [
                "ce96a4b5901ad0ef"
            ]
        ]
    },
    {
        "id": "de716142b9180916",
        "type": "inject",
        "z": "2e6686c4918f199d",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 340,
        "wires": [
            [
                "f5e78a2878ead886"
            ]
        ]
    },
    {
        "id": "c7a27394.057878",
        "type": "ui_group",
        "name": "CHART",
        "tab": "54e197d8.7f7fe8",
        "order": 2,
        "disp": false,
        "width": "9",
        "collapse": false
    },
    {
        "id": "54e197d8.7f7fe8",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]
1 Like

Hello, thanks for your help, I already applied it and it works fine.
A query if I want the maximum and minimum values ​​and the time of the axes to take a white color, what instruction should I use?

Explore the examples from this topic.

Thank you very much, in another post I saw that you helped someone to dynamically modify the x-axis of a graph, that also helped me.

Greetings.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.