Legend format from metric label value

Hi, all
i am very new to Grafana, i have tried to make Graph with a metric query:

max(org_apache_zookeeperservice_standaloneserver_port2181_avglatency > 0) by (name1)

that returns me maximum value of zookeeper metric avglatency. This metric has 2 labels: name1, name2, name3. I am aggregating it by name1 label, because i want maximum value of my metric through name2 and name3, however i want to add name3 label value to legend format of this query. I have tried to put {{name3}} to Legend format box, but it did not work.

Could you please provide me with the solution to this?
Thanks