HighCharts - pass mean value from bell curve to a function

128 views Asked by At

I am using Highcharts and I have a histogram with bull curve behind. Everything works well, bell curve generates mean and standard deviation numbers . I would like to know if there is a way of passing the mean and standard deviation numbers that are on top of the curve to an outside function so that I can conduct another statistical operation with them.

Thanks,

1

There are 1 answers

0
ppotaczek On

You can get the required values from created chart. For example:

const chart = Highcharts.chart('container', {
    ...
});

const bellCurveSeries = chart.series[0];
const mean = bellCurveSeries.mean;
const xData = bellCurveSeries.xData;
const yData = bellCurveSeries.yData;

console.log(mean, xData, yData);

Live demo: https://jsfiddle.net/BlackLabel/v7prbxmo/

API Reference: https://api.highcharts.com/class-reference/Highcharts.Chart#series