Question

This functionality is available for the Pie Chart via the plotOptions size parameter, however after inspecting the Highcharts API the size isn't available for the Gauge.

size API entry for Pie Chart size API entry for Pie Chart

Considering the likeness of the two charts (being circular), I was hoping there would be a similar option but the gauge always fills some subset of the container div that I am unable to control. Has anyone else run into this issue or found a solution?

Was it helpful?

Solution

By setting the spacing to zero, you can fill the entire space:

http://jsfiddle.net/mkremer90/3sngK/1/

Fiddle with the spacing parameters to change how much the chart fills. As for a percentage based like size option I can't find one either.

OTHER TIPS

I know this is old, but if like me, you have borderWidth set to something greater than 0, you'll find yourself with the tag being positioned (e.g. x="5.5" y="5.5") off from the corner and width and height shrunk. Setting spacing and margin options won't help in this case.

The simple solution then is to avoid setting borderWidth to anything at all; just leave it default or set it to zero. Instead, set the border on the container element you're calling highcharts on.

Alternatively, you could set negative margins and increase size on the container element to compensate for position shift and size shrink on the graph. Might need to wrap the container in a div with style="overflow: hidden;".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top