display in % on Y - AnyChart Widget

1
Hi Community, I am using the AnyChart widget, I would like the legend on the left side to be displayed as 0-100% and the values in the columns to adjust their size to this range, is this possible? this is data: [ { "x": [ "Test Project", "Project Test", "XSXSAXXSAXSAXXSAXSAXSA" ], "y": [ 5, 1, 0 ], "name": "Red", "type": "bar", "hovertemplate": "%{y}", "textposition": "inside", "texttemplate": "%{y}", "textangle": 0 }, { "x": [ "Test Project", "Project Test", "XSXSAXXSAXSAXXSAXSAXSA" ], "y": [ 6, 1, 0 ], "name": "Yellow", "type": "bar", "hovertemplate": "%{y}", "textposition": "inside", "texttemplate": "%{y}", "textangle": 0 }, { "x": [ "Test Project", "Project Test", "XSXSAXXSAXSAXXSAXSAXSA" ], "y": [ 2, 1, 0 ], "name": "Green", "type": "bar", "hovertemplate": "%{y}", "textposition": "inside", "texttemplate": "%{y}", "textangle": 0 }, { "x": [ "Test Project", "Project Test", "XSXSAXXSAXSAXXSAXSAXSA" ], "y": [ 24, 0, 0 ], "name": "Grey", "type": "bar", "hovertemplate": "%{y}", "textposition": "inside", "texttemplate": "%{y}", "textangle": 0 } ] layout:   { "font": { "family": "Open Sans", "size": 14, "color": "#555" }, "autosize": true, "hovermode": "closest", "hoverlabel": { "bgcolor": "#888", "bordercolor": "#888", "font": { "color": "#FFF" } }, "margin": { "l": 30, "r": 30, "b": 110, "t": 30, "pad": 5 }, "showlegend": true, "xaxis": { "title": { "text": "" }, "showgrid": false, "fixedrange": true, "gridcolor": "#d7d7d7", "zeroline": false }, "yaxis": { "title": { "text": "" }, "showgrid": true, "fixedrange": true, "gridcolor": "#d7d7d7", "zeroline": true, "zerolinecolor": "#d7d7d7", "rangemode": "tozero" }, "barmode": "stack", "colorway": [ "red", "yellow", "green", "grey" ] }  
asked
1 answers
2

Hi Adam,

Sure, you just need to add a Range within the yaxis configuration in the Layout, just below “rangemode”:

"range": [0, 100]

For more information, refer to the Plotly documentation: https://plotly.com/javascript/reference/layout/yaxis/

answered