# Stacked chart with fixed min/max y-axis value not working?

**URL:** <https://discourse.nodered.org/t/stacked-chart-with-fixed-min-max-y-axis-value-not-working/61754>\
**Category:** Dashboard\
**Created:** [25 April 2022 13:59 UTC](https://discourse.nodered.org/t/stacked-chart-with-fixed-min-max-y-axis-value-not-working/61754 "2022-04-25T13:59:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [25 April 2022 13:59 UTC](https://discourse.nodered.org/t/stacked-chart-with-fixed-min-max-y-axis-value-not-working/61754/1 "2022-04-25T13:59:39Z")

</div>

I am trying to make a stacked bar chart with a fixed min. and max. y-axis value, but it doesn't seem to be working.  
Anyone got ideas about this?

```auto
[
    {
        "id": "42f3dd586a56e31d",
        "type": "ui_chart",
        "z": "dfc64657.22c578",
        "name": "Energie bar chart",
        "group": "1e13d6c969d22fe2",
        "order": 10,
        "width": 8,
        "height": 4,
        "label": "{{title}}",
        "chartType": "bar",
        "legend": "false",
        "xformat": "HH:mm:ss",
        "interpolate": "linear",
        "nodata": "",
        "dot": false,
        "ymin": "",
        "ymax": "",
        "removeOlder": 1,
        "removeOlderPoints": "",
        "removeOlderUnit": "604800",
        "cutout": 0,
        "useOneColor": false,
        "useUTC": false,
        "colors": [
            "#ffffff",
            "#ff0000",
            "#ff0000",
            "#ff7f0e",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "outputs": 1,
        "useDifferentColor": false,
        "className": "",
        "x": 750,
        "y": 1740,
        "wires": [
            []
        ]
    },
    {
        "id": "c4576be3adafabb8",
        "type": "function",
        "z": "dfc64657.22c578",
        "name": "",
        "func": "msg.payload = [{\n \"series\": [\"X\", \"Y\"],\n \"data\" : [[5], [7]],\n \"labels\": [\"Jan\"]\n}]\nmsg.ui_control = {\n ymin: 0,\n ymax: 50,\n options: {\n scales: {\n xAxes: [{\n stacked: true\n }],\n yAxes: [{\n stacked: true\n }]\n }\n }\n}\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 540,
        "y": 1740,
        "wires": [
            [
                "42f3dd586a56e31d"
            ]
        ]
    },
    {
        "id": "69978bab5b5b5691",
        "type": "inject",
        "z": "dfc64657.22c578",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 360,
        "y": 1740,
        "wires": [
            [
                "c4576be3adafabb8"
            ]
        ]
    },
    {
        "id": "1e13d6c969d22fe2",
        "type": "ui_group",
        "name": "Test",
        "tab": "d7901f40.2659d",
        "order": 5,
        "disp": true,
        "width": 8,
        "collapse": false,
        "className": ""
    },
    {
        "id": "d7901f40.2659d",
        "type": "ui_tab",
        "name": "Grafieken",
        "icon": "insert_chart",
        "order": 10,
        "disabled": false,
        "hidden": false
    }
]

```

---

<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:** [25 April 2022 15:13 UTC](https://discourse.nodered.org/t/stacked-chart-with-fixed-min-max-y-axis-value-not-working/61754/2 "2022-04-25T15:13:36Z")

</div>

Try

```auto
msg.ui_control = {
     options: {
         scales:{
            xAxes: [{
                stacked: true
            }],
            yAxes: [{
                stacked: true,
                ticks: {
                    min: 0,
                    max: 50 
                }
            }]
         }
    }
}

```

ui-chart uses alot of chart.js options

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [25 April 2022 17:30 UTC](https://discourse.nodered.org/t/stacked-chart-with-fixed-min-max-y-axis-value-not-working/61754/3 "2022-04-25T17:30:26Z")

</div>

@E1cid Thanks very much, working perfectly!!

---

<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:** [9 May 2022 17:31 UTC](https://discourse.nodered.org/t/stacked-chart-with-fixed-min-max-y-axis-value-not-working/61754/4 "2022-05-09T17:31:23Z")

</div>

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