# Reorder Pens in the legend?

**URL:** <https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124>\
**Category:** Ignition\
**Created:** [May 2, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124 "2022-05-02T16:28:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [May 2, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/1 "2022-05-02T16:28:41Z")

</div>

I added in a few tags(7) into an easy chart. One of the middle tags and the last one need to be at the top. How do I reorder the tags with out deleting and starting over?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 2, 2022, 4:32pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/2 "2022-05-02T16:32:52Z")

</div>

I would open the ~~`tags`~~ `tagPens` dataset, export to the clipboard to edit the order of the rows, then paste it back.

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [May 2, 2022, 4:42pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/3 "2022-05-02T16:42:43Z")

</div>

I may have no worded it correctly… maybe the picture will help… i want this “pen” to be where the blue arrow is… with out deleting all of the other tags…  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/177f9558163ae86d0eb933406f6077363f3050e1.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 2, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/4 "2022-05-02T16:45:10Z")

</div>

Did you try Phil’s suggestion?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 2, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/5 "2022-05-02T16:45:16Z")

</div>

What I suggested would not delete any pens. Pens set up by drag/drop or by the chart configurator end up as entries in either the `tagPens` property or the `pens` property, which are datasets. Datasets can be sent to the clipboard, edited externally (like changing row order), and pasted back in.

{Ah, typo s/tags/tagPens/ }

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [May 2, 2022, 4:58pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/6 "2022-05-02T16:58:56Z")

</div>

Umm… that sounds like there is code involved with that… I do not know how to code nor would I know where to look 😕 … so you are telling me it is possible, but I will need someone’s help… cool… I can handle that.  
🙂 I’m new and trying to fumble through what I can and can’t teach people(others at my facility) once we get that far… thanks for the help.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 2, 2022, 5:21pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/7 "2022-05-02T17:21:34Z")

</div>

> [@Ben\_Blaschuk](#):
>
> that sounds like there is code involved

No code involved.

In the properties for your EasyChart component scroll to the bottom. There is a `Tag Pens` property. This is a Dataset of all of the tags which have been added to the chart. Select the icon that looks like a table with a magnifying glass on it, this will bring up the Dataset Editor.

On the right hand side of that Dialog, there is an icon that is an arrow pointing to a clip board, click this and then paste it into your favorite editor (Notepad, Notepad ++, etc), reorder the rows as you want them, copy them back to the clipboard after you have re-ordered them how you want. Then using the same dialog, paste them back into the `Tag Pens` dataset.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [May 2, 2022, 5:31pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/8 "2022-05-02T17:31:15Z")

</div>

I actually tried this, and it didn’t work. Maybe i am doing something wrong, but the easy chart pen order did not reflect the re-ordered tags after editing.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/a/3a89b72690147f47cfa5776071efbcf9c2a1d646.png)

Yet:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/73fa40f8a90e2c14f8f88ff65ac52e4c11be84b9.png)

Edit:  
Im a dummy, you have to uncheck order pens, then it works just fine.

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [May 2, 2022, 5:46pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/9 "2022-05-02T17:46:55Z")

</div>

where is order pens???

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [May 2, 2022, 5:48pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/10 "2022-05-02T17:48:40Z")

</div>

Use the copy button, then paste it into a text editor of your choice.  
This is my test dataset, just reorder the last three lines in this example:

```auto
"#NAMES"
"NAME","TAG_PATH","AGGREGATION_MODE","AXIS","SUBPLOT","ENABLED","COLOR","DASH_PATTERN","RENDER_STYLE","LINE_WEIGHT","SHAPE","FILL_SHAPE","LABELS","GROUP_NAME","DIGITAL","OVERRIDE_AUTOCOLOR","HIDDEN","USER_SELECTABLE","SORT_ORDER","USER_REMOVABLE"
"#TYPES"
"str","str","str","str","I","B","clr","str","I","F","I","B","B","str","B","B","B","B","I","B"
"#ROWS","3"
"New Tag 1","[~]New Tag 1","MinMax","Default Axis","1","true","color(85,85,255,255)","","1","1.0","0","true","false","","false","false","false","true",,"true"
"New Tag4","[~]New Tag4","MinMax","Default Axis","1","true","color(85,85,255,255)","","1","1.0","0","true","false","","false","false","false","true",,"true"
"alarmTag","[~]alarmTag","MinMax","Default Axis","1","true","color(255,85,85,255)","","1","1.0","0","true","false","","false","false","false","true",,"true"

```

Then then paste it back in with the button right below the copy button shown in my screen shot.

Oh, my bad, it’s really sort pens  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f08b8656763bf6b491aa29c2caefbb9148a1d8be.png)

---

<div class="post-metadata">

**Author:** ![Ben\_Blaschuk](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Ben\_Blaschuk](https://forum.inductiveautomation.com/u/Ben_Blaschuk)\
**Post date:** [May 2, 2022, 5:50pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/11 "2022-05-02T17:50:28Z")

</div>

Got it… thanks 🙂 worked perfect

---

<div class="post-metadata">

**Author:** ![Roger\_Denison](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Roger\_Denison](https://forum.inductiveautomation.com/u/Roger_Denison)\
**Post date:** [February 27, 2023, 5:46pm UTC](https://forum.inductiveautomation.com/t/reorder-pens-in-the-legend/59124/12 "2023-02-27T17:46:08Z")

</div>

For future reference, you can also scroll to the far right of the Dataset Editor and it'll show the Sort Order. (I have three different sort orders because I have three different groups.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/a/ca548fa6516e28abe88b73e42e40d43b8ce935a9.png)
