Highcharts Bubblechart min/max bubble size - highcharts

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.

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.

Related

my vertical x axis labels run into my plotted data. Is there a way to compress the graph so I have a little extra room at the bottom

I am plotting my x axis labels vertically, and using the following line to provide a little space under the axis
axisSet.xAxis.axisConstraints = [CPTConstraints constraintWithLowerOffset:40.0];
But now the vertical length of the label bumps into the first value on the y axis. Is there a way to compress the graph a little so the first value on the y axis begins a little higher? Thanks.
Adjust the axis' labelAlignment and/or labelOffset to reposition the labels.

Proportional Pie-charts using High-Charts

I am working with High Charts to plot two pi charts which I need to be proportional. I have calculated the radius of each, but can't find a way to specify a radius for each pi chart. How can I do this?
Use pie series size property.
From docs:
size: String|Number
The diameter of the pie relative to the plot area. Can be a percentage or pixel value. Pixel values are given as integers. The default behaviour (as of 3.0) is to scale to the plot area and give room for data labels within the plot area. As a consequence, the size of the pie may vary when points are updated and data labels more around. In that case it is best to set a fixed value, for example "75%". Defaults to .
example

iOS Core Plot "Function transformation" - Y axis only origin

I cannot find how to do this for a while now, my graph is drawn ok every time but I want to move up my graph, like when you have f(x) + n. So, what I want to do actually is change Y origin, so I can draw my (x,0) points. I do not want to draw my points on X axis, I do not see the line that good. I want that my zero Y point actually starts at point three, but not to transform the graph at the same time. Here is picture of what I want to do (see the green line and Y point):
The plot space yRange controls the range of data visible. The image in the question looks like it has a location of negative one (-1) and length of 18. You can use the axisConstraints to keep the x-axis along the bottom of the plot area. If you don't want to use constraints, set the orthogonalPosition to the location of the yRange.

ios Core plot - scatter plot circles overlap with x, y axes

I am currently plotting certain data using Scatter Plot of Core Plot. The size of the circles depends on the frequency of occurrence of the particular value. On plotting, I find that some of the circles are overlapping and crossing the x and y axes.
Is there any method to check if a circle (i.e, plot point) crosses the axes and automatically resize the circle so that it does not cross the axes?
Edit - The axes are fixed. So I cannot change the axes.
Edit - I would like to know which methods to use to determine if a circle crosses/touches the x or y axis. Currently the circle overlaps if the size of circle is 12 and its y coordinate is 1.1. I am unable to understand how the size is being mapped to the circle on the plot. Thanks.
No. The easiest way around this problem is to figure out how big the largest circle will be and adjust the plot ranges on the the plot space to leave at least that much space between the extreme data points (smallest and largest) and the axes or other edges of the plot space. The plot space has methods to convert back and forth between data coordinates and pixels in the coordinate space of the plot area layer.
The point conversion methods are:
(data to plot area)
-(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint
numberOfCoordinates:(NSUInteger)count;
-(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint
numberOfCoordinates:(NSUInteger)count;
(plot area to data)
-(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count
forPlotAreaViewPoint:(CGPoint)point;
-(void)doublePrecisionPlotPoint:(double *)plotPoint
numberOfCoordinates:(NSUInteger)count
forPlotAreaViewPoint:(CGPoint)point;
Depending on your application, you might be able to expand the plot range by a simple factor using -expandRangeByFactor:. You can find the factor for the xRange by dividing the width of the plot area plus the circle diameter by the width of the plot area. Do a similar calculation for the yRange using the height of the plot area.
Perhaps you could check to see if half of the diameter is greater than both the x and y value of the plot. If it is greater, then reduce the diameter to equal twice the smaller of x and y.

Margin for scatter series in Shinobi Charts on iOS

I'm using a scatter series in Shinobi Charts but points with maximum and minimum x and y values are being truncated because they're at the edge of the plot area?
How can I add a small margin to the plot area so I can clearly see the scatter points and none are truncated. I realise that I can set the range of each axis myself but that gets into nasty math to work out what a 5px margin would be over the lowest/highest values etc.
There are 2 properties on SChartAxis which can help you: rangePaddingLow and rangePaddingHigh. These values are absolute values, and in the scale of the axis.
For example, if you have an axis which has an automatic range of (0,100), then the following would update the range to (-5, 105):
axis.rangePaddingLow = #5;
axis.rangePaddingHight = #5;
As the axis scale updates, these padding values will be maintained.

Resources