let chart;
let data = new Array();
function handleClick() {
data = document.getElementById('graph:hi').value;
alert(data);
}
let chartData = new Array(66, 15, 2.5, 21.9, 25.2, 23.0, 22.6, 21.2, 19.3, 16.6, 14.8);
alert(chartData);
jQuery(document).ready(function (e) {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'spline',
ignoreHiddenSeries: false
},
title: {
text: 'Height Report'
},
subtitle: {
text: ''
},
xAxis: {
categories: ['0', '0.5', '1.5', '2.5', '3.5', '4.5', '5.5', '6.5', '7.5', '8.5', '9.5', '10.5', '11.5', '12.5', '13.5', '14.5', '15.5', '16.5', '17.5', '18.5', '19.5', '20.5', '21.5', '22.5', '23.5', '24.5', '25.5', '26.5', '27.5', '28.5', '29.5', '30.5', '31.5', '32.5', '33.5', '34.5', '35.5']
},
yAxis: {
title: {
text: 'Percentage'
},
labels: {
formatter: function () {
return this.value + '%';
}
}
},
tooltip: {
formatter: function () {
return '' + this.x + ': ' + this.y;
}
},
plotOptions: {
spline: {
marker: {
radius: 3,
lineColor: '#666666',
lineWidth: 1
}
}
},
series: [{
name: 'Pecentile 3',
data: chartData
}, {
name: 'Pecentile 10',
data: data
}]
});
});
This is an XHTML code snippet with a graph plotting functionality. The value obtained in the click() function is retrieved and passed to the jQuery function for graph plotting. However, there seems to be an issue with retrieving the values in the jQuery function. Thank you.