Search code examples
javascriptjqplottimeserieschartyaxis

Assign a series to an axis in jqplot


I have a jqplot chart with 8 series. 7 of these are normalized in such a way that they look great with the default yaxis. The last series, however, needs to utilize a secondary yaxis. There are a ton of examples on utilizing a dual yaxis presentation when there are only two series.

So my question: Can you assign a specific series to a specific axis? If so, how?

Thanks in advance!


Solution

  • Ok -- I ended up finding an example in the api docs, where previously I was searching through the examples.

    {
       series:[
           {color: '#ff4466', lineWidth: 5, label:'good line'},
           {yaxis: 'y2axis', shadow: false, label:'bad line'}
       ]
    }
    

    The yaxis option is available per series, which allows a specific series to be assigned to a specific yaxis.

    I hope this helps someone else.