How to get number of pixels between two points in Highcharts? - highcharts

Knowing two plotted data points on a series in Highcharts, how do I get the number of pixels between them?

In series data you can find: chart.series[0].data[0].plotX so to get distance between two points, use: chart.series[0].data[5].plotX - chart.series[0].data[0].plotX

Related

Map data points onto an image in google sheets?

I'd like to be able to plot points onto this image automatically based on a data set in google sheets. Is this possible? If so, how do you do it?
Edit: For example, if I have the data
#1 - 7,8
#2 - 8,7
I'd like to plot those on the map like so:
First, I think I could have a stored table of the center pixel coordinates of each hex, then vlookup the coordinates (e.g. 8,7) on that table to pull the pixel coordinates. Then I have pixel coordinates to plot on the image, I am just unsure of how to plot them.
I ended up making a scatterplot on top of it using vlookup to convert the hex coordinates above to x and y pixel coordinates on the image.

space proportional between points in x-axis

Is it possible in high-charts to show your X axis proportional to your data points.
Lets say my x axis data is [1,2,5,8,30,50] and these are say years.
I would like the chart to distance the points proportionally so the chart looks more reasonable to view. In this example while point 1, 2 would be closer but distance between 2 and 5 should be roughly three times distance between 1 and 2 and so on.
Basic idea is when you see how the values are changing between year 8 and 30 than visually it conveys right message to your brain.
Thanks
You can use the tickPositions feature and pass a wanted array of the xAxis values to achieve your requirements.
Demo: https://jsfiddle.net/BlackLabel/vm1eh4su/
API: https://api.highcharts.com/highcharts/xAxis.tickPositions

Is there a way to get the length of a softened curve with HighCharts?

I wonder if HighCharts provides a way to get the length of a curve plotted along the serie of points in a x,y chart.

I have a set of N deformed circles made of lines. How to generate similar circle?

I have a set of N deformed circles made of lines. Each circle can have difrent amount of lines defining it. They are deformed in difrent manner but one could see the similarities between them. How to generate a new similar circle having desired lines count K - which ML algorithms it is better to look into?
A circle that pass near of given vertices (in general case, it isn't possible to pass through all vertices) can be estimated with some maths. For example see here
An aproximation can be achieved by:
Get the coordinates of the centroid,
two simple (x,y) average.
The radius can be estimated by the average of the distances from vertices to the centroid.

Own spline calculation within highcharts possible?

Is there a way in Highcharts to add an own spline calculation or do I have to caluclation several points and add that to the regular spline calculation as values?
You have to first calculate your points, then add them to the chart.

Resources