How to put legend out of HighCharts chart

1

Someone doyouknowhowIputthislegendoutofmychart?

//Createthechart

Highcharts.stockChart('grafico_relatorio',{legend:{enabled:true},scrollbar:false,exporting:{filename:nome_da_exportacao,chartOptions:{legend:{enabled:true},//inputEnabled:falserangeSelector:false,scrollbar:false,navigator:false}},rangeSelector:{selected:5,buttons:[{type:'all',text:'Tudo'},{type:'hour',count:1,text:'1h'},{type:'hour',count:12,text:'12h'},{type:'day',count:1,text:'1d'},{type:'day',count:7,text:'7d'},{type:'month',count:1,text:'1m'}]},credits:{text:'InMetrics',position:{align:'right',x:0,y:5},style:{fontSize:'1em',}},chart:{type:'line',zoomType:'x'},tooltip:{shared:true},series:seriesOptions,yAxis:{//---PrimaryyAxistitle:{text:metrica},labels:{align:'right'},gridLineColor:'#b1b7b0',gridLineWidth:2}});

    
asked by anonymous 05.10.2017 / 19:35

2 answers

2

In the documentation you can do this modification with the following code snippet:

yAxis:{
    labels: {
        x:20
    }
}

It would look like this:

yAxis: { //--- Primary yAxis
                title: {
                    text: metrica
                },
                labels: {
                    align: 'right',
                    x:20
                },
                gridLineColor: '#b1b7b0',
                gridLineWidth: 2
            }

References: Link , Link2

    
05.10.2017 / 20:19
0

Within the Y axis add the property opposite: true this will integer the values and the legend from the left side to the right.

yAxis: {
        opposite: true,

        title: {text: metrica},
        labels: {align: 'right'},
        gridLineColor: '#b1b7b0',
        gridLineWidth: 2
}       
    
05.10.2017 / 20:18