It is currently Thu Aug 16, 2018 6:36 am Advanced search
{
x: 5,
y: 5,
name: "Sample name",
length: 190,
direction: 18
}
tooltip: {
formatter: function() {
if (typeof this.key === 'number') {
return `${this.series.name}<br /><b>[${this.point.x}, ${this.point.y}]</b><br/>Length: <b>${this.point.length}</b><br/>Direction: <b>${this.point.direction}°</b><br/>`
} else {
return `${this.key}<br /><b>[${this.point.x}, ${this.point.y}]</b><br/>Length: <b>${this.point.length}</b><br/>Direction: <b>${this.point.direction}°</b><br/>`
}
}
},
plotOptions: {
vector: {
dataLabels: {
format: "{point.name}",
enabled: true
}
}
},
chart: {
events: {
load: function() {
var chart = this,
series = chart.series[0],
points = series.points,
vectorLength = series.options.vectorLength,
lengthMax = series.lengthMax;
points.forEach(function(point, i) {
var pointLength = point.length,
ratio = pointLength / lengthMax,
pointRealLength = ratio * vectorLength;
console.log(i + 1 + ". vector's real length is: " + pointRealLength);
})
}
}
},
However, in the point I just mentioned above, [15, 65, 20, 80], the length does not seem to be 20. In fact, the entire vector (tail to head) approximately looks like a length of 2 on the plot at best.
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests