peppinosh
Posts: 3
Joined: Thu Oct 11, 2018 12:21 pm

Multiple yaxis and data series

Hi,
I have created a linear chart using this type of option:

Code: Select all

return options = {
        chart: {
            type: 'line'
        },
        title: {
            text: 'Grafico del PH'
        },
        subtitle: {
            text: 'Andamento del ph nell\' intrvallo di tempo selezionato'
        },
        xAxis: {
            type: 'datetime',
            dateTimeLabelFormats: {
                month: '%e. %b',

            },
            title: {
                text: 'Date'
            }
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle'
        },
        yAxis: {
            title: {
                text: 'PH'
            }
        },

        series: [{
            name: "PH",
            data: dps

        }],
        plotOptions: {
            series: {
                cursor: 'pointer',
                point: {
                    events: {
                        click: function () {
                            showimg(this.x);
                        }
                    }
                }
            }
        },


    };
with this type of data:

Code: Select all

[1538762403000, 64][1538766003000, 63][1538769602000, 60][1538773203000, 65]
is it possible to add another y axis with different data within the same graph while maintaining the same data structure?
[date,y1,y2]

example:

Code: Select all

[1538762403000, 64,1000][1538766003000, 63,2000][1538769602000, 60,2500][1538773203000, 65,5000]
wojtek
Posts: 433
Joined: Tue Jul 03, 2018 12:32 pm

Re: Multiple yaxis and data series

Hi peppinosh,
Is it possible to add another y axis with different data within the same graph while maintaining the same data structure?
[date,y1,y2]
Unfortunately, you have to pass two series with such a structure [date, y1] and [date, y2]. Additionally, bind each series to particular yAxis. Check demo I posted below.

Demo:
http://jsfiddle.net/wchmiel/bw18ryj6/

Kind regards.
Wojciech Chmiel
Highcharts Developer

Return to “Highcharts Usage”