Multiple Y Axes

0
I try to get a chart working with two Y-axis but until now no results. I have a simple Column chart with two series and for each serie I want a different Y-axis. I use the Column chart widget. In Serie 1 I have under advanced:    {     "name": "Y-axis 1",     "yaxis": "yaxis2",     "type": "line"   } Serie two advanced:   {     "name": "Y-axis 2",     "yaxis": "yaxis",     "type": "bar"   } In the widget I have Advanced and set the mode to developer under Layout option I have the next:   {   "yaxis1": {     "title": "Y-axis 1",     "zeroline": true,     "color": "#4682B4",     "showgrid": true,     "showline": true   },   "yaxis2": {     "title": "Y-axis 2",     "color": "#FF8C00",     "showgrid": true,     "showline": true,     "zeroline": true,     "overlaying": "y",     "side": "right"   } }   The result is just one Y-axis.
asked
3 answers
1

For the data objects, try to use the values from the example here

Try using 'y2' as the value for 'yaxis' for the second series. 

answered
1

Add the following Plotly options in the Advanced tab for Series 1 and Series 2 respectively:

{
   "name":"YourSeriesName1",
   "type":"bar",
   "yaxis":"y",
   "offsetgroup":1
}

and;

{
   "name":"YourSeriesName2",
   "type":"bar",
   "yaxis":"y2",
   "offsetgroup":2
}

In the Advanced tab of the chart widget, add the following Layout options:

{
   "title":"YourChartTitle",
   "barmode":"group",
   "autosize":true,
   "yaxis":{
      "title":"YourAxisTitle1"
   },
   "yaxis2":{
      "title":"YourAxisTitle2",
      "overlaying":"y",
      "side":"right"
   },
   "showlegend":true,
   "legend":{
      "orientation":"v",
      "y":1.25,
      "x":1
   }
}

The output will be similar to this:

answered
0

I have It now working change the Yaxis name to “Y2”

{     "name": "Y-axis 1",     "yaxis": "y2",     "type": "bar"   }

Now I have the next thing, if I change both the series to bar then they are stacked on to of each other.

answered