function highcharts_line_intersect(line1_data, line2_data, user_options) {
var opt = {
/* The point object for the intersection points that will be appended to the line arrays.
* By default the points will be inserted as [icptX, icptY]
*
* You may customize this by setting it a point object {}.
* Set any custom parameters except x and y which will be overridden with the intersection point
* (Refer: http://api.highcharts.com/highcharts#series.data for the parameters supported by highcharts)
*/
icptPoint: [],
/* Override this method to customize the behavior
* if the lines are parallel (never meets).
*
* (like =, ||, //)
*
* Does not proceed further after this method is called.
*/
onParallel: function () {
console.log('Parallel lines can never meet');
},
/* Override this method to customize the behavior
* if the lines already meet.
*
* (like X, >, <)
*
* Does not proceed further after this method is called.
*
* @param icptX - intersection point X
* @param icptY - intersection point Y
*/
onLinesAlreadyMeet: function (icptX, icptY) {
console.log('Lines already meet at (' + icptX + ',' + icptY + ')');
},
/* Accepts a function that returns true or false
*
* Use this to validate the intersection points before connecting the lines.
*
* For example, you might not want the connect the lines if the
* intersection is too far away.
*
* Does not proceed further if the function does not return true
*
* @param icptX - intersection point X
* @param icptY - intersection point Y
*/
validateIntersection: function (icptX, icptY) {
return true;
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.