Grafana8.1: how to show two lines in one panel and use both left/right y axis?

I can show two lines on one panel; and now I want to set the first line to use left y axis, the second line to use right line;
In overrides, I can set the first line to use left or right y axis, but I find I cant set the second to use some y axis and the second line always use the same y axis as the first one.

Set the unit for the first query, then create an override to change the unit for the second query.

If you want both queries to have no unit, set the first one to Misc > short and leave the second one empty

grafik

grafik

grafik

thanks for your reply.
According to your guide, when I want to “create an override to change the unit for the second query”, I find I can choose nothing as below:
image

I guess maybe my query is not right, my query is as below:
the first query:

from(bucket: "crency")

  |> range(start:-100d)

  |> filter(fn: (r) =>

      r._measurement == "closes" and

      r._field == "BC"

  )

  |> yield()

The second query:

from(bucket: "crency")

  |> range(start:-100d)

  |> filter(fn: (r) =>

      r._measurement == "closes" and

      r._field == "BT"

  )

  |> yield()

Do the queries show up on the Diagram?

You can try setting the legend of the query and override “Fields with name”

This is how I would do it with prometheus:
image

image

Judging by :

I’m assuming you are using elasticsearch? I have no experience working with this integration, so if there’s an issue with the query, someone else will need to help you.

I use “Flux language syntax” to write this query; yes, they can show up on the diagram, but I just can’t set left/right y axis and I guess maybe it is because of the query.

My data is in InfluxDB,and its structure is as below(bucket: crency, measurement: closes):


Could you write the query to show “BC” and “BT” according to your method?
And in addition, where do you learn this method?
Thanks a lot.

To show the second line on the RHS y-axis, just click on the legend and assign it to the right axis. This assignment is done via the legend and not the panel menu.

I see you have asked elsewhere but this works/ed for me.

see: Learn Grafana: How to use dual axis graphs | Grafana Labs

thanks for you advice;
I find no option to set right y aixs on “legend” on my grafana 8.1 as below:


and I find this option is on “override” as below:
image
but whatever I select “left” / “right”, nothing changed.

In the face, I don’t know how to show these two lines by granfa8.1 syntax rather than Flux language syntax

Ha, ha that’s the problem.

I mean the actual legend on the panel itself and not in the panel edit menu as you are trying to use.

image

image

This way you may assign any number of lines to either the left or right y-axis.

Hope this helps.

I guess we use different version; My version is Grafana8.1;


no legend.

It is right there in front of you.

Click on the GREEN line named LINK and the LEGEND menu will pop up.

In the pic above you can click on either the red, blue, green, or purple line and a menu will pop up. The menu has 3 tabs (colours, custom and Y-axis) just select the y-axis tab and assign whichever line you wish to the RHS y-axis and one and you get as shown below

I am using GRAFANA v8.06 and it worked with all previous versions as well.

image

thanks for your help;
When I select one line of panels, nothing pop out, so maybe because of the version.
I should consider reinstall.
Thank you a lot.

Maybe you are using the new Time series panel and not the Graph(old) panel.

The new Time series panel does not have this feature and that’s why you cannot see the pop up menu.

So it might not be a version issue.

thanks again.
I am familiar with the old version, and I install new one for expecting something amazing, but suprising things is coming…

Ha, ha yes the new time Series panel lacks several features the old Graph panel has.