y value on column chart

0
Hi community,   I want to display the Y value in a column chart:   I have seen this post: Mendix Community - Question Details However, when I add  { “mode”: “lines+markers+text”, "texttemplate": "%{y}", “textposition”: “top center” } to the advances tab in de series item:     I get an error in the mendix console:   And in the app:   Does anyone have a solutions?
asked
3 answers
1

Hi Erik Diepstraten,

You can just add Y value in Tooltip hover text which is available in series.

 

answered
0

Hi Erik,


I stumbled upon your post while trying to implement something similar to this.


Drop the mode line and use the regular double quotes in the JSON configuration and it should work.


Also check the valid values for textposition from plottly documentation

https://plotly.com/javascript/reference/bar/#bar-textposition

answered
0

hi,


You cannot use mode: "lines+markers+text" for a column chart — that option is only for line/scatter charts, not columns. Putting it in the Advanced JSON for a column chart causes the widget to crash.

To show the Y value on the columns, just use texttemplate and textposition without mode:


{
  "texttemplate": "%{y}",
  "textposition": "outside"
}

Put this in the Advanced → Custom series options for your column series. This will display the Y value on each bar.


Why this works:

Column charts don’t support the mode setting — that’s why the widget couldn’t render. texttemplate and textposition work because Plotly allows those for bar/column series.

answered