让我知道如何组合所选的选项+表单输入值来创建我的图表。 只有我选择的选项" (变量是" x")可用而不是选择的输入值(变量是"总计")。
filterCalc();
function filterCalc() {
$.getJSON('data_salaries2.JSON', function (data) {
var x = document.getElementById('people2').selectedIndex;
var y = document.getElementsByTagName('option')[x].id;
//radio buttons
$('input[name=BtRadio]').click(function () {
// Whenever a radiobox is clicked, the following code would be executed
var total = $('input[name=BtRadio]:checked').val();
});
//Charts
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column',
},
labels: {
formatter: function () {
return this.value.toLocaleString();
}
},
series: [{
name: [data.annee2011[x].metier],
data: [data.annee2005[x].total, data.annee2006[x].total, data.annee2007[x].total, data.annee2008[x].total, data.annee2009[x].total, data.annee2010[x].total, data.annee2011[x].total]
}, ]
});
});
};