# Remove legend column alias name from legend time series graph in grafana 8

**URL:** <https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969>\
**Category:** Dashboards\
**Tags:** legend\
**Created:** [May 3, 2023, 8:13am UTC](https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969 "2023-05-03T08:13:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexmondaini](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@alexmondaini](https://community.grafana.com/u/alexmondaini)\
**Post date:** [May 3, 2023, 8:13am UTC](https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969/1 "2023-05-03T08:13:55Z")

</div>

I have a query in grafana using postgres as data source as such:

```
SELECT
  DATE_TRUNC('month', obsolete_date) as "time",
  product_type,
  count(product_type) as "_"
FROM
  evergreen
GROUP BY 1,2
ORDER BY 1

```

On grafana I get the following graph:

 ![unders](https://us1.discourse-cdn.com/grafana/original/3X/c/4/c41700a7a310ca7c324dff3f2a52a225fd6d7241.png)

As one can see, the underscore is present in all legend values of my graph, whatever i type as alias for a column it will appear as the legend. I don’t want that, I want to just have the different values of the column plotted as text for my legend. How can i do that ? i tried regex value mappings on grafana but it did not work for me.

---

<div class="post-metadata">

**Author:** ![alexmondaini](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@alexmondaini](https://community.grafana.com/u/alexmondaini)\
**Post date:** [May 13, 2023, 3:54am UTC](https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969/3 "2023-05-13T03:54:35Z")

</div>

thanks,that solved my issue

---

<div class="post-metadata">

**Author:** ![stefang1](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@stefang1](https://community.grafana.com/u/stefang1)\
**Post date:** [May 1, 2024, 10:32am UTC](https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969/4 "2024-05-01T10:32:13Z")

</div>

Tried the same with …,sum(counter) as value,$\_\_timeEpoch(timestamp)  
but it didn’t work. In the legend the name “value” is shown in front of the names. Are there any other solutions? What works is sum(counter) as " "…

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [May 1, 2024, 12:24pm UTC](https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969/5 "2024-05-01T12:24:45Z")

</div>

```auto
sum(counter) as value,
$__timeEpoch(timestamp) as time,
name as metric

```

you need the last one that describes the column that has the name/description of the thing you want to plot pn time series

---

<div class="post-metadata">

**Author:** ![stefang1](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@stefang1](https://community.grafana.com/u/stefang1)\
**Post date:** [May 1, 2024, 1:09pm UTC](https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969/6 "2024-05-01T13:09:19Z")

</div>

Ok, i see. it just has be to the last one and alias has to be metric.

that would work as well:

```auto
sum(counter),
$__timeEpoch(timestamp),
name as metric

```

Thanks for clarification

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [May 1, 2024, 3:04pm UTC](https://community.grafana.com/t/remove-legend-column-alias-name-from-legend-time-series-graph-in-grafana-8/86969/7 "2024-05-01T15:04:47Z")

</div>


