简体   繁体   中英

Second Y-Axis in Highcharts linked to specific data series

i have 6 series (lines) within one chart categorized by date. one of the series has a way higher max point than all the others making them disappear into aa single line at the bottom. the data is generated from different reports with series in different order but mostly with the same data mixed together with variable data. i want to add a second y-axis on the right to keep that one single series separated from all the other data but i need a way to tell highcharts to take a specific series which name i know. series.name would be always the same. is there any way to accomplish that?

thanks!

This is how you define "y" axes -

yAxis: [{},{},{}] 
// so "yAxis" is just an array of y-axis-objects (i.e. yAxis[0], yAxis[1]...)

And you can tell Highcharts which one of these y axes you want your series be associated with as follows -

series: [{yAxis: 1}, {yAxis: 2}, {}]

So, your first series will be associated with yAxis[1] , second with yAxis[2] and the third by default with yAxis[0] .

Check out the API ref on yAxis and series .

You can also see the demo of dual-axes here . There you can click the "View Options" to see how the options object is configured.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM