# Legends in Time series chart

**URL:** <https://forum.inductiveautomation.com/t/legends-in-time-series-chart/32942>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 9, 2020, 8:55pm UTC](https://forum.inductiveautomation.com/t/legends-in-time-series-chart/32942 "2020-03-09T20:55:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swox](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@swox](https://forum.inductiveautomation.com/u/swox)\
**Post date:** [March 9, 2020, 8:55pm UTC](https://forum.inductiveautomation.com/t/legends-in-time-series-chart/32942/1 "2020-03-09T20:55:19Z")

</div>

Since version 8.06 it’s possible to display legends for the different series. But how is the names of the sets in the series determined? In my chart they turn up as “Col 1, Col 2…”. Is this the column names/headers in the dataset? I’m presenting data fetched from a DB with a runPrepQuery, so there is no column names set by me.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 11, 2020, 4:56am UTC](https://forum.inductiveautomation.com/t/legends-in-time-series-chart/32942/2 "2020-03-11T04:56:20Z")

</div>

Does this help?

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

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [March 11, 2020, 5:44pm UTC](https://forum.inductiveautomation.com/t/legends-in-time-series-chart/32942/3 "2020-03-11T17:44:36Z")

</div>

@swox, Try adjusting the query string that you are using with your `runPrepQuery`. You can rename the columns that you are getting back to a format of your liking; for example, a query like this:

```auto
SELECT time, chart_data.col_1 AS 'Column 1', chart_data.col_2 AS 'Column 2'
FROM chart_data

```

…can result in a legend that looks like this:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/909c3bbf91f649e2c2c9d2940d2814813a3d3541.png)
