How to display Y value permanently on a line chart?

0
Hi All, How to display Y value permanently on a line chart? It is displayed only when hover my mouse pointer by default, what is that it should be displayed without hovering it. I googled it but was not able to get proper answer yet. Thank you in advance.  
asked
3 answers
1

Hi,

You need to add some custom json to the series advanced tab. instead of the markers and lines it will also show the value for Y.

More info, look here: https://plotly.com/javascript/text-and-annotations/

and here (2.1.1 – 7): https://docs.mendix.com/refguide/charts-configuration#advanced-mode

{
“mode”: “lines+markers+text”
}
answered
0

Thank you for your answer and I have one more question.
I made change to the advanced option for each series and chart as below, but it does not make any change to the displayed chart.
Can you please correct what I have done?

 

 

 

answered
0

Hi,

Forgot to mention, you also need to provide a texttemplate attribute to the JSON. So f.e.:

    "texttemplate": "%{y}", → will show the value for Y.

You can also use “textposition” for text placement, use one of ( "top left" | "top center" | "top right" | "middle left" | "middle center" | "middle right" | "bottom left" | "bottom center" | "bottom right" )

You only have to place this json on the series item advanced options, not on layout of configuration options. Also set mode to advanced or developer.

So f.e.:

{
“mode”: “lines+markers+text”,
"texttemplate": "%{y}",
“textposition”: “top center”
}

 

answered