# Changing the line width in a multi line chart

**URL:** https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728
**Category:** Dashboard
**Tags:** node-red-dashboard
**Created:** [16 June 2024 08:57 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728 "2024-06-16T08:57:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jomifa](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jomifa](https://discourse.nodered.org/u/jomifa)
#### Post date: [16 June 2024 08:57 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728/1 "2024-06-16T08:57:22Z")

</div>

Hello,  
I am displaying several charts in an aggregated line diagram. Node-red-contrib-aggregator is used here. However, the charts are displayed in a very thick line width. Is it possible to make the line thickness thinner?

 ![Linien Diagramm](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a6c0a6aa0248e8eb2701e135bd67273db5e8c97a.png)  
 ![Linien Diagramm Ausgabe](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3fe4b08ed24d9d5362a728cd200d1f697774338.png)

I use nodered 3.1.9

Regards  
Joachim

---

<div class="post-metadata">

### Author: ![jomifa](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jomifa](https://discourse.nodered.org/u/jomifa)
#### Post date: [25 June 2024 12:23 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728/2 "2024-06-25T12:23:04Z")

</div>

Hey guys, it can't be that nobody can help me here. Get off your Olympus and help a beginner

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [25 June 2024 12:25 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728/3 "2024-06-25T12:25:49Z")

</div>

Maybe this thread can help you out

> [@Changing line thickness in ui\_chart](https://discourse.nodered.org/t/changing-line-thickness-in-ui-chart/42626):
>
> What is the correct way to use msg.ui\_control to change the line thickness in a ui\_chart? I've seen this post, and example by @hotNipi - and I'm adding msg.ui\_control in the function which formats the chart data, a simplified extract would be; msg.payload = chartdata; msg.topic = 'status'; msg.ui\_control = { "options": { "elements": { "line": { "borderWidth": 1 } } } } ...which changes the chart unexpectedly! [chart]

---

<div class="post-metadata">

### Author: ![jomifa](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jomifa](https://discourse.nodered.org/u/jomifa)
#### Post date: [25 June 2024 13:21 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728/4 "2024-06-25T13:21:57Z")

</div>

I have integrated ui\_control into my function. The line thickness has improved. However, I get bold measuring points. In addition, a background color is added to the individual graphs.

function:

```auto
var topic;
var payload;
var ui_control;

for (let i = 0; i < 6; i++) {
    switch (i) {
        case 0:
                topic = null;
                payload = []; // clear chart
                break;
        case 1: topic = 'PV [W]';
                payload = 0;
                break;
        case 2: topic = 'Hausverbrauch [W]';
                payload = 0;
                break;
        case 3: topic = 'Netz [W]';
                payload = 0;
                break;
        case 4: topic = 'Akku [W]';
                payload = 0;
                break;
        case 5: topic = 'Wallbox [W]';
                payload = 0;
                break;
        }

        **ui_control = { "options": { "elements": { "line": { "borderWidth": 1 } } } }**

    var newmsg = {payload:payload,topic:topic,ui_control:ui_control};
    node.send(newmsg);
}
return;

```

The diagram then looks like this:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/dbd0751ba755c0afd05ebd645491ac78d684eff1.png)

---

<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 June 2024 13:25 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728/5 "2024-06-25T13:25:55Z")

</div>

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

As to your issue, try using the ui\_control object from the post marked as the solution.

---

<div class="post-metadata">

### Author: ![jomifa](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jomifa](https://discourse.nodered.org/u/jomifa)
#### Post date: [25 June 2024 13:38 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728/6 "2024-06-25T13:38:38Z")

</div>

> [@E1cid](#):
>
> As to your issue, try using the ui\_control object from the post marked as the solution

Thanks for the info and yes, it looks better now

---

<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: [25 July 2024 13:39 UTC](https://discourse.nodered.org/t/changing-the-line-width-in-a-multi-line-chart/88728/7 "2024-07-25T13:39:27Z")

</div>

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