# How to set a grouped-by column to be used as the legend values in a TIme series chart?

**URL:** <https://community.grafana.com/t/how-to-set-a-grouped-by-column-to-be-used-as-the-legend-values-in-a-time-series-chart/138655>\
**Category:** Dashboards\
**Created:** [December 18, 2024, 1:54pm UTC](https://community.grafana.com/t/how-to-set-a-grouped-by-column-to-be-used-as-the-legend-values-in-a-time-series-chart/138655 "2024-12-18T13:54:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eparizzi](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/eparizzi/32/51139_2.png) [@eparizzi](https://community.grafana.com/u/eparizzi)\
**Post date:** [December 18, 2024, 1:54pm UTC](https://community.grafana.com/t/how-to-set-a-grouped-by-column-to-be-used-as-the-legend-values-in-a-time-series-chart/138655/1 "2024-12-18T13:54:42Z")

</div>

- What Grafana version and what operating system are you using?  
Grafana Cloud

I have the following result (queried from InfluxDB 3.0 with the InfluxDB official data source plugin).

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/4/8/488c94b45e662cc5adc9b4eb26ec92a23e936753.png)

Currently, the legend shows Current, AdjustedChargeCurrentLimit and AdjustedDischargeCurrentLimit.

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/3/0/30546703a15b0785647c49abba66208fe26bacdb.png)

I want the legend to list all the instances and allow me to visualize altogether or any combination of specific ones. So, for this dataset the legend should contain: 1401B, 1402A, 1403A and so on.

Which transformation do I need to use to achieve this?

---

<div class="post-metadata">

**Author:** ![eparizzi](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/eparizzi/32/51139_2.png) [@eparizzi](https://community.grafana.com/u/eparizzi)\
**Post date:** [December 18, 2024, 2:06pm UTC](https://community.grafana.com/t/how-to-set-a-grouped-by-column-to-be-used-as-the-legend-values-in-a-time-series-chart/138655/2 "2024-12-18T14:06:54Z")

</div>

Adding the “Partition by values” transformation and setting the Field to instance generates the appropiate timeseries tables (one per instance)

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/0/a/0a26ede8fa8f2c70cbcfc56ed76512a9f8344be3.png)  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/d/6/d67460c08ed52be3ab2a9b1183a1a9dcb3620066.png)

Still, the line chart insists in showing all column values in the legend list instead of just the instance.

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/5/7/57fb6295f5b4c8a7828e48cde68c38081ab04a54.png)

For sure this is a very common requirement to visualize data. How is this that hard? What am I’m missing here?
