Hello, I’m making a chart with 3 different series. What I want is the values of each series of the x-axis to be visible in the bars itself. I’ve found the cheatsheet for chart configuration, but there doesn’t seem to be a way to specify that you want the value of the x axis displayed in the bar. I tried searching in the documentation of plotly js and there is this: https://plotly.com/javascript/bar-charts/#grouped-bar-chart-with-direct-labels where they set a variable for the value of the x-axis and y-axis. Like this: var xValue = ['Product A', 'Product B', 'Product C']; var yValue = [20, 14, 23]; var trace1 = { x: xValue, y: yValue, type: 'bar', text: yValue.map(String), textposition: 'auto', etc etc where var trace1 is the data that needs to be displayed. In this scenario, the yValue is displayed as text in the bar on the chart. Does anyone know a way to specify a variable in JSON format that can be entered in the ‘advanced’ tab of Bar Chart properties or the Series properties? Or does anyone know another way to display the value of the x axis as text in the bar in my example above? Thanks in advance! Kinds regards, Jan-Willem
asked
Jan-Willem Belder
2 answers
1
Result (direct label):
Where to configure:
1. use the “texttemplate”: “%{y}”
answered
Yong Hua Poh
0
I think you can not do this with the default chart widget, the additional json options don't have this option.