dpsdce
dpsdce

Reputation: 5460

specify which series groups should be plotted on which Y Axes

I am trying to figure out if its possible to series group plotting with respect to Y axes for example i have 5 series

physics, chemistry, maths , literature, programming .

assume my data is also in the above order when i plot the graph normally without giving different y axes it will generate the graphs corresponding to default y axis,

if specify{ yaxis : 'y2axis'} it will print the chemistry graph on secondary y axes while all other graphs are print w.r.t y axis. and i can plot all these five elements on different y axes by specifying the corresponding {yaxis:yNaxis}

is there any way by which i can specify that plot physics, chemistry on y1 axis and rest three subjects on y2 axis? currently by default it plots the graph w.r.t y axis and if we specify yaxis : 'y2axis' only a single graph would be plotted for y2 .

Upvotes: 3

Views: 945

Answers (1)

Irongaze.com
Irongaze.com

Reputation: 1645

You can specify which axis a series is plotted to by specifying the yaxis value in the series info for that series, like so:

series: [
  {
    label: 'Physics',
    yaxis: 'y2axis',
    ... other data here ...
  },
  {
    label: 'Chemistry',
    yaxis: 'yaxis',
    ... other data here ...
  },
  ... etc ...
]

Hope that helps!

Upvotes: 2

Related Questions