# Changing the legend in a Bar Chart in Vision

**URL:** <https://forum.inductiveautomation.com/t/changing-the-legend-in-a-bar-chart-in-vision/54984>\
**Category:** Ignition\
**Created:** [January 13, 2022, 4:30pm UTC](https://forum.inductiveautomation.com/t/changing-the-legend-in-a-bar-chart-in-vision/54984 "2022-01-13T16:30:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dclifton](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@dclifton](https://forum.inductiveautomation.com/u/dclifton)\
**Post date:** [January 13, 2022, 4:30pm UTC](https://forum.inductiveautomation.com/t/changing-the-legend-in-a-bar-chart-in-vision/54984/1 "2022-01-13T16:30:25Z")

</div>

Hello,

I have a bar chart in Vision that shows historical tag data for multiple tags, however the legend shows the full tag path which is a lot of unnecessary information for the user. How can I edit the text in the legend?

---

<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:** [January 13, 2022, 4:43pm UTC](https://forum.inductiveautomation.com/t/changing-the-legend-in-a-bar-chart-in-vision/54984/2 "2022-01-13T16:43:11Z")

</div>

How are you setting the data property of the Chart?

The labels in the legend are set by the Column Titles in the data dataset of the chart.

If you are using a Tag History Binding then you can Change the Column Name for each Tag Path selected.

If you are using a script to populate the data by calling `system.tag.queryTagHistory` then you can provide a list of column names, otherwise it defaults to the tag paths.

From the manual

> List[String] columnNames - Aliases that will be used to override the column names in the result dataset. Must be 1-to-1 with the Tag paths. If not specified, the Tag paths themselves will be used as column titles. [optional]

[https://docs.inductiveautomation.com/display/DOC81/system.tag.queryTagHistory](https://docs.inductiveautomation.com/display/DOC81/system.tag.queryTagHistory)

---

<div class="post-metadata">

**Author:** ![dclifton](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@dclifton](https://forum.inductiveautomation.com/u/dclifton)\
**Post date:** [January 13, 2022, 4:49pm UTC](https://forum.inductiveautomation.com/t/changing-the-legend-in-a-bar-chart-in-vision/54984/3 "2022-01-13T16:49:22Z")

</div>

I was using the system.tag.queryTagHistory in a script, and your suggestion worked! Thank you!
