简体   繁体   中英

HighMaps: Align ColorAxis within Legend

http://jsfiddle.net/sgrg93/brev29jg/

legend:{
    borderWidth: 1,
    width: 300     //to increase the width of legend more than that of ColorAxis
},

In the above fiddle, width of the legend is more than that of the ColorAxis. The ColorAxis is left aligned within the legend. Is there any way to align the ColorAxis to the center or the right within the legend box?

I don't want to use

this.legend.contentGroup.translate(50,0)

on load() event of chart

Sure, you can alter the object 'legend' to disable it with:

legend:{
  enabled: false
}

Is there a reason you need the whitespace at all?

If you remove the width property, you could simply make the surrounding box the correct size for your legend, as so:

 legend:{
           borderWidth:1
           //width:300
        },

http://jsfiddle.net/brev29jg/1/

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