# DB2 - Chart node - time serie

**URL:** <https://discourse.nodered.org/t/db2-chart-node-time-serie/95712>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [28 February 2025 16:38 UTC](https://discourse.nodered.org/t/db2-chart-node-time-serie/95712 "2025-02-28T16:38:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Switchblade2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/switchblade2/32/60655_2.png) [@Switchblade2](https://discourse.nodered.org/u/Switchblade2)\
**Post date:** [28 February 2025 16:38 UTC](https://discourse.nodered.org/t/db2-chart-node-time-serie/95712/1 "2025-02-28T16:38:01Z")

</div>

Hi,  
I'm starting to use DB2 and struggle with the Chart node.  
I have an object containing a time serie that I want to plot

I get the chart to display the input if I put "X-axis type" as "Linear", but the I can format the dates on the x-axis.  
If I put the "X-axis type" as "Timescale" that chart is blank after input.  
Any ideas on what I'm missing?

```auto
[
    {
        "id": "6a15b152e6bbf7a4",
        "type": "ui-chart",
        "z": "087c3e2c9ec31c54",
        "group": "a38af8cdfd40b7a9",
        "name": "graphy",
        "label": "timechart",
        "order": 1,
        "chartType": "line",
        "category": "",
        "categoryType": "none",
        "xAxisLabel": "Date",
        "xAxisProperty": "x",
        "xAxisPropertyType": "property",
        "xAxisType": "time",
        "xAxisFormat": "",
        "xAxisFormatType": "d/L",
        "xmin": "",
        "xmax": "",
        "yAxisLabel": "Rainfall [mm]",
        "yAxisProperty": "y",
        "yAxisPropertyType": "property",
        "ymin": "0",
        "ymax": "100",
        "bins": "",
        "action": "replace",
        "stackSeries": false,
        "pointShape": "circle",
        "pointRadius": "8",
        "showLegend": false,
        "removeOlder": "365",
        "removeOlderUnit": "86400",
        "removeOlderPoints": "",
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "textColor": [
            "#666666"
        ],
        "textColorDefault": true,
        "gridColor": [
            "#e5e5e5"
        ],
        "gridColorDefault": true,
        "width": 6,
        "height": 8,
        "className": "",
        "interpolation": "linear",
        "x": 510,
        "y": 240,
        "wires": [
            []
        ]
    },
    {
        "id": "1b009d913bff4bec",
        "type": "inject",
        "z": "087c3e2c9ec31c54",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "a",
        "payload": "[{\"x\":1734821701,\"y\":50},{\"x\":1740696901,\"y\":10}]",
        "payloadType": "json",
        "x": 330,
        "y": 240,
        "wires": [
            [
                "6a15b152e6bbf7a4"
            ]
        ]
    },
    {
        "id": "a38af8cdfd40b7a9",
        "type": "ui-group",
        "name": "Graphs",
        "page": "aebc2d7fc859603b",
        "width": "6",
        "height": "1",
        "order": 2,
        "showTitle": true,
        "className": "",
        "visible": "true",
        "disabled": "false",
        "groupType": "default"
    },
    {
        "id": "aebc2d7fc859603b",
        "type": "ui-page",
        "name": "UI2",
        "ui": "8071e69eb67e4e66",
        "path": "/ui2",
        "icon": "",
        "layout": "grid",
        "theme": "6cf98fc8cedde7c6",
        "breakpoints": [
            {
                "name": "Default",
                "px": "0",
                "cols": "3"
            },
            {
                "name": "Tablet",
                "px": "576",
                "cols": "6"
            },
            {
                "name": "Small Desktop",
                "px": "768",
                "cols": "9"
            },
            {
                "name": "Desktop",
                "px": "1024",
                "cols": "12"
            }
        ],
        "order": 1,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "8071e69eb67e4e66",
        "type": "ui-base",
        "name": "UI2",
        "path": "/dashboard",
        "appIcon": "",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-control",
            "ui-notification"
        ],
        "showPathInSidebar": false,
        "showPageTitle": true,
        "titleBarStyle": "default",
        "showReconnectNotification": false,
        "notificationDisplayTime": 5,
        "showDisconnectNotification": false
    },
    {
        "id": "6cf98fc8cedde7c6",
        "type": "ui-theme",
        "name": "Green",
        "colors": {
            "surface": "#ffffff",
            "primary": "#01bb0c",
            "bgPage": "#eeeeee",
            "groupBg": "#ffffff",
            "groupOutline": "#cccccc"
        }
    }
]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [28 February 2025 16:50 UTC](https://discourse.nodered.org/t/db2-chart-node-time-serie/95712/2 "2025-02-28T16:50:47Z")

</div>

The chart node expect an ISO timestamp or a unix timestamp in milliseconds. Your timestamps are in seconds. Therefore the chart plots them but you limit the chart to display last 365 days. Convert your timestamps to milliseconds or ISO timestamps.

---

<div class="post-metadata">

**Author:** ![Switchblade2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/switchblade2/32/60655_2.png) [@Switchblade2](https://discourse.nodered.org/u/Switchblade2)\
**Post date:** [28 February 2025 16:54 UTC](https://discourse.nodered.org/t/db2-chart-node-time-serie/95712/3 "2025-02-28T16:54:25Z")

</div>

Thanks, so simple but yet so impacting  
I put is seconds as it seems to be written that way is the instruction

> - If your data is an object, you can provide the key of the timestamp in your data, e.g. `{"myTime": 1234567890}` would set the "X" property to the type `key` and the value `myTime`.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [28 February 2025 17:03 UTC](https://discourse.nodered.org/t/db2-chart-node-time-serie/95712/4 "2025-02-28T17:03:29Z")

</div>

Understandable, and I don't see any where in the chart doc's that actually states the time formats that the chart accepts.

Does anyone know if the accepted formats are documented? @joepavitt

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [28 February 2025 18:18 UTC](https://discourse.nodered.org/t/db2-chart-node-time-serie/95712/5 "2025-02-28T18:18:41Z")

</div>

Fair point, oversight on my part, and apologies @Switchblade2 for the mis-leading example. I won't get a chance to fix it before Monday - but if anyone can open a Pull Request in the mean time, they're always welcome

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 March 2025 18:19 UTC](https://discourse.nodered.org/t/db2-chart-node-time-serie/95712/6 "2025-03-14T18:19:40Z")

</div>

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