Proportional Pie-charts using High-Charts - highcharts

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

Related

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.

CorePlot YAxis with two types of Scaling

Is it possible to achieve different scaling for positive part of Y-axis and different scaling for its negative part of Y-axis.The idea is to show most part of plot area for positive values and less part for negative values.
Set the yRange of the plot space so that 20% of the range is negative. For example, a range with a location of -25 and length of 125 meets this requirement.

Highcharts Bubblechart min/max bubble size

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.

How do I transform between datetimes and chart coordinates in Highcharts Renderer?

I have a Highcharts scatter plot with a datetime x axis. The x values are all in the past. The y coordinates are positive integers, typically in the range 100..10k. I want to draw lines from the imaginary point (tomorrow, 0) back to some of the data points.
The Renderer's path command looks to take absolute coordinates in chart space. How do I transform the point (tomorrow,0) into those absolute coordinates?
Also, assume the data was from 1995..2005. The default auto-scaling of Highcharts would make tomorrow be off the chart to the right. What will happen when drawing the path? Will the chart remain the same scale and the line be clipped at the right-hand edge? (That would be OK). Would the chart be redrawn with a new scale so that the x axis covered the whole span from 1995 to tomorrow? Something else?
Thanks in advance...
Found it. There is a translate() function to do the conversion. See the Highcharts support forum thread for info on the function.
Use Axis.toPixels() and Axis.toValue()

Resources