Question

I want to display some dynamic data on a bubblechart. At the moment, when points are added or taken away, highcharts is recalculating the size of the remaining bubbles. Is there a way to specify the min/max like there is on the x and y axis ?

I have seen a minSize and maxSize option in the source code, but I think these specify pixels, not a min max value for the data.

Was it helpful?

Solution

Highcharts calculates the size of the bubbles like this:

largest bubble radius = maxSize smallest bubble radius= minSize

So if you add a bubble with a lower z value then the smallest bubble, the new bubble will get radius minSize. The bubble that used to be the smallest bubble will grow. The same goes for a new bubble that is larger then the largest bubble.

If you know the possible range of z values, you could calculate minSize based on the distance of the smallest z-value to the start of that range and maxSize on the distance of the largest z-value to the end of that range. Now if you add a bubble that is smaller that the smallest bubble, you adjust minSize. The existing bubbles will keep their previous size.

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