react-chartjs-2 icon indicating copy to clipboard operation
react-chartjs-2 copied to clipboard

Any way to get Multiple Y-axis graph ?

Open Prasad-YS opened this issue 7 years ago • 1 comments

I need a line graph with two Y-axis sharing one X-axis. Do we have feature here ? if yes how we can achieve that ?

Prasad-YS avatar Jun 12 '19 05:06 Prasad-YS

Achieved this using below code in "options" prop , hence closing the issue

scales: { xAxes: [{ barPercentage: 0.5, barThickness: 22, maxBarThickness: 38, minBarLength: 18,

        ticks: {
            beginAtZero: false
        }
    }]

,

    yAxes: [
        {
            type: 'linear',
            display: true,
            position: 'left',
            id: 'y-axis-1',
            labels: {
                show: false
            },
            ticks: {
                beginAtZero: true,
            }
            
        },
        {
            type: 'linear',
            display: true,
            position: 'right',
            gridLines: {
                display: false
            },
            id: 'y-axis-2',
            labels: {
                show: false
            },
            ticks: {
                beginAtZero: true
            }
        }
    ]
}

Prasad-YS avatar Jun 21 '19 10:06 Prasad-YS